From c7216a5a0553f4d1f84ca119e3f0f68700815b57 Mon Sep 17 00:00:00 2001 From: Lars den Bakker Date: Fri, 21 Aug 2020 20:11:20 +0200 Subject: [PATCH] Setup --- README.md | 18 +++++++++--------- browser-test/test.js | 6 +++--- node-test/main.test.mjs | 4 ++-- package.json | 19 ++++++++++--------- rollup.config.js | 7 ++++--- yarn.lock | 42 +++++++++++++++++++++++++++++++++++------ 6 files changed, 64 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 160130b..c4c6bd3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# 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) @@ -8,28 +8,28 @@ 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 ``` diff --git a/browser-test/test.js b/browser-test/test.js index ac6b3b3..26186e9 100644 --- a/browser-test/test.js +++ b/browser-test/test.js @@ -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"); }); }); diff --git a/node-test/main.test.mjs b/node-test/main.test.mjs index 403a7ad..2faee21 100644 --- a/node-test/main.test.mjs +++ b/node-test/main.test.mjs @@ -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"); }); }); diff --git a/package.json b/package.json index b7eff2a..e0877b4 100644 --- a/package.json +++ b/package.json @@ -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:*'", @@ -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": { diff --git a/rollup.config.js b/rollup.config.js index ea8d618..24647ad 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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()], }; } diff --git a/yarn.lock b/yarn.lock index 4f11d11..093177f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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" @@ -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" @@ -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" @@ -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== @@ -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"