From 0770e8e8b04c96910fc32787b984459cb0efa775 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Fri, 8 Apr 2022 11:07:12 +0000 Subject: [PATCH 1/3] build(bundles): Stop publishing CDN bundles on npm --- .npmignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.npmignore b/.npmignore index 4ab7cc4f278f..facb3a101f90 100644 --- a/.npmignore +++ b/.npmignore @@ -3,9 +3,6 @@ * -# TODO remove bundles (which in the tarball are inside `build`) in v7 -!/build/**/* - !/dist/**/* !/esm/**/* !/types/**/* From c7936f2f4d18f69a7b36fd9c85dabb4e589759a1 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Fri, 8 Apr 2022 11:55:42 +0000 Subject: [PATCH 2/3] Remove --skipBundleCopy flag from prepack.ts --- packages/wasm/package.json | 2 +- scripts/prepack.ts | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/packages/wasm/package.json b/packages/wasm/package.json index babefffec6ba..775e80b8ec43 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -43,7 +43,7 @@ "build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***", "build:esm:watch": "tsc -p tsconfig.esm.json --watch", "build:types:watch": "tsc -p tsconfig.types.json --watch", - "build:npm": "ts-node ../../scripts/prepack.ts --bundles --skipBundleCopy && npm pack ./build/npm", + "build:npm": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm", "circularDepCheck": "madge --circular src/index.ts", "clean": "rimraf dist esm build coverage *.js.map *.d.ts", "fix": "run-s fix:eslint fix:prettier", diff --git a/scripts/prepack.ts b/scripts/prepack.ts index bac7a544a2f5..774dff0631f2 100644 --- a/scripts/prepack.ts +++ b/scripts/prepack.ts @@ -49,26 +49,6 @@ ASSETS.forEach(asset => { } }); -// TODO remove in v7! Until then: -// copy CDN bundles into npm dir to temporarily keep bundles in npm tarball -// inside the tarball, they are located in `build/` -// for now, copy it by default, unless explicitly forbidden via an command line arg -const tmpCopyBundles = packageWithBundles && !process.argv.includes('--skipBundleCopy'); -if (tmpCopyBundles) { - const npmTmpBundlesPath = path.resolve(buildDir, 'build'); - const cdnBundlesPath = path.resolve('build', 'bundles'); - try { - if (!fs.existsSync(npmTmpBundlesPath)) { - fs.mkdirSync(npmTmpBundlesPath); - } - void fse.copy(cdnBundlesPath, npmTmpBundlesPath); - } catch (error) { - console.error(`Error while tmp copying CDN bundles to ${buildDir}`); - process.exit(1); - } -} -// end remove - // package.json modifications const packageJsonPath = path.resolve(buildDir, 'package.json'); // eslint-disable-next-line @typescript-eslint/no-var-requires From 9233bc97d6d024db5aec8f64bfeb748a79bd04f1 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Fri, 8 Apr 2022 12:35:56 +0000 Subject: [PATCH 3/3] Remove unused import --- scripts/prepack.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/prepack.ts b/scripts/prepack.ts index 774dff0631f2..a7609a8087bd 100644 --- a/scripts/prepack.ts +++ b/scripts/prepack.ts @@ -7,7 +7,6 @@ */ import * as fs from 'fs'; -import * as fse from 'fs-extra'; import * as path from 'path'; const NPM_BUILD_DIR = 'build/npm';