@aidc-toolkit/dev 0.9.19-beta → 0.9.20-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.
@@ -7,34 +7,38 @@
7
7
  "src/publish/",
8
8
  "config/publish.json"
9
9
  ],
10
- "lastBetaPublished": "2025-06-09T02:29:43.810Z"
10
+ "lastBetaPublished": "2025-11-24T01:51:22.533Z",
11
+ "lastBetaTag": "v0.9.19-beta"
11
12
  },
12
13
  "core": {
13
14
  "dependencyType": "external",
14
- "lastBetaPublished": "2025-06-09T02:31:46.793Z"
15
+ "lastBetaPublished": "2025-11-24T02:47:43.671Z",
16
+ "lastBetaTag": "v0.9.19-beta"
15
17
  },
16
18
  "utility": {
17
19
  "dependencyType": "external",
18
- "lastBetaPublished": "2025-06-09T12:43:30.472Z"
20
+ "lastBetaPublished": "2025-11-24T04:12:17.212Z",
21
+ "lastBetaTag": "v0.9.19-beta"
19
22
  },
20
23
  "gs1": {
21
24
  "dependencyType": "external",
22
- "lastBetaPublished": "2025-06-09T12:44:44.764Z"
25
+ "lastBetaPublished": "2025-11-24T04:32:15.180Z",
26
+ "lastBetaTag": "v0.9.19-beta"
23
27
  },
24
28
  "demo": {
25
29
  "dependencyType": "none",
26
- "lastBetaPublished": "2025-06-09T13:03:31.157Z"
30
+ "lastBetaPublished": "2025-11-24T04:32:22.770Z",
31
+ "lastBetaTag": "v0.9.19-beta"
27
32
  },
28
33
  "app-extension": {
29
- "dependencyType": "internal",
30
- "lastBetaPublished": "2025-06-09T13:03:49.309Z"
31
- },
32
- "app-generator": {
33
- "dependencyType": "internal",
34
- "lastBetaPublished": "2025-06-09T13:03:53.348Z"
34
+ "dependencyType": "external",
35
+ "lastBetaPublished": "2025-11-24T04:32:30.078Z",
36
+ "lastBetaTag": "v0.9.19-beta"
35
37
  },
36
38
  "microsoft-add-in": {
37
- "dependencyType": "none"
39
+ "dependencyType": "none",
40
+ "lastBetaPublished": "2025-11-24T15:27:57.639Z",
41
+ "lastBetaTag": "v0.9.19-beta"
38
42
  },
39
43
  "aidc-toolkit.github.io": {
40
44
  "directory": "doc",
@@ -44,7 +48,8 @@
44
48
  "gs1"
45
49
  ],
46
50
  "dependencyType": "none",
47
- "lastBetaPublished": "2025-06-09T13:15:55.394Z"
51
+ "lastBetaPublished": "2025-11-24T19:35:57.785Z",
52
+ "lastBetaTag": "v0.9.19-beta"
48
53
  }
49
54
  }
50
55
  }
@@ -11,6 +11,10 @@
11
11
  {
12
12
  "from": ".github/workflows/release.yml",
13
13
  "to": "../gs1/.github/workflows/"
14
+ },
15
+ {
16
+ "from": ".github/workflows/release.yml",
17
+ "to": "../app-extension/.github/workflows/"
14
18
  }
15
19
  ],
16
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/dev",
3
- "version": "0.9.19-beta",
3
+ "version": "0.9.20-beta",
4
4
  "description": "Shared development artefacts for AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -70,7 +70,7 @@ class PublishAlpha extends Publish {
70
70
  this.run(false, false, "npm", "update", ...this.npmPlatformArgs);
71
71
  }
72
72
 
73
- const anyChanges = this.anyChanges(this.repository.lastAlphaPublished, true);
73
+ const anyChanges = this.anyChanges(this.repository.lastAlphaPublished, true) || this.organizationDependenciesUpdated;
74
74
 
75
75
  if (anyChanges) {
76
76
  const switchToAlpha = this.preReleaseIdentifier !== "alpha";
@@ -80,15 +80,11 @@ class PublishAlpha extends Publish {
80
80
  this.updatePackageVersion(undefined, undefined, this.patchVersion + 1, "alpha");
81
81
 
82
82
  // Use specified registry for organization until no longer in alpha mode.
83
- this.run(false, false, "npm", "set", this.atOrganizationRegistry, "--location", "project");
83
+ this.run(false, false, "npm", "config", "set", this.atOrganizationRegistry, "--location", "project");
84
84
  }
85
85
 
86
86
  if (this.organizationDependenciesUpdated && (switchToAlpha || !this._updateAll)) {
87
- const updateOrganizationDependencies = Object.values(this.organizationDependencies).filter(updateOrganizationDependency => updateOrganizationDependency !== null);
88
-
89
- logger.debug(`Updating organization dependencies [${updateOrganizationDependencies.join(", ")}]`);
90
-
91
- this.run(false, false, "npm", "update", ...updateOrganizationDependencies, ...this.npmPlatformArgs);
87
+ this.updateOrganizationDependencies();
92
88
  }
93
89
  }
94
90
 
@@ -35,7 +35,7 @@ interface WorkflowConfiguration {
35
35
  * Push branches.
36
36
  */
37
37
  branches?: string[];
38
- };
38
+ } | null;
39
39
 
40
40
  /**
41
41
  * Release trigger.
@@ -45,14 +45,14 @@ interface WorkflowConfiguration {
45
45
  * Release types.
46
46
  */
47
47
  types?: string[];
48
- };
48
+ } | null;
49
49
  };
50
50
  }
51
51
 
52
52
  /**
53
53
  * Publish steps.
54
54
  */
55
- type Step = "install" | "build" | "commit" | "tag" | "push" | "workflow (push)" | "release" | "workflow (release)";
55
+ type Step = "update" | "build" | "commit" | "tag" | "push" | "workflow (push)" | "release" | "workflow (release)" | "complete";
56
56
 
57
57
  /**
58
58
  * Publish beta versions.
@@ -182,12 +182,17 @@ class PublishBeta extends Publish {
182
182
  publish = true;
183
183
 
184
184
  this.updatePackageVersion(undefined, undefined, undefined, "beta");
185
+
186
+ // Revert to default registry for organization.
187
+ this.run(false, false, "npm", "config", "delete", this.atOrganizationRegistry, "--location", "project");
185
188
  } else {
186
- // Publish beta step is defined if previous attempt failed at that step.
187
- publish = this.repository.publishBetaStep !== undefined;
189
+ const startingPublication = this.repository.publishBetaStep === undefined;
190
+
191
+ // Publish beta step is defined and not "complete" if previous attempt failed at that step.
192
+ publish = !startingPublication && this.repository.publishBetaStep !== "complete";
188
193
 
189
194
  // Ignore changes after publication process has started.
190
- if (!publish && this.anyChanges(this.repository.lastBetaPublished, false)) {
195
+ if (startingPublication && this.anyChanges(this.repository.lastAlphaPublished, false)) {
191
196
  throw new Error("Internal error, repository has changed without intermediate alpha publication");
192
197
  }
193
198
  }
@@ -211,13 +216,13 @@ class PublishBeta extends Publish {
211
216
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Workflow configuration format is known.
212
217
  const workflowOn = (yamlParse(fs.readFileSync(path.resolve(workflowsPath, workflowFile)).toString()) as WorkflowConfiguration).on;
213
218
 
214
- if (workflowOn.push !== undefined && (workflowOn.push.branches === undefined || workflowOn.push.branches.includes("v*"))) {
219
+ if (workflowOn.push !== undefined && (workflowOn.push?.branches === undefined || workflowOn.push.branches.includes("v*"))) {
215
220
  logger.debug("Repository has push workflow");
216
221
 
217
222
  hasPushWorkflow = true;
218
223
  }
219
224
 
220
- if (workflowOn.release !== undefined && (workflowOn.release.types === undefined || workflowOn.release.types.includes("published"))) {
225
+ if (workflowOn.release !== undefined && (workflowOn.release?.types === undefined || workflowOn.release.types.includes("published"))) {
221
226
  logger.debug("Repository has release workflow");
222
227
 
223
228
  hasReleaseWorkflow = true;
@@ -225,8 +230,8 @@ class PublishBeta extends Publish {
225
230
  }
226
231
  }
227
232
 
228
- await this.runStep("install", () => {
229
- this.run(false, false, "npm", "install", ...this.npmPlatformArgs);
233
+ await this.runStep("update", () => {
234
+ this.updateOrganizationDependencies();
230
235
  });
231
236
 
232
237
  await this.runStep("build", () => {
@@ -272,7 +277,8 @@ class PublishBeta extends Publish {
272
277
  }
273
278
 
274
279
  this.repository.lastBetaPublished = new Date().toISOString();
275
- this.repository.publishBetaStep = undefined;
280
+ this.repository.lastBetaTag = tag;
281
+ this.repository.publishBetaStep = "complete";
276
282
  }
277
283
  }
278
284
 
@@ -59,14 +59,19 @@ export interface Repository {
59
59
  lastAlphaPublished?: string;
60
60
 
61
61
  /**
62
- * Current step in beta publication; used to resume after failure recovery.
62
+ * Date/time in ISO format the last beta version was published.
63
63
  */
64
- publishBetaStep?: string | undefined;
64
+ lastBetaPublished?: string;
65
65
 
66
66
  /**
67
- * Date/time in ISO format the last beta version was published.
67
+ * Last beta tag.
68
68
  */
69
- lastBetaPublished?: string;
69
+ lastBetaTag?: string;
70
+
71
+ /**
72
+ * Current step in beta publication; used to resume after failure recovery.
73
+ */
74
+ publishBetaStep?: string | undefined;
70
75
 
71
76
  /**
72
77
  * Date/time in ISO format the last production version was published.
@@ -170,7 +175,7 @@ export abstract class Publish {
170
175
  /**
171
176
  * All organization dependencies, keyed on repository name.
172
177
  */
173
- private readonly _allOrganizationDependencies: Record<string, Record<string, string | null>>;
178
+ private readonly _allOrganizationDependencies: Record<string, Record<string, string>>;
174
179
 
175
180
  /**
176
181
  * Current repository name.
@@ -218,10 +223,9 @@ export abstract class Publish {
218
223
  private _preReleaseIdentifier!: string | null;
219
224
 
220
225
  /**
221
- * Dependencies that belong to the organization, keyed on repository name; null if additional (not included in
222
- * package configuration).
226
+ * Dependencies that belong to the organization, keyed on repository name.
223
227
  */
224
- private _organizationDependencies!: Record<string, string | null>;
228
+ private _organizationDependencies!: Record<string, string>;
225
229
 
226
230
  /**
227
231
  * True if any organization dependency has been updated.
@@ -253,7 +257,7 @@ export abstract class Publish {
253
257
 
254
258
  this._atOrganization = `@${this.configuration.organization}`;
255
259
 
256
- this._atOrganizationRegistry = `${this.atOrganization}:registry=${this.configuration.alphaRegistry}`;
260
+ this._atOrganizationRegistry = `${this.atOrganization}:registry${releaseType === "alpha" ? `=${this.configuration.alphaRegistry}` : ""}`;
257
261
 
258
262
  this._allOrganizationDependencies = {};
259
263
 
@@ -300,7 +304,7 @@ export abstract class Publish {
300
304
  /**
301
305
  * Get all organization dependencies, keyed on repository name.
302
306
  */
303
- protected get allOrganizationDependencies(): Record<string, Record<string, string | null>> {
307
+ protected get allOrganizationDependencies(): Record<string, Record<string, string>> {
304
308
  return this._allOrganizationDependencies;
305
309
  }
306
310
 
@@ -370,7 +374,7 @@ export abstract class Publish {
370
374
  /**
371
375
  * Get dependencies that belong to the organization, keyed on repository name.
372
376
  */
373
- protected get organizationDependencies(): Record<string, string | null> {
377
+ protected get organizationDependencies(): Record<string, string> {
374
378
  return this._organizationDependencies;
375
379
  }
376
380
 
@@ -532,10 +536,7 @@ export abstract class Publish {
532
536
  const output = this.run(true, true, "git", "status", "--porcelain");
533
537
 
534
538
  if (output.length !== 0) {
535
- // Beta or production publication requires that repository be fully committed.
536
- if (this.releaseType !== "alpha") {
537
- throw new Error("Repository has uncommitted changes");
538
- }
539
+ const committedCount = changedFilesSet.size;
539
540
 
540
541
  logger.debug("Uncommitted");
541
542
 
@@ -546,6 +547,11 @@ export abstract class Publish {
546
547
 
547
548
  processChangedFile(status, file, newFile);
548
549
  }
550
+
551
+ // Beta or production publication requires that repository be fully committed except for excluded paths.
552
+ if (this.releaseType !== "alpha" && changedFilesSet.size !== committedCount) {
553
+ throw new Error("Repository has uncommitted changes");
554
+ }
549
555
  }
550
556
 
551
557
  const lastPublishedDateTime = new Date(lastPublished);
@@ -564,12 +570,6 @@ export abstract class Publish {
564
570
  }
565
571
  }
566
572
 
567
- if (!anyChanges && this.organizationDependenciesUpdated) {
568
- logger.info("Organization dependencies updated");
569
-
570
- anyChanges = true;
571
- }
572
-
573
573
  if (!anyChanges) {
574
574
  logger.info("No changes");
575
575
  }
@@ -664,6 +664,17 @@ export abstract class Publish {
664
664
  this.savePackageConfiguration();
665
665
  }
666
666
 
667
+ /**
668
+ * Update organization dependencies.
669
+ */
670
+ protected updateOrganizationDependencies(): void {
671
+ const organizationDependencies = Object.values(this.organizationDependencies);
672
+
673
+ logger.debug(`Updating organization dependencies [${organizationDependencies.join(", ")}]`);
674
+
675
+ this.run(false, false, "npm", "update", ...organizationDependencies, ...this.npmPlatformArgs);
676
+ }
677
+
667
678
  /**
668
679
  * Commit changes resulting from updating the package version.
669
680
  *
@@ -777,19 +788,48 @@ export abstract class Publish {
777
788
 
778
789
  this.organizationDependencies[dependencyRepositoryName] = dependency;
779
790
 
780
- if (this.releaseType !== "production") {
781
- // This change will ultimately be discarded if there are no changes and no updates to organization dependencies.
782
- currentDependencies[dependency] = this.releaseType;
783
- } else {
784
- const dependencyRepository = this.configuration.repositories[dependencyRepositoryName];
791
+ const dependencyRepository = this.configuration.repositories[dependencyRepositoryName];
792
+
793
+ // Dependency changes will ultimately be discarded if there are no changes and no updates to organization dependencies.
794
+ switch (this.releaseType) {
795
+ case "alpha":
796
+ currentDependencies[dependency] = "alpha";
797
+ break;
798
+
799
+ case "beta":
800
+ switch (dependencyRepository.dependencyType) {
801
+ case "external":
802
+ currentDependencies[dependency] = "beta";
803
+ break;
804
+
805
+ case "internal":
806
+ {
807
+ const lastBetaTag = dependencyRepository.lastBetaTag;
785
808
 
786
- const lastProductionVersion = dependencyRepository.lastProductionVersion;
809
+ if (lastBetaTag === undefined) {
810
+ throw new Error(`Internal error, last beta tag not set for ${dependencyRepositoryName}`);
811
+ }
787
812
 
788
- if (lastProductionVersion === undefined) {
789
- throw new Error(`Internal error, last production version not set for ${dependencyRepositoryName}`);
790
- }
813
+ currentDependencies[dependency] = `${this.configuration.organization}/${dependencyRepositoryName}#${lastBetaTag}`;
814
+ }
815
+ break;
791
816
 
792
- currentDependencies[dependency] = `^${lastProductionVersion}`;
817
+ default:
818
+ throw new Error(`Invalid dependency type "${dependencyRepository.dependencyType}" for dependency ${dependencyRepositoryName}`);
819
+ }
820
+ break;
821
+
822
+ case "production":
823
+ {
824
+ const lastProductionVersion = dependencyRepository.lastProductionVersion;
825
+
826
+ if (lastProductionVersion === undefined) {
827
+ throw new Error(`Internal error, last production version not set for ${dependencyRepositoryName}`);
828
+ }
829
+
830
+ currentDependencies[dependency] = `^${lastProductionVersion}`;
831
+ }
832
+ break;
793
833
  }
794
834
  }
795
835
  }
@@ -797,13 +837,15 @@ export abstract class Publish {
797
837
  }
798
838
 
799
839
  if (repository.additionalDependencies !== undefined) {
800
- for (const additionalDependency of repository.additionalDependencies) {
801
- if (additionalDependency in this.organizationDependencies) {
802
- logger.warn(`Additional dependency ${additionalDependency} already exists`);
840
+ for (const additionalDependencyName of repository.additionalDependencies) {
841
+ if (additionalDependencyName in this.organizationDependencies) {
842
+ logger.warn(`Additional dependency ${additionalDependencyName} already exists`);
803
843
  } else {
804
- logger.trace(`Organization dependency from additional dependencies ${additionalDependency}:null`);
844
+ const dependency = `${this.atOrganization}/${additionalDependencyName}`;
845
+
846
+ logger.trace(`Organization dependency from additional dependencies ${additionalDependencyName}:${dependency}`);
805
847
 
806
- this.organizationDependencies[additionalDependency] = null;
848
+ this.organizationDependencies[additionalDependencyName] = dependency;
807
849
  }
808
850
  }
809
851
  }
@@ -853,7 +895,7 @@ export abstract class Publish {
853
895
  }
854
896
 
855
897
  if (lastPublished === undefined || dependencyLastPublished > lastPublished) {
856
- logger.info(`Repository ${dependencyRepositoryName} recently published`);
898
+ logger.info(`Dependency ${dependencyRepositoryName} recently published`);
857
899
 
858
900
  // At least one dependency repository has been published since the last publication of this repository.
859
901
  this._organizationDependenciesUpdated = true;