Skip to content

Commit 24e973c

Browse files
committed
chore: build types using npm script
1 parent 4f21536 commit 24e973c

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
"license": "Apache-2.0",
77
"scripts": {
88
"start": "lerna run build:i18n && start-storybook -p 6006 -c .storybook",
9-
"build": "npm-run-all -s build:clean build:bundle",
10-
"build:clean": "yarn clean",
9+
"build": "npm-run-all -s clean build:bundle build:types",
1110
"build:bundle": "lerna run build --stream",
12-
"build:storybook": "lerna run build:i18n && build-storybook -c .storybook -o .out",
11+
"build:types": "lerna run build:types --stream",
1312
"pretest": "rimraf coverage && lerna run build:i18n",
1413
"test": "jest --config=config/jest.config.js --coverage",
1514
"clean": "lerna run clean --stream && rimraf coverage",

packages/base/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"clean": "rimraf cjs Device hooks lib polyfill styling types utils index.esm.js index.d.ts",
2424
"build:rollup": "rollup -c rollup.config.js",
2525
"build:polyfills": "tsc ./src/polyfill/*.ts --outDir ./polyfill --skipLibCheck",
26-
"build": "npm-run-all -s build:rollup build:polyfills"
26+
"build": "npm-run-all -s build:rollup build:polyfills",
27+
"build:types": "tsc --declaration --emitDeclarationOnly --declarationDir . --removeComments false"
2728
},
2829
"dependencies": {
2930
"@babel/runtime": "7.11.0",

packages/charts/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"sideEffects": false,
1717
"scripts": {
1818
"clean": "rimraf cjs components interfaces internal lib util index.esm.js index.d.ts config.d.ts hooks",
19-
"build": "rollup -c rollup.config.js"
19+
"build": "rollup -c rollup.config.js",
20+
"build:types": "tsc --declaration --emitDeclarationOnly --declarationDir . --removeComments false || exit 0"
2021
},
2122
"dependencies": {
2223
"@babel/runtime": "7.11.0",

packages/main/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"build:i18n-bundles": "mkdirp dist/assets/i18n && node ../../node_modules/@ui5/webcomponents-tools/lib/i18n/toJSON.js src/i18n dist/assets/i18n",
2929
"build:i18n-default": "node ../../node_modules/@ui5/webcomponents-tools/lib/i18n/defaults.js src/i18n dist/assets/i18n && tsc dist/assets/i18n/i18n-defaults.js --allowJs --declaration --emitDeclarationOnly --declarationDir dist/assets/i18n",
3030
"build:i18n-imports": "mkdirp dist/json-imports && node ../../node_modules/@ui5/webcomponents-tools/lib/generate-json-imports/i18n.js dist/assets/i18n dist/json-imports/",
31-
"build:assets": "node ../../scripts/generate-assets/index.js"
31+
"build:assets": "node ../../scripts/generate-assets/index.js",
32+
"build:types": "tsc --declaration --emitDeclarationOnly --declarationDir . --removeComments false || exit 0"
3233
},
3334
"dependencies": {
3435
"@babel/runtime": "7.11.0",

scripts/rollup/configFactory.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,6 @@ const rollupConfigFactory = (pkgName, externals = []) => {
6565
console.info('Copy index file');
6666
asyncCopyTo(path.resolve(PKG_BASE_PATH, 'src', 'index.ts'), path.resolve(PKG_BASE_PATH, `index.esm.js`));
6767

68-
console.info('Create TS Types');
69-
const tsConfigPath = path.resolve(PKG_BASE_PATH, 'tsconfig.json');
70-
if (fs.existsSync(tsConfigPath)) {
71-
spawnSync(
72-
path.resolve(PATHS.nodeModules, '.bin', 'tsc'),
73-
[
74-
'--project',
75-
tsConfigPath,
76-
'--declaration',
77-
'--emitDeclarationOnly',
78-
'--declarationDir',
79-
PKG_BASE_PATH,
80-
'--removeComments',
81-
'false'
82-
],
83-
{ stdio: 'inherit' }
84-
);
85-
}
86-
8768
const external = (id) => {
8869
const containsThisModule = (pkg) => id === pkg || id.startsWith(pkg + '/');
8970
return externalModules.some(containsThisModule);

0 commit comments

Comments
 (0)