From cd0ce0d2c41606a718736e7e5e96cd0e57796e4d Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Wed, 6 Sep 2023 16:38:45 +0200 Subject: [PATCH] build: esm (#134) --- .github/workflows/pull_request.yml | 7 +- .gitignore | 1 + .npmrc | 12 +- demo.html | 28 --- index.html | 2 +- lightweight/package.json | 3 +- package.json | 29 ++- rollup.config.js | 46 +++-- index.d.ts => src/node.d.ts | 4 +- test/build.mjs | 17 ++ test/{clients.js => clients.mjs} | 4 +- test/error/{client.js => client.mjs} | 2 +- test/error/{server.js => server.mjs} | 2 +- test/{get-api-url.js => get-api-url.mjs} | 2 +- test/node.test-d.ts | 2 +- test/{opts.js => opts.mjs} | 2 +- test/{rules.js => rules.mjs} | 2 +- test/snapshots/get-api-url.mjs.md | 249 +++++++++++++++++++++++ test/snapshots/get-api-url.mjs.snap | Bin 0 -> 685 bytes test/snapshots/opts.mjs.md | 87 ++++++++ test/snapshots/opts.mjs.snap | Bin 0 -> 652 bytes test/{stream.js => stream.mjs} | 2 +- 22 files changed, 427 insertions(+), 76 deletions(-) delete mode 100644 demo.html rename index.d.ts => src/node.d.ts (80%) create mode 100644 test/build.mjs rename test/{clients.js => clients.mjs} (56%) rename test/error/{client.js => client.mjs} (97%) rename test/error/{server.js => server.mjs} (98%) rename test/{get-api-url.js => get-api-url.mjs} (96%) rename test/{opts.js => opts.mjs} (95%) rename test/{rules.js => rules.mjs} (98%) create mode 100644 test/snapshots/get-api-url.mjs.md create mode 100644 test/snapshots/get-api-url.mjs.snap create mode 100644 test/snapshots/opts.mjs.md create mode 100644 test/snapshots/opts.mjs.snap rename test/{stream.js => stream.mjs} (94%) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a89e55e..b2921bc 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -21,8 +21,11 @@ jobs: uses: actions/setup-node@v3 with: node-version: lts/* - - name: Install - run: npm install --no-package-lock + - name: Setup PNPM + uses: pnpm/action-setup@v2 + with: + version: latest + run_install: true - name: Test run: npm test - name: Report diff --git a/.gitignore b/.gitignore index 1e43713..71e4cb1 100755 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ stats.html examples src/ky.js dist +lightweight/index.js diff --git a/.npmrc b/.npmrc index c0d17b2..a5e9e89 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,13 @@ -unsafe-perm=true +audit=false +enable-pre-post-scripts=true +fund=false +package-lock=false +prefer-dedupe=true +prefer-offline=true save-prefix=~ save=false +strict-peer-dependencies=false +unsafe-perm=true +loglevel=error +shamefully-hoist=true +resolution-mode=highest diff --git a/demo.html b/demo.html deleted file mode 100644 index 2bb6a1a..0000000 --- a/demo.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - Document - - - - - - - - diff --git a/index.html b/index.html index 876318f..6437e79 100644 --- a/index.html +++ b/index.html @@ -67,7 +67,7 @@