diff --git a/.gitignore b/.gitignore index 39b3a0e6b..b114883ad 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ coverage/ docs/.vuepress/dist/ node_modules/ tmp/ +/import_map.json +/mod.ts .DS_Store .env.local .env.development.local diff --git a/deno/check.ts b/deno/check.ts deleted file mode 100644 index 7be512cdc..000000000 --- a/deno/check.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2019-2022 @polkadot/util authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -// auto-generated via deno/setup.ts, do not edit - -export * as hwLedger from 'https://deno.land/x/polkadot/hw-ledger/mod.ts'; -export * as hwLedgerTransports from 'https://deno.land/x/polkadot/hw-ledger-transports/mod.ts'; -export * as keyring from 'https://deno.land/x/polkadot/keyring/mod.ts'; -export * as networks from 'https://deno.land/x/polkadot/networks/mod.ts'; -export * as util from 'https://deno.land/x/polkadot/util/mod.ts'; -export * as utilCrypto from 'https://deno.land/x/polkadot/util-crypto/mod.ts'; -export * as xBigint from 'https://deno.land/x/polkadot/x-bigint/mod.ts'; -export * as xFetch from 'https://deno.land/x/polkadot/x-fetch/mod.ts'; -export * as xGlobal from 'https://deno.land/x/polkadot/x-global/mod.ts'; -export * as xRandomvalues from 'https://deno.land/x/polkadot/x-randomvalues/mod.ts'; -export * as xTextdecoder from 'https://deno.land/x/polkadot/x-textdecoder/mod.ts'; -export * as xTextencoder from 'https://deno.land/x/polkadot/x-textencoder/mod.ts'; -export * as xWs from 'https://deno.land/x/polkadot/x-ws/mod.ts'; diff --git a/deno/import_map.json b/deno/import_map.json deleted file mode 100644 index c43bfb233..000000000 --- a/deno/import_map.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "imports": { - "https://deno.land/x/polkadot/x-bigint/": "../packages/x-bigint/build-deno/", - "https://deno.land/x/polkadot/x-fetch/": "../packages/x-fetch/build-deno/", - "https://deno.land/x/polkadot/util/": "../packages/util/build-deno/", - "https://deno.land/x/polkadot/x-textdecoder/": "../packages/x-textdecoder/build-deno/", - "https://deno.land/x/polkadot/x-randomvalues/": "../packages/x-randomvalues/build-deno/", - "https://deno.land/x/polkadot/x-textencoder/": "../packages/x-textencoder/build-deno/", - "https://deno.land/x/polkadot/hw-ledger/": "../packages/hw-ledger/build-deno/", - "https://deno.land/x/polkadot/hw-ledger-transports/": "../packages/hw-ledger-transports/build-deno/", - "https://deno.land/x/polkadot/networks/": "../packages/networks/build-deno/", - "https://deno.land/x/polkadot/keyring/": "../packages/keyring/build-deno/", - "https://deno.land/x/polkadot/x-global/": "../packages/x-global/build-deno/", - "https://deno.land/x/polkadot/x-ws/": "../packages/x-ws/build-deno/", - "https://deno.land/x/polkadot/util-crypto/": "../packages/util-crypto/build-deno/" - } -} diff --git a/deno/setup.ts b/deno/setup.ts deleted file mode 100644 index 1144f2c2e..000000000 --- a/deno/setup.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017-2022 @polkadot/util authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -/* eslint-disable sort-keys */ - -import { stringCamelCase } from 'https://deno.land/x/polkadot/util/mod.ts'; - -const exports: string[] = []; -const imports: Record = {}; - -for await (const entry of Deno.readDir('packages')) { - if (entry.isDirectory) { - try { - await Deno.readTextFile(`packages/${entry.name}/src/mod.ts`); - - exports.push(`export * as ${stringCamelCase(entry.name)} from 'https://deno.land/x/polkadot/${entry.name}/mod.ts';`); - - imports[`https://deno.land/x/polkadot/${entry.name}/`] = `../packages/${entry.name}/build-deno/`; - } catch { - // ignore - } - } -} - -await Deno.writeTextFile('deno/check.ts', `// Copyright 2017-${new Date().getFullYear()} @polkadot/util authors & contributors\n// SPDX-License-Identifier: Apache-2.0\n\n// auto-generated via deno/setup.ts, do not edit\n\n${exports.sort().join('\n')}\n`); - -await Deno.writeTextFile('deno/import_map.json', `${JSON.stringify({ imports }, null, 2)}\n`); diff --git a/package.json b/package.json index 48de8005f..59ee194e5 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,7 @@ "build:release": "polkadot-ci-ghact-build", "build:rollup": "polkadot-exec-rollup --config", "clean": "polkadot-dev-clean-build", - "deno": "yarn build && yarn deno:setup && yarn deno:check", - "deno:check": "deno check --import-map=deno/import_map.json deno/check.ts", - "deno:setup": "deno run --import-map=deno/import_map.json --allow-read --allow-write deno/setup.ts", + "deno": "yarn polkadot-dev-deno-map && yarn build && deno check --import-map=import_map.json mod.ts", "lint": "polkadot-dev-run-lint", "networks:crosscheck": "polkadot-dev-run-test packages/networks/src/crosscheck", "postinstall": "polkadot-dev-yarn-only", @@ -31,7 +29,7 @@ }, "devDependencies": { "@babel/core": "^7.18.6", - "@polkadot/dev": "^0.67.58", + "@polkadot/dev": "^0.67.63", "@types/jest": "^28.1.4" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index a8276eae2..66b75bf79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2045,9 +2045,9 @@ __metadata: languageName: node linkType: hard -"@polkadot/dev@npm:^0.67.58": - version: 0.67.58 - resolution: "@polkadot/dev@npm:0.67.58" +"@polkadot/dev@npm:^0.67.63": + version: 0.67.63 + resolution: "@polkadot/dev@npm:0.67.63" dependencies: "@babel/cli": ^7.18.6 "@babel/core": ^7.18.6 @@ -2123,6 +2123,7 @@ __metadata: polkadot-dev-clean-build: scripts/polkadot-dev-clean-build.mjs polkadot-dev-contrib: scripts/polkadot-dev-contrib.mjs polkadot-dev-copy-to: scripts/polkadot-dev-copy-to.mjs + polkadot-dev-deno-map: scripts/polkadot-dev-deno-map.mjs polkadot-dev-run-lint: scripts/polkadot-dev-run-lint.mjs polkadot-dev-run-prettier: scripts/polkadot-dev-run-prettier.mjs polkadot-dev-run-test: scripts/polkadot-dev-run-test.mjs @@ -2135,7 +2136,7 @@ __metadata: polkadot-exec-rollup: scripts/polkadot-exec-rollup.mjs polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs - checksum: b7f45bb635cdf8734ec9c8410a489a8d8b9667f944a0816d4fb3f0f7bcde0881b74742072df312e990fa59610439a7d52021e215b42879d04338fd1e457497d7 + checksum: dcd126122c2bc793930e9974dfd0fae035e1a8b97bd6df4a3cfc82bee5ec76a328570401b0b81dd1d2db7459c08a50b8169b1814934fca677d8b25b699097cc4 languageName: node linkType: hard @@ -9437,7 +9438,7 @@ resolve@^2.0.0-next.3: resolution: "root-workspace-0b6124@workspace:." dependencies: "@babel/core": ^7.18.6 - "@polkadot/dev": ^0.67.58 + "@polkadot/dev": ^0.67.63 "@types/jest": ^28.1.4 languageName: unknown linkType: soft