@citolab/tspci 2.5.5 → 2.5.16
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/CHANGELOG.md +88 -0
- package/package.json +2 -3
- package/readme.md +2 -1
- package/src/cli.js +16 -28
- package/src/rollup.config.dev.js +14 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,94 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 2.5.16 (2024-10-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 2.5.15 (2024-10-11)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 2.5.14 (2024-10-11)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 2.5.13 (2024-10-11)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 2.5.12 (2024-10-11)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 2.5.11 (2024-10-11)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 2.5.10 (2024-10-11)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 2.5.9 (2024-10-11)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 2.5.8 (2024-10-10)
|
|
71
|
+
|
|
72
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 2.5.7 (2024-10-10)
|
|
79
|
+
|
|
80
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## [2.5.6](/compare/v2.5.5...v2.5.6) (2024-10-10)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
6
94
|
## [2.5.5](/compare/v2.5.4...v2.5.5) (2024-10-10)
|
|
7
95
|
|
|
8
96
|
**Note:** Version bump only for package @citolab/tspci
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citolab/tspci",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.16",
|
|
4
4
|
"description": "an opiniated typescript ims-pci builder with tao integration",
|
|
5
5
|
"author": "patrick <patrick.deklein@cito.nl>",
|
|
6
6
|
"repository": "@citolab/tspci",
|
|
@@ -43,8 +43,7 @@
|
|
|
43
43
|
"rollup-plugin-node-globals": "^1.4.0",
|
|
44
44
|
"rollup-plugin-postcss": "^4.0.2",
|
|
45
45
|
"rollup-plugin-string": "^3.0.0",
|
|
46
|
-
"rollup-plugin-watch-assets": "^1.0.1",
|
|
47
46
|
"tailwindcss": "^3.4.11"
|
|
48
47
|
},
|
|
49
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "5ff52efe162707ea2a30db62a73411a12db06666"
|
|
50
49
|
}
|
package/readme.md
CHANGED
|
@@ -173,7 +173,8 @@ Available Commands
|
|
|
173
173
|
--dev -d Start development server
|
|
174
174
|
--watch -w Only watch changes
|
|
175
175
|
--help -h Help about commandos
|
|
176
|
-
--target -t Build production for platform, could be @citolab/tscpi-${target}
|
|
176
|
+
--target -t Build production for platform, could be @citolab/tscpi-${target}
|
|
177
|
+
--targetExt -tx Same as -target but reffering to a fully qualified package (not in @citolab)
|
|
177
178
|
init Init PCI development environment.
|
|
178
179
|
add --target Add specific implementation to the PCI.
|
|
179
180
|
|
package/src/cli.js
CHANGED
|
@@ -34,7 +34,6 @@ const watchBuild = (devServer = false, target = "IMS") => {
|
|
|
34
34
|
if (!fs.existsSync(PACKAGE_DIST_PATH)) {
|
|
35
35
|
fs.mkdirSync(PACKAGE_DIST_PATH);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
37
|
if (devServer) {
|
|
39
38
|
try {
|
|
40
39
|
if (fs.existsSync(path.join(PACKAGE_ROOT_PATH, "src/index.html"))) {
|
|
@@ -186,8 +185,10 @@ const run = async () => {
|
|
|
186
185
|
const help = args.indexOf("--help") >= 0 || args.indexOf("-h") >= 0;
|
|
187
186
|
const watch = args.indexOf("--watch") >= 0 || args.indexOf("-w") >= 0;
|
|
188
187
|
const dev = args.indexOf("--dev") >= 0 || args.indexOf("-d") >= 0;
|
|
189
|
-
const
|
|
188
|
+
const t = args.indexOf("--target") !== -1 ? args.indexOf("--target") : args.indexOf("-t");
|
|
189
|
+
const tExt = args.indexOf("--targetExt") !== -1 ? args.indexOf("--targetExt") : args.indexOf("-tx");
|
|
190
190
|
const init = args.indexOf("init") >= 0;
|
|
191
|
+
const targetName = t !== -1 ? `@citolab/tspci-${args[t]}` : tExt !== -1 ? args[tExt] : null;
|
|
191
192
|
|
|
192
193
|
if (help) {
|
|
193
194
|
console.log(`•\t${chalk.blueBright("--help -h")} list these commands`);
|
|
@@ -346,6 +347,9 @@ const run = async () => {
|
|
|
346
347
|
pciName
|
|
347
348
|
);
|
|
348
349
|
// point to the javascript file
|
|
350
|
+
const packageJson = path.join(destinationFolder, "package.json");
|
|
351
|
+
const packageJsonContent = fs.readFileSync(packageJson, "utf8");
|
|
352
|
+
let packageJsonContentJson = JSON.parse(packageJsonContent);
|
|
349
353
|
packageJsonContentJson.source = "src/index.js";
|
|
350
354
|
const newPackageJsonContent = JSON.stringify(packageJsonContentJson, null, 2);
|
|
351
355
|
fs.writeFileSync(packageJson, newPackageJsonContent);
|
|
@@ -373,42 +377,31 @@ const run = async () => {
|
|
|
373
377
|
return;
|
|
374
378
|
}
|
|
375
379
|
const version = args.indexOf("--next") !== -1 ? "next" : "latest";
|
|
376
|
-
const targetname = args[targetIndex + 1];
|
|
377
380
|
const packageFileContent = fs.readFileSync(path.join(PACKAGE_ROOT_PATH, "package.json"), "utf8");
|
|
378
381
|
const packageJson = JSON.parse(packageFileContent);
|
|
379
382
|
|
|
380
383
|
const modifyPci = () => {
|
|
381
|
-
|
|
382
|
-
path.join(path.join(path.join(NODE_MODULES, `@citolab`), `tspci-${targetname}`), "src"),
|
|
383
|
-
`init.mjs`
|
|
384
|
-
);
|
|
385
|
-
if (!fs.existsSync(scriptFile)) {
|
|
386
|
-
scriptFile = path.join(path.join(path.join(NODE_MODULES, targetname), "src"), `init.mjs`);
|
|
387
|
-
}
|
|
384
|
+
const scriptFile = path.join(path.join(path.join(NODE_MODULES, `${targetName}`), "src"), `init.mjs`);
|
|
388
385
|
let init = false;
|
|
389
386
|
if (fs.existsSync(scriptFile)) {
|
|
390
387
|
// run init() script
|
|
391
388
|
import(`file:///${scriptFile}`).then((script) => {
|
|
392
389
|
if (script.init) {
|
|
393
390
|
init = true;
|
|
394
|
-
console.log(chalk.green(`Running init script for
|
|
391
|
+
console.log(chalk.green(`Running init script for ${targetName}`));
|
|
395
392
|
script.init();
|
|
396
393
|
} else {
|
|
397
394
|
if (!init) {
|
|
398
|
-
console.log(chalk.red(`No init script found for
|
|
395
|
+
console.log(chalk.red(`No init script found for ${targetName}`));
|
|
399
396
|
}
|
|
400
397
|
}
|
|
401
398
|
});
|
|
402
|
-
} else {
|
|
403
|
-
console.log(chalk.red(`No init script found. Searched for ${scriptFile}`));
|
|
404
399
|
}
|
|
405
400
|
};
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
if (!packageJson.devDependencies || !packageJson.devDependencies[`@citolab/tspci-${targetname}`]) {
|
|
409
|
-
console.log(chalk.white(`Adding @citolab/tspci-${targetname}`));
|
|
401
|
+
if (!packageJson.devDependencies || !packageJson.devDependencies[targetName]) {
|
|
402
|
+
console.log(chalk.white(`Adding ${targetName}`));
|
|
410
403
|
// install @citolab/tspci-${targetname} to devDepencies
|
|
411
|
-
execSync(`npm install
|
|
404
|
+
execSync(`npm install ${targetName}@${version} --save-dev`, {
|
|
412
405
|
cwd: PACKAGE_ROOT_PATH,
|
|
413
406
|
stdio: [0, 1, 2],
|
|
414
407
|
});
|
|
@@ -436,16 +429,11 @@ const run = async () => {
|
|
|
436
429
|
}
|
|
437
430
|
|
|
438
431
|
prodBuild().then(() => {
|
|
439
|
-
if (
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
console.error("Missing target name. Use tspci --target target");
|
|
432
|
+
if (t) {
|
|
433
|
+
if (!targetName) {
|
|
434
|
+
console.error("Missing target name. Use tspci --target target or tspci --targetExt target");
|
|
443
435
|
}
|
|
444
|
-
const
|
|
445
|
-
const scriptFile = path.join(
|
|
446
|
-
path.join(path.join(path.join(NODE_MODULES, `@citolab`), `tspci-${targetname}`), "src"),
|
|
447
|
-
`createPackage.mjs`
|
|
448
|
-
);
|
|
436
|
+
const scriptFile = path.join(path.join(path.join(NODE_MODULES, `${targetName}`), "src"), `createPackage.mjs`);
|
|
449
437
|
import(`file:///${scriptFile}`).then((script) => {
|
|
450
438
|
script.bundle();
|
|
451
439
|
});
|
package/src/rollup.config.dev.js
CHANGED
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import copy from "rollup-plugin-copy";
|
|
2
|
+
import livereload from "rollup-plugin-livereload";
|
|
2
3
|
// PK: not the official npm package, but a copy, needed watch functinoality
|
|
3
4
|
import { liveServer } from "./rollup-plugin-live-server.js";
|
|
4
5
|
|
|
5
6
|
import path from "path";
|
|
6
7
|
|
|
7
|
-
const PACKAGE_ROOT_PATH = process.cwd()
|
|
8
|
-
const PACKAGE_DIST_PATH = path.join(PACKAGE_ROOT_PATH, "dist")
|
|
8
|
+
const PACKAGE_ROOT_PATH = process.cwd();
|
|
9
|
+
const PACKAGE_DIST_PATH = path.join(PACKAGE_ROOT_PATH, "dist");
|
|
9
10
|
|
|
10
11
|
const livesrvr = liveServer({
|
|
11
12
|
root: path.join(PACKAGE_ROOT_PATH),
|
|
12
13
|
mount: [["/", "./dist"]],
|
|
13
14
|
open: true,
|
|
14
15
|
wait: 500,
|
|
15
|
-
watch: PACKAGE_DIST_PATH
|
|
16
|
+
watch: PACKAGE_DIST_PATH,
|
|
16
17
|
});
|
|
17
18
|
|
|
18
|
-
const watchassets =
|
|
19
|
+
const watchassets = copy({
|
|
20
|
+
targets: [
|
|
21
|
+
{ src: "./src/**/*.json", dest: "dist" },
|
|
22
|
+
{ src: "./src/**/*.svg", dest: "dist" },
|
|
23
|
+
{ src: "./src/**/*.png", dest: "dist" },
|
|
24
|
+
],
|
|
25
|
+
watch: true, // Enable watching for changes
|
|
26
|
+
});
|
|
19
27
|
|
|
20
28
|
import rollupConfig from "./rollup.config.js";
|
|
21
29
|
|
|
22
30
|
const newRollupConfig = {
|
|
23
31
|
...rollupConfig,
|
|
24
32
|
output: rollupConfig.output.map((output) => ({ ...output, sourcemap: true })),
|
|
25
|
-
plugins: [
|
|
33
|
+
plugins: [watchassets, livereload(PACKAGE_DIST_PATH), livesrvr],
|
|
26
34
|
};
|
|
27
35
|
|
|
28
36
|
export default newRollupConfig;
|