@citolab/tspci 2.9.9 → 2.9.11-beta.1
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 +24 -0
- package/package.json +4 -3
- package/preset/preact/src/interaction.tsx +14 -10
- package/preset/tailwind/src/styles.css +25 -5
- package/scripts/test-init-matrix.sh +27 -0
- package/src/cli.js +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.9.11-beta.1](/compare/v2.9.11-beta.0...v2.9.11-beta.1) (2026-03-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.9.11-beta.0](/compare/v2.9.10...v2.9.11-beta.0) (2026-03-11)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.9.10](/compare/v2.9.9...v2.9.10) (2026-03-11)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [2.9.9](/compare/v2.9.8...v2.9.9) (2026-03-11)
|
|
7
31
|
|
|
8
32
|
**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.9.
|
|
3
|
+
"version": "2.9.11-beta.1",
|
|
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",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"postcss-load-config": "^6.0.1",
|
|
43
43
|
"rollup": "^4.59.0",
|
|
44
44
|
"rollup-plugin-livereload": "^2.0.5",
|
|
45
|
-
"tailwindcss": "^4.1.18"
|
|
45
|
+
"tailwindcss": "^4.1.18",
|
|
46
|
+
"tslib": "^2.8.1"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@types/node": "^25.1.0",
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"access": "public",
|
|
54
55
|
"registry": "https://registry.npmjs.org/"
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "3ec89a59bacdc7664c059a24918699dd440fd622"
|
|
57
58
|
}
|
|
@@ -20,22 +20,26 @@ const Interaction = ({ config, dom, store }: { config: PropTypes; dom: Document
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
return <div className="pci-container">
|
|
23
|
-
<h1>{config.title}</h1>
|
|
23
|
+
<h1 className="title">{config.title}</h1>
|
|
24
24
|
<div className="body">
|
|
25
|
-
<img width={config.width} height={+config.height} src={procenten} />
|
|
25
|
+
<img className="body-image" width={config.width} height={+config.height} src={procenten} alt="Percentages visual" />
|
|
26
26
|
</div>
|
|
27
27
|
<div className="interaction">
|
|
28
|
-
<label htmlFor="
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
<label className="prompt" htmlFor="percentage-input">{config.prompt}</label>
|
|
29
|
+
<div className="answer-row">
|
|
30
|
+
<input className="answer-input"
|
|
31
|
+
id="percentage-input"
|
|
32
|
+
type="number"
|
|
33
|
+
value={state.input}
|
|
34
|
+
onInput={handleInput}
|
|
35
|
+
onPaste={() => setEventHandled(false)}
|
|
36
|
+
onKeyDown={() => setEventHandled(false)}
|
|
37
|
+
min="0" max="100" />
|
|
38
|
+
<span className="answer-suffix">%</span>
|
|
39
|
+
</div>
|
|
35
40
|
</div>
|
|
36
41
|
</div>;
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
|
|
40
45
|
export default Interaction;
|
|
41
|
-
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
|
+
@source "./**/*.{html,js,ts,jsx,tsx}";
|
|
3
|
+
@source "../*.xml";
|
|
2
4
|
.pci-container {
|
|
3
|
-
@apply
|
|
5
|
+
@apply mx-auto flex w-full max-w-xl flex-col items-center gap-5 rounded-2xl border border-slate-200 bg-white p-6 shadow-lg;
|
|
4
6
|
}
|
|
5
|
-
|
|
6
|
-
@apply text-
|
|
7
|
+
.title {
|
|
8
|
+
@apply text-center text-2xl font-semibold tracking-tight text-slate-800;
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
@apply
|
|
10
|
+
.body {
|
|
11
|
+
@apply flex w-full justify-center;
|
|
12
|
+
}
|
|
13
|
+
.body-image {
|
|
14
|
+
@apply rounded-xl border border-slate-200 bg-slate-50 p-2;
|
|
15
|
+
}
|
|
16
|
+
.interaction {
|
|
17
|
+
@apply w-full rounded-xl border border-slate-200 bg-slate-50 p-4;
|
|
18
|
+
}
|
|
19
|
+
.prompt {
|
|
20
|
+
@apply mb-2 block text-sm font-medium text-slate-700;
|
|
21
|
+
}
|
|
22
|
+
.answer-row {
|
|
23
|
+
@apply flex items-center gap-2;
|
|
24
|
+
}
|
|
25
|
+
.answer-input {
|
|
26
|
+
@apply w-28 rounded-lg border border-slate-300 bg-white px-3 py-2 text-lg font-medium text-slate-900 shadow-sm outline-none transition focus:border-amber-500 focus:ring-2 focus:ring-amber-200;
|
|
27
|
+
}
|
|
28
|
+
.answer-suffix {
|
|
29
|
+
@apply text-sm font-semibold uppercase tracking-wide text-slate-500;
|
|
10
30
|
}
|
|
@@ -110,6 +110,15 @@ assert_file() {
|
|
|
110
110
|
fi
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
assert_file_contains() {
|
|
114
|
+
local file_path="$1"
|
|
115
|
+
local expected_text="$2"
|
|
116
|
+
if ! grep -Fq "${expected_text}" "${file_path}"; then
|
|
117
|
+
echo "ERROR: expected '${expected_text}' in ${file_path}" >&2
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
}
|
|
121
|
+
|
|
113
122
|
run_base_build() {
|
|
114
123
|
local project_dir="$1"
|
|
115
124
|
(cd "${project_dir}" && npm run prod)
|
|
@@ -167,7 +176,10 @@ run_dev_start_smoke "${TEST_ROOT}/TypeScriptPci"
|
|
|
167
176
|
echo "Scenario 3: TypeScript + tailwind PCI creates and builds"
|
|
168
177
|
create_project "TypeScriptTailwindPci" "preact+tailwind" "TypeScript + tailwind PCI matrix test"
|
|
169
178
|
assert_file "${TEST_ROOT}/TypeScriptTailwindPci/src/index.tsx"
|
|
179
|
+
# Tailwind regression guard: ensure content scanning picks up utility classes from TSX.
|
|
180
|
+
echo '<div className="bg-amber-500">Tailwind scan smoke</div>' >> "${TEST_ROOT}/TypeScriptTailwindPci/src/interaction.tsx"
|
|
170
181
|
run_base_build "${TEST_ROOT}/TypeScriptTailwindPci"
|
|
182
|
+
assert_file_contains "${TEST_ROOT}/TypeScriptTailwindPci/dist/index.js" "bg-amber-500"
|
|
171
183
|
|
|
172
184
|
echo "Scenario 4: add tspci-qbci and export .ci package"
|
|
173
185
|
create_project "QbciPci" "typescript" "QBCI export matrix test"
|
|
@@ -187,6 +199,21 @@ echo "Scenario 6: add tspci-tao and export tao zip"
|
|
|
187
199
|
create_project "TaoPci" "typescript" "TAO export matrix test"
|
|
188
200
|
(cd "${TEST_ROOT}/TaoPci" && npm install --save-dev "file:$(npm_path "${TAO_TGZ}")" --cache "${NPM_CACHE_DIR}" --workspaces=false)
|
|
189
201
|
(cd "${TEST_ROOT}/TaoPci" && npm run tspci -- add --target tao --ci)
|
|
202
|
+
node -e '
|
|
203
|
+
const fs = require("fs");
|
|
204
|
+
const pkgPath = process.argv[1];
|
|
205
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
206
|
+
const hasTaoDevDep = Boolean(pkg.devDependencies && pkg.devDependencies["@citolab/tspci-tao"]);
|
|
207
|
+
if (!hasTaoDevDep) {
|
|
208
|
+
console.error("ERROR: expected devDependency \"@citolab/tspci-tao\" after tspci add --target tao");
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
const hasPackageScript = Boolean(pkg.scripts && pkg.scripts["package:tao"]);
|
|
212
|
+
if (!hasPackageScript) {
|
|
213
|
+
console.error("ERROR: expected script \"package:tao\" after tspci add --target tao");
|
|
214
|
+
process.exit(1);
|
|
215
|
+
}
|
|
216
|
+
' "${TEST_ROOT}/TaoPci/package.json"
|
|
190
217
|
node -e '
|
|
191
218
|
const fs = require("fs");
|
|
192
219
|
const pkgPath = process.argv[1];
|
package/src/cli.js
CHANGED
|
@@ -486,8 +486,8 @@ const run = async () => {
|
|
|
486
486
|
const version = args.indexOf("--next") !== -1 ? "next" : "latest";
|
|
487
487
|
const passCiFlag = args.indexOf("--ci") !== -1;
|
|
488
488
|
const packageFilePath = path.join(PACKAGE_ROOT_PATH, "package.json");
|
|
489
|
-
const
|
|
490
|
-
|
|
489
|
+
const readPackageJson = () => JSON.parse(fs.readFileSync(packageFilePath, "utf8"));
|
|
490
|
+
let packageJson = readPackageJson();
|
|
491
491
|
|
|
492
492
|
const modifyPci = () => {
|
|
493
493
|
const scriptFile = path.join(path.join(path.join(NODE_MODULES, `${targetName}`), "src"), `init.mjs`);
|
|
@@ -517,6 +517,7 @@ const run = async () => {
|
|
|
517
517
|
cwd: PACKAGE_ROOT_PATH,
|
|
518
518
|
stdio: [0, 1, 2],
|
|
519
519
|
});
|
|
520
|
+
packageJson = readPackageJson();
|
|
520
521
|
}
|
|
521
522
|
|
|
522
523
|
// add a package script so users can export with a single command
|