Skip to content

Commit

Permalink
Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsDenBakker committed Aug 21, 2020
1 parent d2daf32 commit c7216a5
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 32 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# autopublish-template
# chai

[![npm version](https://img.shields.io/npm/v/@esm-bundle/autopublish-template.svg?style=flat)](https://www.npmjs.com/package/@esm-bundle/autopublish-template) [![build status](https://travis-ci.com/esm-bundle/autopublish-template.svg?branch=master)](https://travis-ci.com/esm-bundle/autopublish-template) [![](https://data.jsdelivr.com/v1/package/npm/@esm-bundle/autopublish-template/badge)](https://www.jsdelivr.com/package/npm/@esm-bundle/autopublish-template)
[![npm version](https://img.shields.io/npm/v/@esm-bundle/chai.svg?style=flat)](https://www.npmjs.com/package/@esm-bundle/chai) [![build status](https://travis-ci.com/esm-bundle/chai.svg?branch=master)](https://travis-ci.com/esm-bundle/chai) [![](https://data.jsdelivr.com/v1/package/npm/@esm-bundle/chai/badge)](https://www.jsdelivr.com/package/npm/@esm-bundle/chai)

["What is this" blog post](https://medium.com/@joeldenning/an-esm-bundle-for-any-npm-package-5f850db0e04d)

[Instructions for creating a new esm-bundle repo](https://github.com/esm-bundle/new-repo-instructions)

A repo that tests automatic detection of upstream publishes and the publishing of `@esm-bundle` versions of them.

Upstream repo at https://github.com/joeldenning/autopublish-template.
Upstream repo at https://www.npmjs.com/package/chai.

## JS Delivr

https://cdn.jsdelivr.net/npm/@esm-bundle/autopublish-template/esm/index.js
https://cdn.jsdelivr.net/npm/@esm-bundle/chai/esm/chai.js

https://cdn.jsdelivr.net/npm/@esm-bundle/autopublish-template/system/index.js
https://cdn.jsdelivr.net/npm/@esm-bundle/chai/system/chai.js

## Unpkg

https://unpkg.com/@esm-bundle/autopublish-template/esm/index.js
https://unpkg.com/@esm-bundle/chai/esm/chai.js

https://unpkg.com/@esm-bundle/autopublish-template/system/index.js
https://unpkg.com/@esm-bundle/chai/system/chai.js

## Npm

```sh
npm install --save autopublish-template@npm:@esm-bundle/autopublish-template
npm install --save chai@npm:@esm-bundle/chai
```

## Yarn

```sh
yarn add autopublish-template@npm:@esm-bundle/autopublish-template
yarn add chai@npm:@esm-bundle/chai
```
6 changes: 3 additions & 3 deletions browser-test/test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe("@esm-bundle/autopublish-template", () => {
describe("@esm-bundle/chai", () => {
it("can load the ESM bundle", () => {
return import("/base/esm/index.js");
return import("/base/esm/chai.js");
});

it("can load the System.register bundle", () => {
return System.import("/base/system/index.js");
return System.import("/base/system/chai.js");
});
});
4 changes: 2 additions & 2 deletions node-test/main.test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe("@esm-bundle/autopublish-template", () => {
describe("@esm-bundle/chai", () => {
it("can load the esm bundle without dying", () => {
return import("../esm/index.js");
return import("../esm/chai.js");
});
});
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@esm-bundle/autopublish-template",
"version": "20.0.0",
"description": "Repo to test esm-bundle's automatic publishing",
"main": "index.js",
"module": "esm/index.js",
"name": "@esm-bundle/chai",
"version": "0.0.0-unpublished.0",
"description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.",
"main": "chai.js",
"module": "esm/chai.js",
"type": "module",
"scripts": {
"test": "yarn build && concurrently -n w: 'yarn:test:*'",
Expand All @@ -27,16 +27,17 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/esm-bundle/autopublish-template.git"
"url": "git+https://github.com/esm-bundle/chai.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/esm-bundle/autopublish-template/issues"
"url": "https://github.com/esm-bundle/chai/issues"
},
"homepage": "https://github.com/esm-bundle/autopublish-template#readme",
"homepage": "https://github.com/esm-bundle/chai#readme",
"devDependencies": {
"autopublish-template": "20.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"chai": "^4.2.0",
"esm-bundle-scripts": "1.2.0"
},
"publishConfig": {
Expand Down
7 changes: 4 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";
import { nodeResolve } from "@rollup/plugin-node-resolve";

function createConfig(format) {
const dir = format === "module" ? "esm" : format;
return {
input: require.resolve("autopublish-template"),
input: require.resolve("chai"),
output: {
file: `${dir}/index.js`,
file: `${dir}/chai.js`,
sourcemap: true,
format,
},
plugins: [commonjs(), terser()],
plugins: [nodeResolve(), commonjs(), terser()],
};
}

Expand Down
42 changes: 36 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,18 @@
is-module "^1.0.0"
resolve "^1.14.2"

"@rollup/plugin-node-resolve@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz#39bd0034ce9126b39c1699695f440b4b7d2b62e6"
integrity sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==
dependencies:
"@rollup/pluginutils" "^3.1.0"
"@types/resolve" "1.17.1"
builtin-modules "^3.1.0"
deepmerge "^4.2.2"
is-module "^1.0.0"
resolve "^1.17.0"

"@rollup/pluginutils@^3.0.8":
version "3.0.9"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.0.9.tgz#aa6adca2c45e5a1b950103a999e3cddfe49fd775"
Expand All @@ -600,6 +612,15 @@
estree-walker "^1.0.1"
micromatch "^4.0.2"

"@rollup/pluginutils@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
dependencies:
"@types/estree" "0.0.39"
estree-walker "^1.0.1"
picomatch "^2.2.2"

"@sindresorhus/is@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
Expand Down Expand Up @@ -748,6 +769,13 @@
dependencies:
"@types/node" "*"

"@types/resolve@1.17.1":
version "1.17.1"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==
dependencies:
"@types/node" "*"

"@types/responselike@*":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29"
Expand Down Expand Up @@ -996,11 +1024,6 @@ atob@^2.1.2:
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==

autopublish-template@20.0.0:
version "20.0.0"
resolved "https://registry.yarnpkg.com/autopublish-template/-/autopublish-template-20.0.0.tgz#aec377281398793f38a553e0c9277b0e65edba2a"
integrity sha512-OXzSKHdY8zu1VxGm3ibWtiX2FcQYi2mge9pECwnLN0MJAWfy60UNZfAosvJZ35CxV2V6cjcdqgVYzUIVHtFypA==

aws-sign2@~0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
Expand Down Expand Up @@ -4483,7 +4506,7 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=

picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.0.7, picomatch@^2.2.1:
picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.0.7, picomatch@^2.2.1, picomatch@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
Expand Down Expand Up @@ -4878,6 +4901,13 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.14.2, resolve@^1.15
dependencies:
path-parse "^1.0.6"

resolve@^1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
dependencies:
path-parse "^1.0.6"

responselike@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
Expand Down

0 comments on commit c7216a5

Please sign in to comment.