@citolab/tspci 2.5.30-beta.8 → 2.6.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/CHANGELOG.md +59 -0
- package/package.json +2 -2
- package/preset/tailwind/src/styles.css +10 -7
- package/readme.md +4 -4
- package/src/cli.js +19 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,65 @@
|
|
|
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.6.2](/compare/v2.6.1...v2.6.2) (2025-02-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.6.1](/compare/v2.6.0...v2.6.1) (2025-02-04)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [2.6.0](/compare/v2.5.30-beta.11...v2.6.0) (2025-02-04)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [2.6.0](/compare/v2.5.30-beta.11...v2.6.0) (2025-02-04)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [2.5.30-beta.11](/compare/v2.5.30-beta.10...v2.5.30-beta.11) (2025-02-04)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* add tailwindcss to devDependencies and set version based on @tailwindcss/postcss 907b541
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [2.5.30-beta.10](/compare/v2.5.30-beta.9...v2.5.30-beta.10) (2025-02-04)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [2.5.30-beta.9](/compare/v2.5.30-beta.8...v2.5.30-beta.9) (2025-02-04)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
6
65
|
## [2.5.30-beta.8](/compare/v2.5.30-beta.7...v2.5.30-beta.8) (2025-02-04)
|
|
7
66
|
|
|
8
67
|
**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.
|
|
3
|
+
"version": "2.6.2",
|
|
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",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"resolutions": {
|
|
52
52
|
"chokidar": "^4.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "750b04d92da7e806cbfafeb84dcb5bedb719536d"
|
|
55
55
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
@
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
.pci-container {
|
|
3
|
+
@apply container flex flex-col justify-center items-center;
|
|
4
|
+
}
|
|
5
|
+
h1 {
|
|
6
|
+
@apply text-2xl text-red-500 m-4;
|
|
7
|
+
}
|
|
8
|
+
input {
|
|
9
|
+
@apply border border-gray-400 rounded p-2 m-1;
|
|
10
|
+
}
|
package/readme.md
CHANGED
|
@@ -97,7 +97,7 @@ Add the following PCI in the src folder `index.ts`
|
|
|
97
97
|
|
|
98
98
|
```ts
|
|
99
99
|
// src/index.ts
|
|
100
|
-
import {
|
|
100
|
+
import { ConfigProperties, IMSpci } from "@citolab/tspci";
|
|
101
101
|
import * as ctx from "qtiCustomInteractionContext";
|
|
102
102
|
|
|
103
103
|
class Pci implements IMSpci<{}> {
|
|
@@ -108,7 +108,7 @@ class Pci implements IMSpci<{}> {
|
|
|
108
108
|
ctx && ctx.register(this);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
getInstance = (dom: HTMLElement, config:
|
|
111
|
+
getInstance = (dom: HTMLElement, config: ConfigProperties<any>, state: string) => {
|
|
112
112
|
this.shadowdom = dom.attachShadow({ mode: "closed" });
|
|
113
113
|
this.render();
|
|
114
114
|
config.onready(this);
|
|
@@ -337,9 +337,9 @@ Also used in the TAO export for configuring PCIs in TAO
|
|
|
337
337
|
+ type PropTypes = typeof configProps;
|
|
338
338
|
|
|
339
339
|
// add to types
|
|
340
|
-
+ private config:
|
|
340
|
+
+ private config: ConfigProperties<PropTypes>;
|
|
341
341
|
|
|
342
|
-
getInstance = (dom: HTMLElement, config:
|
|
342
|
+
getInstance = (dom: HTMLElement, config: ConfigProperties<PropTypes>, stateString: string) => {
|
|
343
343
|
+ config.properties = { ...configProps, ...config.properties }; // merge our props with players
|
|
344
344
|
+ this.config = config;
|
|
345
345
|
|
package/src/cli.js
CHANGED
|
@@ -289,22 +289,38 @@ const run = async () => {
|
|
|
289
289
|
|
|
290
290
|
// read postcss.config.js
|
|
291
291
|
const postcssConfig = path.resolve(cliPath, "./../preset/tailwind/postcss.config.js");
|
|
292
|
+
// get all plugin names
|
|
292
293
|
const postcssConfigContent = fs.readFileSync(postcssConfig, "utf8");
|
|
293
294
|
// get all plugin names
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
// Match require statements that use either single or double quotes
|
|
296
|
+
const pluginMatches = postcssConfigContent.match(/require\(["']([^"']+)["']\)/g);
|
|
297
|
+
let pluginNames = [];
|
|
298
|
+
if (pluginMatches) {
|
|
299
|
+
pluginNames = pluginMatches.map((plugin) => plugin.replace(/require\(["']([^"']+)["']\)/, "$1"));
|
|
300
|
+
} else {
|
|
301
|
+
console.log("No PostCSS plugins found.");
|
|
302
|
+
}
|
|
297
303
|
const packageJsonCli = path.resolve(cliPath, "./../package.json");
|
|
298
304
|
const packageJsonCliContent = fs.readFileSync(packageJsonCli, "utf8");
|
|
299
305
|
const packageJsonCliContentJson = JSON.parse(packageJsonCliContent);
|
|
300
306
|
// add all plugins to package.json and map the version to the version in tspci package.json
|
|
307
|
+
let version = "latest";
|
|
301
308
|
for (const pluginName of pluginNames) {
|
|
302
309
|
const pluginVersion = packageJsonCliContentJson.dependencies[pluginName];
|
|
310
|
+
if (pluginName === "@tailwindcss/postcss") {
|
|
311
|
+
version = pluginVersion.toString();
|
|
312
|
+
}
|
|
303
313
|
packageJsonContentJson.devDependencies = {
|
|
304
314
|
...packageJsonContentJson.devDependencies,
|
|
305
315
|
[pluginName]: pluginVersion,
|
|
306
316
|
};
|
|
307
317
|
}
|
|
318
|
+
|
|
319
|
+
// add tailwindcss itself to the devDependencies
|
|
320
|
+
packageJsonContentJson.devDependencies = {
|
|
321
|
+
...packageJsonContentJson.devDependencies,
|
|
322
|
+
tailwindcss: version,
|
|
323
|
+
};
|
|
308
324
|
const newPackageJsonContent = JSON.stringify(packageJsonContentJson, null, 2);
|
|
309
325
|
fs.writeFileSync(packageJson, newPackageJsonContent);
|
|
310
326
|
// copy tailwind config file
|