@uns-kit/cli 2.0.47 → 2.0.50
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/dist/index.js +10 -9
- package/package.json +7 -6
- package/templates/cron/AGENTS.md +2 -5
- package/templates/default/AGENTS.md +2 -5
- package/templates/default/README.md +2 -6
- package/templates/default/package.json +2 -1
- package/templates/default/src/uns/uns-assets.ts +2 -2
- package/templates/default/src/uns/uns-tags.ts +1 -1
- package/templates/default/src/uns/uns-topics.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -394,7 +394,9 @@ function setPackageScript(scripts, name, command) {
|
|
|
394
394
|
return true;
|
|
395
395
|
}
|
|
396
396
|
function ensureUnsReferenceScripts(scripts) {
|
|
397
|
-
|
|
397
|
+
const schemaChanged = setPackageScript(scripts, "sync-uns-schema", "node ./node_modules/@uns-kit/core/dist/tools/sync-uns-schema.js");
|
|
398
|
+
const metadataChanged = setPackageScript(scripts, "sync-uns-metadata", "node ./node_modules/@uns-kit/core/dist/tools/sync-uns-metadata.js");
|
|
399
|
+
return schemaChanged || metadataChanged;
|
|
398
400
|
}
|
|
399
401
|
const OBSOLETE_SCRIPTS = [
|
|
400
402
|
"generate-uns-dictionary",
|
|
@@ -847,12 +849,8 @@ async function upgradeProject(targetPath) {
|
|
|
847
849
|
changed = true;
|
|
848
850
|
}
|
|
849
851
|
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
if (hadUnsReference && !scripts["sync-uns-schema"]) {
|
|
853
|
-
scripts["sync-uns-schema"] = "node ./node_modules/@uns-kit/core/dist/tools/sync-uns-schema.js";
|
|
854
|
-
changed = true;
|
|
855
|
-
}
|
|
852
|
+
const syncScriptsChanged = ensureUnsReferenceScripts(scripts);
|
|
853
|
+
changed = syncScriptsChanged || changed;
|
|
856
854
|
if (changed) {
|
|
857
855
|
await writeFile(packagePath, JSON.stringify(pkg, null, 2) + "\n", "utf8");
|
|
858
856
|
}
|
|
@@ -863,8 +861,11 @@ async function upgradeProject(targetPath) {
|
|
|
863
861
|
console.log(` - ${name}`);
|
|
864
862
|
}
|
|
865
863
|
}
|
|
866
|
-
if (
|
|
867
|
-
console.log(" Added: sync-uns-schema");
|
|
864
|
+
if (syncScriptsChanged) {
|
|
865
|
+
console.log(" Added/updated: sync-uns-schema, sync-uns-metadata");
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
console.log(" Ensured: sync-uns-schema, sync-uns-metadata");
|
|
868
869
|
}
|
|
869
870
|
if (!changed) {
|
|
870
871
|
console.log(" Already up to date.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uns-kit/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.50",
|
|
4
4
|
"description": "Command line scaffolding tool for UNS applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,13 +26,14 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"azure-devops-node-api": "^15.1.1",
|
|
29
|
-
"@uns-kit/core": "2.0.
|
|
29
|
+
"@uns-kit/core": "2.0.50"
|
|
30
30
|
},
|
|
31
31
|
"unsKitPackages": {
|
|
32
|
-
"@uns-kit/core": "2.0.
|
|
33
|
-
"@uns-kit/api": "2.0.
|
|
34
|
-
"@uns-kit/cron": "2.0.
|
|
35
|
-
"@uns-kit/
|
|
32
|
+
"@uns-kit/core": "2.0.50",
|
|
33
|
+
"@uns-kit/api": "2.0.50",
|
|
34
|
+
"@uns-kit/cron": "2.0.50",
|
|
35
|
+
"@uns-kit/database": "2.0.50",
|
|
36
|
+
"@uns-kit/temporal": "2.0.47"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"build": "tsc -p tsconfig.build.json",
|
package/templates/cron/AGENTS.md
CHANGED
|
@@ -4,7 +4,7 @@ Pointers for AI/code-assist tools when working in this generated project.
|
|
|
4
4
|
|
|
5
5
|
## What to read locally
|
|
6
6
|
|
|
7
|
-
- `package.json` for scripts (`
|
|
7
|
+
- `package.json` for scripts (`sync-uns-*`, `generate-codegen`, etc.).
|
|
8
8
|
- `config.schema.json` for the app config shape; `processName` is required.
|
|
9
9
|
- `src/examples/*.ts` for cron-driven publish patterns and description registration.
|
|
10
10
|
- Installed docs (under `node_modules`):
|
|
@@ -16,9 +16,6 @@ Pointers for AI/code-assist tools when working in this generated project.
|
|
|
16
16
|
|
|
17
17
|
## Generators in this project
|
|
18
18
|
|
|
19
|
-
- `pnpm run generate-uns-dictionary` -> updates `src/uns/uns-dictionary.generated.ts`
|
|
20
|
-
- `pnpm run generate-uns-measurements` -> updates `src/uns/uns-measurements.generated.ts`
|
|
21
|
-
- `pnpm run generate-uns-reference` -> runs both
|
|
22
|
-
- `pnpm run generate-uns-metadata` -> refreshes topic/tag unions (requires GraphQL connectivity)
|
|
23
19
|
- `pnpm run generate-codegen` -> GraphQL codegen (after configure-codegen)
|
|
24
20
|
- `pnpm run sync-uns-schema -- --controller-url ... --token ...` -> pulls `uns-dictionary.json` + `uns-measurements.json` from the controller and regenerates local TS helpers
|
|
21
|
+
- `pnpm run sync-uns-metadata -- --controller-url ... --token ...` -> pulls topics/tags/assets from the controller and regenerates local TS helpers
|
|
@@ -4,7 +4,7 @@ Pointers for AI/code-assist tools when working in this generated project.
|
|
|
4
4
|
|
|
5
5
|
## What to read locally
|
|
6
6
|
|
|
7
|
-
- `package.json` for scripts (`
|
|
7
|
+
- `package.json` for scripts (`sync-uns-*`, `generate-codegen`, etc.).
|
|
8
8
|
- `config.schema.json` for the app config shape; `processName` is required.
|
|
9
9
|
- `src/examples/*.ts` for idiomatic publishing (multi-attribute) and description registration.
|
|
10
10
|
- Installed docs (under `node_modules`):
|
|
@@ -16,9 +16,6 @@ Pointers for AI/code-assist tools when working in this generated project.
|
|
|
16
16
|
|
|
17
17
|
## Generators in this project
|
|
18
18
|
|
|
19
|
-
- `pnpm run generate-uns-dictionary` -> updates `src/uns/uns-dictionary.generated.ts`
|
|
20
|
-
- `pnpm run generate-uns-measurements` -> updates `src/uns/uns-measurements.generated.ts`
|
|
21
|
-
- `pnpm run generate-uns-reference` -> runs both
|
|
22
|
-
- `pnpm run generate-uns-metadata` -> refreshes topic/tag unions (requires GraphQL connectivity)
|
|
23
19
|
- `pnpm run generate-codegen` -> GraphQL codegen (after configure-codegen)
|
|
24
20
|
- `pnpm run sync-uns-schema -- --controller-url ... --token ...` -> pulls `uns-dictionary.json` + `uns-measurements.json` from the controller and regenerates local TS helpers
|
|
21
|
+
- `pnpm run sync-uns-metadata -- --controller-url ... --token ...` -> pulls topics/tags/assets from the controller and regenerates local TS helpers
|
|
@@ -12,11 +12,8 @@ pnpm run build # emit dist/ output
|
|
|
12
12
|
pnpm run start # run the compiled entrypoint
|
|
13
13
|
pnpm run generate-config-schema # regenerate config.schema.json and AppConfig augmentations
|
|
14
14
|
pnpm run generate-codegen # regenerate typed GraphQL operations (after configure-codegen)
|
|
15
|
-
pnpm run generate-uns-metadata # rebuild UNS topics/tags from the live schema
|
|
16
|
-
pnpm run generate-uns-dictionary # generate typed object/attribute dictionary from uns-dictionary.json
|
|
17
|
-
pnpm run generate-uns-measurements # generate typed measurement units from uns-measurements.json
|
|
18
|
-
pnpm run generate-uns-reference # run both dictionary + measurements generators
|
|
19
15
|
pnpm run sync-uns-schema -- --controller-url http://localhost:3200 --token <admin-bearer-token> # pull dictionary + measurements from the controller
|
|
16
|
+
pnpm run sync-uns-metadata -- --controller-url http://localhost:3200 --token <metadata-export-token> # refresh topics/tags/assets for IntelliSense
|
|
20
17
|
```
|
|
21
18
|
|
|
22
19
|
## Configuration
|
|
@@ -74,8 +71,7 @@ console.log(values);
|
|
|
74
71
|
- Run `uns-kit configure-vscode` to copy workspace/launch configuration for VS Code.
|
|
75
72
|
- Run `uns-kit configure-codegen` to scaffold GraphQL code generation and UNS refresh scripts.
|
|
76
73
|
- Run `pnpm run sync-uns-schema -- --controller-url ... --token ...` to pull `uns-dictionary.json` and `uns-measurements.json` from the controller export into this project, then regenerate the typed files automatically.
|
|
77
|
-
-
|
|
78
|
-
- Edit `uns-measurements.json` (units + descriptions) and run `pnpm run generate-uns-measurements` to emit `src/uns/uns-measurements.generated.ts` and feed measurement unit IntelliSense.
|
|
74
|
+
- Run `pnpm run sync-uns-metadata -- --controller-url ... --token ...` to regenerate topic, tag, and asset IntelliSense from the controller metadata export. The token must be admin or include `export:uns-reference`.
|
|
79
75
|
- Run `uns-kit configure-api` / `configure-cron` / `configure-temporal` to pull in example stubs and install the matching UNS plugins (add `--overwrite` to refresh templates).
|
|
80
76
|
- Run `uns-kit configure-python` to copy the Python gateway client template (examples, scripts, proto).
|
|
81
77
|
- Commit your new project and start building!
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"format:check": "prettier --check .",
|
|
29
29
|
"generate-config-schema": "node ./node_modules/@uns-kit/core/dist/tools/generate-config-schema.js",
|
|
30
30
|
"generate-codegen": "graphql-code-generator --require dotenv/config --config codegen.ts",
|
|
31
|
-
"sync-uns-schema": "node ./node_modules/@uns-kit/core/dist/tools/sync-uns-schema.js"
|
|
31
|
+
"sync-uns-schema": "node ./node_modules/@uns-kit/core/dist/tools/sync-uns-schema.js",
|
|
32
|
+
"sync-uns-metadata": "node ./node_modules/@uns-kit/core/dist/tools/sync-uns-metadata.js"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@uns-kit/core": "__UNS_KIT_CORE_VERSION__",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// Generated UNS asset list. Run `pnpm
|
|
1
|
+
// Generated UNS asset list. Run `pnpm run sync-uns-metadata` to update.
|
|
2
2
|
export const GeneratedAssets = {
|
|
3
|
-
/** Example asset. Replace with your own names after running
|
|
3
|
+
/** Example asset. Replace with your own names after running sync-uns-metadata. */
|
|
4
4
|
"asset": "asset",
|
|
5
5
|
} as const;
|
|
6
6
|
export type GeneratedAssetName = typeof GeneratedAssets[keyof typeof GeneratedAssets];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Generated UNS tag union. Run `pnpm
|
|
1
|
+
// Generated UNS tag union. Run `pnpm run sync-uns-metadata` to update.
|
|
2
2
|
export type UnsTags = string & {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Generated UNS topic union. Run `pnpm
|
|
1
|
+
// Generated UNS topic union. Run `pnpm run sync-uns-metadata` to update.
|
|
2
2
|
export type UnsTopics = string & {};
|