Skip to content

Commit 1f3531f

Browse files
lforstAbhiPrasad
authored andcommitted
ref(bundles): Stop publishing CDN bundles on npm (#4901)
1 parent 4a5bdec commit 1f3531f

File tree

8 files changed

+1
-40
lines changed

8 files changed

+1
-40
lines changed

.npmignore

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
*
55

6-
# TODO remove bundles (which in the tarball are inside `build`) in v7
7-
!/build/**/*
8-
96
!/dist/**/*
107
!/esm/**/*
118
!/types/**/*

packages/minimal/.npmignore

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
*
55

6-
# TODO remove bundles (which in the tarball are inside `build`) in v7
7-
!/build/**/*
8-
96
!/dist/**/*
107
!/esm/**/*
118
!/types/**/*

packages/node/.npmignore

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
*
55

6-
# TODO remove bundles (which in the tarball are inside `build`) in v7
7-
!/build/**/*
8-
96
!/dist/**/*
107
!/esm/**/*
118
!/types/**/*

packages/tracing/.npmignore

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
*
55

6-
# TODO remove bundles (which in the tarball are inside `build`) in v7
7-
!/build/**/*
8-
96
!/dist/**/*
107
!/esm/**/*
118
!/types/**/*

packages/types/.npmignore

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
*
55

6-
# TODO remove bundles (which in the tarball are inside `build`) in v7
7-
!/build/**/*
8-
96
!/dist/**/*
107
!/esm/**/*
118
!/types/**/*

packages/utils/.npmignore

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
*
55

6-
# TODO remove bundles (which in the tarball are inside `build`) in v7
7-
!/build/**/*
8-
96
!/dist/**/*
107
!/esm/**/*
118
!/types/**/*

packages/wasm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4444
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4545
"build:types:watch": "tsc -p tsconfig.types.json --watch",
46-
"build:npm": "ts-node ../../scripts/prepack.ts --bundles --skipBundleCopy && npm pack ./build/npm",
46+
"build:npm": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm",
4747
"circularDepCheck": "madge --circular src/index.ts",
4848
"clean": "rimraf dist esm build coverage *.js.map *.d.ts",
4949
"fix": "run-s fix:eslint fix:prettier",

scripts/prepack.ts

-21
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import * as fs from 'fs';
10-
import * as fse from 'fs-extra';
1110
import * as path from 'path';
1211

1312
const NPM_BUILD_DIR = 'build/npm';
@@ -49,26 +48,6 @@ ASSETS.forEach(asset => {
4948
}
5049
});
5150

52-
// TODO remove in v7! Until then:
53-
// copy CDN bundles into npm dir to temporarily keep bundles in npm tarball
54-
// inside the tarball, they are located in `build/`
55-
// for now, copy it by default, unless explicitly forbidden via an command line arg
56-
const tmpCopyBundles = packageWithBundles && !process.argv.includes('--skipBundleCopy');
57-
if (tmpCopyBundles) {
58-
const npmTmpBundlesPath = path.resolve(buildDir, 'build');
59-
const cdnBundlesPath = path.resolve('build', 'bundles');
60-
try {
61-
if (!fs.existsSync(npmTmpBundlesPath)) {
62-
fs.mkdirSync(npmTmpBundlesPath);
63-
}
64-
void fse.copy(cdnBundlesPath, npmTmpBundlesPath);
65-
} catch (error) {
66-
console.error(`Error while tmp copying CDN bundles to ${buildDir}`);
67-
process.exit(1);
68-
}
69-
}
70-
// end remove
71-
7251
// package.json modifications
7352
const packageJsonPath = path.resolve(buildDir, 'package.json');
7453
// eslint-disable-next-line @typescript-eslint/no-var-requires

0 commit comments

Comments
 (0)