@aidc-toolkit/dev 0.9.13-beta → 0.9.14-beta

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.
@@ -2,24 +2,26 @@
2
2
  "organization": "aidc-toolkit",
3
3
  "repositories": {
4
4
  "dev": {
5
- "version": "0.9.13-beta"
5
+ "version": "0.9.14-beta"
6
6
  },
7
7
  "core": {
8
- "version": "0.9.13-beta"
8
+ "version": "0.9.14-beta"
9
9
  },
10
10
  "utility": {
11
- "version": "0.9.13-beta"
11
+ "version": "0.9.14-beta"
12
12
  },
13
13
  "gs1": {
14
- "name": "gs1",
15
- "version": "0.9.13-beta"
14
+ "version": "0.9.14-beta"
16
15
  },
17
16
  "demo": {
18
- "version": "0.9.13-beta"
17
+ "version": "0.9.14-beta"
18
+ },
19
+ "app-extension": {
20
+ "version": "0.9.14-beta"
19
21
  },
20
22
  "aidc-toolkit.github.io": {
21
23
  "directory": "doc",
22
- "version": "0.9.13-beta"
24
+ "version": "0.9.14-beta"
23
25
  }
24
26
  }
25
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/dev",
3
- "version": "0.9.13-beta",
3
+ "version": "0.9.14-beta",
4
4
  "description": "Shared development artefacts for AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,10 +20,11 @@
20
20
  },
21
21
  "scripts": {
22
22
  "copy-workflows": "copy-files-from-to --config copy-workflows.json",
23
- "lint": "eslint .",
24
- "build:core": "tsup src/index.ts --format cjs,esm --dts --clean",
25
- "build:dev": "npm run build:core && tsc src/index.ts --outDir dist --target esnext --moduleResolution nodenext --module nodenext --emitDeclarationOnly --declaration --declarationMap",
23
+ "lint": "eslint",
24
+ "build:core": "tsup",
25
+ "build:dev": "npm run build:core && tsc --project tsconfig-declaration-local.json",
26
26
  "build:release": "npm run build:core -- --minify",
27
+ "build:doc": "npm run build:dev",
27
28
  "publish-dev": "bin/publish-dev-local",
28
29
  "release": "tsx src/release.ts"
29
30
  },
@@ -46,7 +47,7 @@
46
47
  "tsup": "^8.3.6",
47
48
  "tsx": "^4.19.2",
48
49
  "typescript": "^5.7.3",
49
- "typescript-eslint": "^8.24.0",
50
+ "typescript-eslint": "^8.24.1",
50
51
  "yaml": "^2.7.0"
51
52
  }
52
53
  }
package/src/release.ts CHANGED
@@ -174,10 +174,16 @@ async function release(): Promise<void> {
174
174
  *
175
175
  * @param dependencies
176
176
  * Dependencies.
177
+ *
177
178
  * @param restoreAlpha
178
179
  * If true, "alpha" is restored as the version for development.
180
+ *
181
+ * @returns
182
+ * True if any dependencies were updated.
179
183
  */
180
- function updateDependencies(dependencies: Record<string, string> | undefined, restoreAlpha: boolean): void {
184
+ function updateDependencies(dependencies: Record<string, string> | undefined, restoreAlpha: boolean): boolean {
185
+ let anyUpdated = false;
186
+
181
187
  if (dependencies !== undefined) {
182
188
  // eslint-disable-next-line guard-for-in -- Dependency record type is shallow.
183
189
  for (const dependency in dependencies) {
@@ -185,9 +191,12 @@ async function release(): Promise<void> {
185
191
 
186
192
  if (dependencyAtOrganization === atOrganization) {
187
193
  dependencies[dependency] = !restoreAlpha ? `^${configuration.repositories[dependencyRepositoryName].version}` : "alpha";
194
+ anyUpdated = true;
188
195
  }
189
196
  }
190
197
  }
198
+
199
+ return anyUpdated;
191
200
  }
192
201
 
193
202
  const octokit = new Octokit({
@@ -253,6 +262,8 @@ async function release(): Promise<void> {
253
262
  if (!firstRepository && run(true, "git", "tag", "--points-at", "HEAD", tag).length === 0) {
254
263
  throw new Error(`Repository ${name} has at least one commit since version ${repository.version}`);
255
264
  }
265
+
266
+ state[name] = "skipped";
256
267
  }
257
268
  break;
258
269
 
@@ -353,13 +364,7 @@ async function release(): Promise<void> {
353
364
  });
354
365
 
355
366
  await step(name, "commit", () => {
356
- run(false, "git", "commit", "--all", `--message=Updated to version ${repository.version}`);
357
-
358
- // Restore dependencies to "alpha" version for development.
359
- updateDependencies(packageConfiguration.devDependencies, true);
360
- updateDependencies(packageConfiguration.dependencies, true);
361
-
362
- fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}\n`);
367
+ run(false, "git", "commit", "--all", `--message=Updated to version ${repository.version}.`);
363
368
  });
364
369
 
365
370
  await step(name, "tag", () => {
@@ -368,6 +373,15 @@ async function release(): Promise<void> {
368
373
 
369
374
  await step(name, "push", () => {
370
375
  run(false, "git", "push", "--atomic", "origin", "main", tag);
376
+
377
+ // Restore dependencies to "alpha" version for development.
378
+ const devDependenciesUpdated = updateDependencies(packageConfiguration.devDependencies, true);
379
+ const dependenciesUpdated = updateDependencies(packageConfiguration.dependencies, true);
380
+
381
+ if (devDependenciesUpdated || dependenciesUpdated) {
382
+ fs.writeFileSync(packageConfigurationPath, `${JSON.stringify(packageConfiguration, null, 2)}\n`);
383
+ run(false, "git", "commit", "--all", "--message=Restored alpha version.");
384
+ }
371
385
  });
372
386
 
373
387
  if (hasPushWorkflow) {
@@ -396,8 +410,6 @@ async function release(): Promise<void> {
396
410
  }
397
411
 
398
412
  state[name] = "complete";
399
- } else {
400
- state[name] = "skipped";
401
413
  }
402
414
 
403
415
  saveState();
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+
4
+ "files": [
5
+ "src/index.ts"
6
+ ],
7
+
8
+ "compilerOptions": {
9
+ "outDir": "dist",
10
+ "emitDeclarationOnly": true,
11
+ "declaration": true,
12
+ "declarationMap": true
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+
4
+ "files": [
5
+ "../../../src/index.ts"
6
+ ],
7
+
8
+ "compilerOptions": {
9
+ "outDir": "../../../dist",
10
+ "emitDeclarationOnly": true,
11
+ "declaration": true,
12
+ "declarationMap": true
13
+ }
14
+ }
package/tsconfig.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "noPropertyAccessFromIndexSignature": true,
10
10
 
11
11
  // Modules.
12
- "module": "nodenext",
12
+ "module": "NodeNext",
13
13
  "resolveJsonModule": true,
14
14
 
15
15
  // Interop constraints.
@@ -17,7 +17,7 @@
17
17
  "forceConsistentCasingInFileNames": true,
18
18
 
19
19
  // Language and environment.
20
- "target": "esnext",
20
+ "target": "ESNext",
21
21
  "useDefineForClassFields": true,
22
22
 
23
23
  // Completeness.
package/tsup.config.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ format: ["cjs", "esm"],
6
+ dts: true,
7
+ clean: true
8
+ });