@genesislcap/ts-builder 15.19.0 → 15.19.1-GENC-1557.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -4
- package/src/index.ts +0 -68
- package/src/react-wrapper-generator.ts +0 -1309
- package/src/resolve-cem-config-path.ts +0 -24
- package/tsconfig.json +0 -11
- package/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/ts-builder",
|
|
3
3
|
"description": "Typescript builder",
|
|
4
|
-
"version": "15.19.
|
|
4
|
+
"version": "15.19.1-GENC-1557.2",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@custom-elements-manifest/analyzer": "^0.8.2",
|
|
20
|
-
"@genesislcap/build-kit": "15.19.
|
|
20
|
+
"@genesislcap/build-kit": "15.19.1-GENC-1557.2",
|
|
21
21
|
"consola": "^3.0.2",
|
|
22
22
|
"copyfiles": "^2.4.1",
|
|
23
23
|
"pkg-types": "^1.0.2"
|
|
@@ -29,6 +29,5 @@
|
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
|
-
}
|
|
33
|
-
"gitHead": "83695de98c2288c2e89992215cb391652f6c5eec"
|
|
32
|
+
}
|
|
34
33
|
}
|
package/src/index.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { BuildContext } from '@genesislcap/build-kit';
|
|
2
|
-
import { rm, run, resolveBin } from '@genesislcap/build-kit';
|
|
3
|
-
import consola from 'consola';
|
|
4
|
-
import { generateReactWrappers } from './react-wrapper-generator';
|
|
5
|
-
import { resolveCEMConfigArg } from './resolve-cem-config-path';
|
|
6
|
-
|
|
7
|
-
export default async (ctx: BuildContext) => {
|
|
8
|
-
const {
|
|
9
|
-
dirs: { cwd },
|
|
10
|
-
cli: { isDev, isBuild, options },
|
|
11
|
-
config: { clean, copyAssets },
|
|
12
|
-
enable: { apiExtractor, cemAnalyzer },
|
|
13
|
-
} = ctx;
|
|
14
|
-
|
|
15
|
-
if (clean) {
|
|
16
|
-
await rm(['dist', 'tsconfig.tsbuildinfo']);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (Array.isArray(copyAssets)) {
|
|
20
|
-
const copyfiles = await resolveBin('copyfiles');
|
|
21
|
-
copyAssets.forEach((glob) => {
|
|
22
|
-
run(cwd, `${copyfiles} --verbose --up 1 src/${glob} ./dist/esm`);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const tsc = await resolveBin('tsc', 'typescript');
|
|
27
|
-
if (isDev) {
|
|
28
|
-
// build a composite project in the working directory in watch mode
|
|
29
|
-
run(cwd, `${tsc} -b ./tsconfig.json --verbose -w`);
|
|
30
|
-
return;
|
|
31
|
-
} else if (isBuild) {
|
|
32
|
-
// build a composite project in the working directory
|
|
33
|
-
run(cwd, `${tsc} -b ./tsconfig.json --verbose`);
|
|
34
|
-
|
|
35
|
-
if (apiExtractor) {
|
|
36
|
-
consola.log('\n@microsoft/api-extractor configuration detected');
|
|
37
|
-
const extractor = await resolveBin('api-extractor', '@microsoft/api-extractor');
|
|
38
|
-
run(cwd, `${extractor} run --local`);
|
|
39
|
-
// API docs markdown is generated in the docs repo from the published .api.json files.
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (cemAnalyzer) {
|
|
43
|
-
consola.log('\n@custom-elements-manifest/analyzer configuration detected');
|
|
44
|
-
const cem = await resolveBin('cem', '@custom-elements-manifest/analyzer');
|
|
45
|
-
const cemConfigArg = resolveCEMConfigArg(cwd);
|
|
46
|
-
if (!cemConfigArg) {
|
|
47
|
-
consola.warn(
|
|
48
|
-
'CEM config file not found in package root; skipping custom-elements-manifest analyze',
|
|
49
|
-
);
|
|
50
|
-
} else {
|
|
51
|
-
run(cwd, `${cem} analyze --config ${cemConfigArg}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const reactWrappersResult = await generateReactWrappers(cwd);
|
|
56
|
-
if (reactWrappersResult.generated) {
|
|
57
|
-
consola.log(`\nReact wrappers generated: ${reactWrappersResult.path}`);
|
|
58
|
-
} else {
|
|
59
|
-
// strictNullChecks is off in this workspace, so boolean literal narrowing
|
|
60
|
-
// doesn't apply to the discriminated union — cast to access the skipped variant.
|
|
61
|
-
consola.debug(
|
|
62
|
-
`React wrappers skipped: ${(reactWrappersResult as { reason: string }).reason}`,
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
throw new Error(`Unrecognized command: ${JSON.stringify(options)}`);
|
|
67
|
-
}
|
|
68
|
-
};
|