@storm-software/cloudflare-tools 0.6.0 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/cloudflare-tools",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "private": false,
5
5
  "description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
6
6
  "keywords": [
@@ -6,6 +6,12 @@ import type { StormConfigInput } from "./types";
6
6
  * @returns The config values for the current Storm workspace
7
7
  */
8
8
  export declare const defineConfig: (input: StormConfigInput) => {
9
+ registry: {
10
+ github?: string | undefined;
11
+ npm?: string | undefined;
12
+ cargo?: string | undefined;
13
+ cyclone?: string | undefined;
14
+ };
9
15
  colors: {
10
16
  dark: {
11
17
  foreground?: string | undefined;
@@ -221,6 +221,23 @@ export declare const SingleThemeColorConfigSchema: z.ZodObject<{
221
221
  dark?: string | undefined;
222
222
  light?: string | undefined;
223
223
  }>;
224
+ export declare const RegistryUrlConfigSchema: z.ZodOptional<z.ZodString>;
225
+ export declare const RegistryConfigSchema: z.ZodObject<{
226
+ github: z.ZodOptional<z.ZodString>;
227
+ npm: z.ZodOptional<z.ZodString>;
228
+ cargo: z.ZodOptional<z.ZodString>;
229
+ cyclone: z.ZodOptional<z.ZodString>;
230
+ }, "strip", z.ZodTypeAny, {
231
+ github?: string | undefined;
232
+ npm?: string | undefined;
233
+ cargo?: string | undefined;
234
+ cyclone?: string | undefined;
235
+ }, {
236
+ github?: string | undefined;
237
+ npm?: string | undefined;
238
+ cargo?: string | undefined;
239
+ cyclone?: string | undefined;
240
+ }>;
224
241
  /**
225
242
  * Storm theme color config values used for styling various workspace elements
226
243
  */
@@ -790,6 +807,22 @@ export declare const StormConfigSchema: z.ZodObject<{
790
807
  locale: z.ZodDefault<z.ZodString>;
791
808
  logLevel: z.ZodDefault<z.ZodEnum<["silent", "fatal", "error", "warn", "info", "debug", "trace", "all"]>>;
792
809
  cloudflareAccountId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
810
+ registry: z.ZodObject<{
811
+ github: z.ZodOptional<z.ZodString>;
812
+ npm: z.ZodOptional<z.ZodString>;
813
+ cargo: z.ZodOptional<z.ZodString>;
814
+ cyclone: z.ZodOptional<z.ZodString>;
815
+ }, "strip", z.ZodTypeAny, {
816
+ github?: string | undefined;
817
+ npm?: string | undefined;
818
+ cargo?: string | undefined;
819
+ cyclone?: string | undefined;
820
+ }, {
821
+ github?: string | undefined;
822
+ npm?: string | undefined;
823
+ cargo?: string | undefined;
824
+ cyclone?: string | undefined;
825
+ }>;
793
826
  configFile: z.ZodDefault<z.ZodNullable<z.ZodString>>;
794
827
  colors: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
795
828
  dark: z.ZodDefault<z.ZodString>;
@@ -1347,6 +1380,12 @@ export declare const StormConfigSchema: z.ZodObject<{
1347
1380
  locale: string;
1348
1381
  logLevel: "info" | "error" | "fatal" | "silent" | "warn" | "debug" | "trace" | "all";
1349
1382
  cloudflareAccountId: string | null;
1383
+ registry: {
1384
+ github?: string | undefined;
1385
+ npm?: string | undefined;
1386
+ cargo?: string | undefined;
1387
+ cyclone?: string | undefined;
1388
+ };
1350
1389
  configFile: string | null;
1351
1390
  colors: {
1352
1391
  dark: {
@@ -1468,6 +1507,12 @@ export declare const StormConfigSchema: z.ZodObject<{
1468
1507
  workspaceRoot?: string | undefined;
1469
1508
  packageDirectory?: string | undefined;
1470
1509
  }, {
1510
+ registry: {
1511
+ github?: string | undefined;
1512
+ npm?: string | undefined;
1513
+ cargo?: string | undefined;
1514
+ cyclone?: string | undefined;
1515
+ };
1471
1516
  colors: {
1472
1517
  dark: {
1473
1518
  foreground?: string | undefined;
@@ -3,4 +3,4 @@ import type { CargoPublishExecutorSchema } from "./schema.d";
3
3
  export default function runExecutor(options: CargoPublishExecutorSchema, context: ExecutorContext): Promise<{
4
4
  success: boolean;
5
5
  }>;
6
- export declare const getRegistryVersion: (name: string, version: string) => Promise<string>;
6
+ export declare const getRegistryVersion: (name: string, version: string, registry: string) => Promise<string>;
@@ -66601,7 +66601,7 @@ var init_lib = __esm({
66601
66601
  });
66602
66602
 
66603
66603
  // packages/config/src/schema.ts
66604
- var DarkColorSchema, LightColorSchema, BrandColorSchema, AccentColorSchema, HelpColorSchema, SuccessColorSchema, InfoColorSchema, WarningColorSchema, ErrorColorSchema, FatalColorSchema, DarkThemeColorConfigSchema, LightThemeColorConfigSchema, MultiThemeColorConfigSchema, SingleThemeColorConfigSchema, ColorConfigSchema, ColorConfigMapSchema, StormConfigSchema;
66604
+ var DarkColorSchema, LightColorSchema, BrandColorSchema, AccentColorSchema, HelpColorSchema, SuccessColorSchema, InfoColorSchema, WarningColorSchema, ErrorColorSchema, FatalColorSchema, DarkThemeColorConfigSchema, LightThemeColorConfigSchema, MultiThemeColorConfigSchema, SingleThemeColorConfigSchema, RegistryUrlConfigSchema, RegistryConfigSchema, ColorConfigSchema, ColorConfigMapSchema, StormConfigSchema;
66605
66605
  var init_schema = __esm({
66606
66606
  "packages/config/src/schema.ts"() {
66607
66607
  init_lib();
@@ -66655,6 +66655,13 @@ var init_schema = __esm({
66655
66655
  error: ErrorColorSchema,
66656
66656
  fatal: FatalColorSchema
66657
66657
  });
66658
+ RegistryUrlConfigSchema = z2.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
66659
+ RegistryConfigSchema = z2.object({
66660
+ github: RegistryUrlConfigSchema,
66661
+ npm: RegistryUrlConfigSchema,
66662
+ cargo: RegistryUrlConfigSchema,
66663
+ cyclone: RegistryUrlConfigSchema
66664
+ }).describe("A list of remote registry URLs used by Storm Software");
66658
66665
  ColorConfigSchema = SingleThemeColorConfigSchema.or(
66659
66666
  MultiThemeColorConfigSchema
66660
66667
  ).describe("Colors used for various workspace elements");
@@ -66710,6 +66717,7 @@ var init_schema = __esm({
66710
66717
  "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
66711
66718
  ),
66712
66719
  cloudflareAccountId: z2.string().trim().toLowerCase().length(32).regex(/^([0-9a-fA-F]{32})$/i).nullable().default(null).describe("The default Cloudflare account ID of the workspace"),
66720
+ registry: RegistryConfigSchema,
66713
66721
  configFile: z2.string().trim().nullable().default(null).describe(
66714
66722
  "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
66715
66723
  ),
@@ -68966,6 +68974,12 @@ var init_get_env = __esm({
68966
68974
  preid: process.env[`${prefix}PRE_ID`],
68967
68975
  externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
68968
68976
  cloudflareAccountId: process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] ? process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] : process.env.CLOUDFLARE_ACCOUNT_ID ? process.env.CLOUDFLARE_ACCOUNT_ID : process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
68977
+ registry: {
68978
+ github: process.env[`${prefix}REGISTRY_GITHUB`],
68979
+ npm: process.env[`${prefix}REGISTRY_NPM`],
68980
+ cargo: process.env[`${prefix}REGISTRY_CARGO`],
68981
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`]
68982
+ },
68969
68983
  logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
68970
68984
  Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
68971
68985
  ) ? getLogLevelLabel(
@@ -69189,6 +69203,22 @@ var init_set_env = __esm({
69189
69203
  config.cloudflareAccountId
69190
69204
  );
69191
69205
  }
69206
+ if (config.registry) {
69207
+ if (config.registry.github) {
69208
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
69209
+ }
69210
+ if (config.registry.npm) {
69211
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
69212
+ }
69213
+ if (config.registry.cargo) {
69214
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
69215
+ }
69216
+ if (config.registry.cyclone) {
69217
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
69218
+ config.registry.cyclone
69219
+ );
69220
+ }
69221
+ }
69192
69222
  if (config.logLevel) {
69193
69223
  process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
69194
69224
  process.env.LOG_LEVEL = String(config.logLevel);
@@ -406206,13 +406236,14 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406206
406236
  switch (options.currentVersionResolver) {
406207
406237
  case "registry": {
406208
406238
  const metadata = options.currentVersionResolverMetadata;
406209
- const registry = metadata?.registry ?? await getNpmRegistry() ?? "https://registry.npmjs.org";
406239
+ const npmRegistry = metadata?.registry ?? await getNpmRegistry();
406240
+ const githubRegistry = metadata?.registry ?? await getGitHubRegistry();
406210
406241
  const tag = metadata?.tag ?? "latest";
406211
406242
  if (options.releaseGroup.projectsRelationship === "independent") {
406212
406243
  try {
406213
406244
  currentVersion = await new Promise((resolve3, reject) => {
406214
406245
  (0, import_node_child_process6.exec)(
406215
- `npm view ${packageName} version --registry=${registry} --tag=${tag}`,
406246
+ `npm view ${packageName} version --registry=${npmRegistry} --tag=${tag}`,
406216
406247
  (error, stdout, stderr) => {
406217
406248
  if (error) {
406218
406249
  return reject(error);
@@ -406225,19 +406256,39 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406225
406256
  );
406226
406257
  });
406227
406258
  log(
406228
- `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${registry}`
406259
+ `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${npmRegistry}`
406229
406260
  );
406230
406261
  } catch (_6) {
406231
- if (options.fallbackCurrentVersionResolver === "disk") {
406262
+ try {
406263
+ currentVersion = await new Promise((resolve3, reject) => {
406264
+ (0, import_node_child_process6.exec)(
406265
+ `npm view ${packageName} version --registry=${githubRegistry} --tag=${tag}`,
406266
+ (error, stdout, stderr) => {
406267
+ if (error) {
406268
+ return reject(error);
406269
+ }
406270
+ if (stderr) {
406271
+ return reject(stderr);
406272
+ }
406273
+ return resolve3(stdout.trim());
406274
+ }
406275
+ );
406276
+ });
406232
406277
  log(
406233
- `\u{1F4C4} Unable to resolve the current version from the registry ${registry}. Falling back to the version on disk of ${currentVersionFromDisk}`
406234
- );
406235
- currentVersion = currentVersionFromDisk;
406236
- currentVersionResolvedFromFallback = true;
406237
- } else {
406238
- throw new Error(
406239
- `Unable to resolve the current version from the registry ${registry}. Please ensure that the package exists in the registry in order to use the "registry" currentVersionResolver. Alternatively, you can use the --first-release option or set "release.version.generatorOptions.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when the registry lookup fails.`
406278
+ `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${githubRegistry}`
406240
406279
  );
406280
+ } catch (_7) {
406281
+ if (options.fallbackCurrentVersionResolver === "disk") {
406282
+ log(
406283
+ `\u{1F4C4} Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Falling back to the version on disk of ${currentVersionFromDisk}`
406284
+ );
406285
+ currentVersion = currentVersionFromDisk;
406286
+ currentVersionResolvedFromFallback = true;
406287
+ } else {
406288
+ throw new Error(
406289
+ `Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Please ensure that the package exists in the registry in order to use the "registry" currentVersionResolver. Alternatively, you can use the --first-release option or set "release.version.generatorOptions.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when the registry lookup fails.`
406290
+ );
406291
+ }
406241
406292
  }
406242
406293
  }
406243
406294
  } else {
@@ -406247,7 +406298,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406247
406298
  );
406248
406299
  } else {
406249
406300
  log(
406250
- `\u{1F4C4} Using the current version ${currentVersion} already resolved from the registry ${registry}`
406301
+ `\u{1F4C4} Using the current version ${currentVersion} already resolved from the registry ${npmRegistry ?? githubRegistry}`
406251
406302
  );
406252
406303
  }
406253
406304
  }
@@ -406272,17 +406323,18 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406272
406323
  }
406273
406324
  );
406274
406325
  if (!latestMatchingGitTag) {
406275
- if (options.fallbackCurrentVersionResolver === "disk") {
406326
+ if (currentVersionFromDisk) {
406276
406327
  log(
406277
406328
  `\u{1F4C4} Unable to resolve the current version from git tag using pattern "${releaseTagPattern}". Falling back to the version on disk of ${currentVersionFromDisk}`
406278
406329
  );
406279
406330
  currentVersion = currentVersionFromDisk;
406280
- currentVersionResolvedFromFallback = true;
406281
406331
  } else {
406282
- throw new Error(
406283
- `No git tags matching pattern "${releaseTagPattern}" for project "${project.name}" were found. You will need to create an initial matching tag to use as a base for determining the next version. Alternatively, you can use the --first-release option or set "release.version.generatorOptions.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when no matching git tags are found.`
406332
+ log(
406333
+ `No git tags matching pattern "${releaseTagPattern}" for project "${project.name}" were found. This process also could not determine the version by checking the package files on disk, so we will attempt to use the default version value: "0.0.1".`
406284
406334
  );
406335
+ currentVersion = "0.0.1";
406285
406336
  }
406337
+ currentVersionResolvedFromFallback = true;
406286
406338
  } else {
406287
406339
  currentVersion = latestMatchingGitTag.extractedVersion;
406288
406340
  log(
@@ -406320,13 +406372,14 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406320
406372
  );
406321
406373
  }
406322
406374
  const affectedProjects = options.releaseGroup.projectsRelationship === "independent" ? [projectName] : projects.map((p2) => p2.name);
406323
- const previousVersionRef = latestMatchingGitTag ? latestMatchingGitTag.tag : options.fallbackCurrentVersionResolver === "disk" ? await (0, import_git.getFirstGitCommit)() : void 0;
406375
+ let previousVersionRef = latestMatchingGitTag?.tag ? latestMatchingGitTag.tag : await (0, import_git.getFirstGitCommit)();
406324
406376
  if (!previousVersionRef) {
406325
- throw new Error(
406377
+ log(
406326
406378
  `Unable to determine previous version ref for the projects ${affectedProjects.join(
406327
406379
  ", "
406328
- )}. This is likely a bug in Nx.`
406380
+ )}. This is likely a bug in Storm's Release Versioning. We will attempt to use the default version value "0.0.1" and continue with the process.`
406329
406381
  );
406382
+ previousVersionRef = "0.0.1";
406330
406383
  }
406331
406384
  specifier = await (0, import_resolve_semver_specifier.resolveSemverSpecifierFromConventionalCommits)(
406332
406385
  previousVersionRef,
@@ -406577,7 +406630,10 @@ var generator_default4 = withRunGenerator(
406577
406630
  releaseVersionGeneratorFn
406578
406631
  );
406579
406632
  async function getNpmRegistry() {
406580
- return await new Promise((resolve3, reject) => {
406633
+ if (process.env.STORM_REGISTRY_NPM) {
406634
+ return process.env.STORM_REGISTRY_NPM;
406635
+ }
406636
+ const registry = await new Promise((resolve3, reject) => {
406581
406637
  (0, import_node_child_process6.exec)("npm config get registry", (error, stdout, stderr) => {
406582
406638
  if (error) {
406583
406639
  return reject(error);
@@ -406588,6 +406644,13 @@ async function getNpmRegistry() {
406588
406644
  return resolve3(stdout.trim());
406589
406645
  });
406590
406646
  });
406647
+ return registry ? registry : "https://registry.npmjs.org";
406648
+ }
406649
+ function getGitHubRegistry() {
406650
+ if (process.env.STORM_REGISTRY_GITHUB) {
406651
+ return process.env.STORM_REGISTRY_GITHUB;
406652
+ }
406653
+ return "https://npm.pkg.github.com";
406591
406654
  }
406592
406655
  function hasGitDiff(filePath) {
406593
406656
  try {
@@ -66649,7 +66649,7 @@ var init_lib = __esm({
66649
66649
  });
66650
66650
 
66651
66651
  // packages/config/src/schema.ts
66652
- var DarkColorSchema, LightColorSchema, BrandColorSchema, AccentColorSchema, HelpColorSchema, SuccessColorSchema, InfoColorSchema, WarningColorSchema, ErrorColorSchema, FatalColorSchema, DarkThemeColorConfigSchema, LightThemeColorConfigSchema, MultiThemeColorConfigSchema, SingleThemeColorConfigSchema, ColorConfigSchema, ColorConfigMapSchema, StormConfigSchema;
66652
+ var DarkColorSchema, LightColorSchema, BrandColorSchema, AccentColorSchema, HelpColorSchema, SuccessColorSchema, InfoColorSchema, WarningColorSchema, ErrorColorSchema, FatalColorSchema, DarkThemeColorConfigSchema, LightThemeColorConfigSchema, MultiThemeColorConfigSchema, SingleThemeColorConfigSchema, RegistryUrlConfigSchema, RegistryConfigSchema, ColorConfigSchema, ColorConfigMapSchema, StormConfigSchema;
66653
66653
  var init_schema = __esm({
66654
66654
  "packages/config/src/schema.ts"() {
66655
66655
  init_lib();
@@ -66703,6 +66703,13 @@ var init_schema = __esm({
66703
66703
  error: ErrorColorSchema,
66704
66704
  fatal: FatalColorSchema
66705
66705
  });
66706
+ RegistryUrlConfigSchema = z2.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
66707
+ RegistryConfigSchema = z2.object({
66708
+ github: RegistryUrlConfigSchema,
66709
+ npm: RegistryUrlConfigSchema,
66710
+ cargo: RegistryUrlConfigSchema,
66711
+ cyclone: RegistryUrlConfigSchema
66712
+ }).describe("A list of remote registry URLs used by Storm Software");
66706
66713
  ColorConfigSchema = SingleThemeColorConfigSchema.or(
66707
66714
  MultiThemeColorConfigSchema
66708
66715
  ).describe("Colors used for various workspace elements");
@@ -66758,6 +66765,7 @@ var init_schema = __esm({
66758
66765
  "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
66759
66766
  ),
66760
66767
  cloudflareAccountId: z2.string().trim().toLowerCase().length(32).regex(/^([0-9a-fA-F]{32})$/i).nullable().default(null).describe("The default Cloudflare account ID of the workspace"),
66768
+ registry: RegistryConfigSchema,
66761
66769
  configFile: z2.string().trim().nullable().default(null).describe(
66762
66770
  "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
66763
66771
  ),
@@ -69014,6 +69022,12 @@ var init_get_env = __esm({
69014
69022
  preid: process.env[`${prefix}PRE_ID`],
69015
69023
  externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
69016
69024
  cloudflareAccountId: process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] ? process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] : process.env.CLOUDFLARE_ACCOUNT_ID ? process.env.CLOUDFLARE_ACCOUNT_ID : process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
69025
+ registry: {
69026
+ github: process.env[`${prefix}REGISTRY_GITHUB`],
69027
+ npm: process.env[`${prefix}REGISTRY_NPM`],
69028
+ cargo: process.env[`${prefix}REGISTRY_CARGO`],
69029
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`]
69030
+ },
69017
69031
  logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
69018
69032
  Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
69019
69033
  ) ? getLogLevelLabel(
@@ -69237,6 +69251,22 @@ var init_set_env = __esm({
69237
69251
  config.cloudflareAccountId
69238
69252
  );
69239
69253
  }
69254
+ if (config.registry) {
69255
+ if (config.registry.github) {
69256
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
69257
+ }
69258
+ if (config.registry.npm) {
69259
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
69260
+ }
69261
+ if (config.registry.cargo) {
69262
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
69263
+ }
69264
+ if (config.registry.cyclone) {
69265
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
69266
+ config.registry.cyclone
69267
+ );
69268
+ }
69269
+ }
69240
69270
  if (config.logLevel) {
69241
69271
  process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
69242
69272
  process.env.LOG_LEVEL = String(config.logLevel);
@@ -406257,13 +406287,14 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406257
406287
  switch (options.currentVersionResolver) {
406258
406288
  case "registry": {
406259
406289
  const metadata = options.currentVersionResolverMetadata;
406260
- const registry = metadata?.registry ?? await getNpmRegistry() ?? "https://registry.npmjs.org";
406290
+ const npmRegistry = metadata?.registry ?? await getNpmRegistry();
406291
+ const githubRegistry = metadata?.registry ?? await getGitHubRegistry();
406261
406292
  const tag = metadata?.tag ?? "latest";
406262
406293
  if (options.releaseGroup.projectsRelationship === "independent") {
406263
406294
  try {
406264
406295
  currentVersion = await new Promise((resolve3, reject) => {
406265
406296
  (0, import_node_child_process6.exec)(
406266
- `npm view ${packageName} version --registry=${registry} --tag=${tag}`,
406297
+ `npm view ${packageName} version --registry=${npmRegistry} --tag=${tag}`,
406267
406298
  (error, stdout, stderr) => {
406268
406299
  if (error) {
406269
406300
  return reject(error);
@@ -406276,19 +406307,39 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406276
406307
  );
406277
406308
  });
406278
406309
  log(
406279
- `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${registry}`
406310
+ `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${npmRegistry}`
406280
406311
  );
406281
406312
  } catch (_6) {
406282
- if (options.fallbackCurrentVersionResolver === "disk") {
406313
+ try {
406314
+ currentVersion = await new Promise((resolve3, reject) => {
406315
+ (0, import_node_child_process6.exec)(
406316
+ `npm view ${packageName} version --registry=${githubRegistry} --tag=${tag}`,
406317
+ (error, stdout, stderr) => {
406318
+ if (error) {
406319
+ return reject(error);
406320
+ }
406321
+ if (stderr) {
406322
+ return reject(stderr);
406323
+ }
406324
+ return resolve3(stdout.trim());
406325
+ }
406326
+ );
406327
+ });
406283
406328
  log(
406284
- `\u{1F4C4} Unable to resolve the current version from the registry ${registry}. Falling back to the version on disk of ${currentVersionFromDisk}`
406285
- );
406286
- currentVersion = currentVersionFromDisk;
406287
- currentVersionResolvedFromFallback = true;
406288
- } else {
406289
- throw new Error(
406290
- `Unable to resolve the current version from the registry ${registry}. Please ensure that the package exists in the registry in order to use the "registry" currentVersionResolver. Alternatively, you can use the --first-release option or set "release.version.generatorOptions.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when the registry lookup fails.`
406329
+ `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${githubRegistry}`
406291
406330
  );
406331
+ } catch (_7) {
406332
+ if (options.fallbackCurrentVersionResolver === "disk") {
406333
+ log(
406334
+ `\u{1F4C4} Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Falling back to the version on disk of ${currentVersionFromDisk}`
406335
+ );
406336
+ currentVersion = currentVersionFromDisk;
406337
+ currentVersionResolvedFromFallback = true;
406338
+ } else {
406339
+ throw new Error(
406340
+ `Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Please ensure that the package exists in the registry in order to use the "registry" currentVersionResolver. Alternatively, you can use the --first-release option or set "release.version.generatorOptions.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when the registry lookup fails.`
406341
+ );
406342
+ }
406292
406343
  }
406293
406344
  }
406294
406345
  } else {
@@ -406298,7 +406349,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406298
406349
  );
406299
406350
  } else {
406300
406351
  log(
406301
- `\u{1F4C4} Using the current version ${currentVersion} already resolved from the registry ${registry}`
406352
+ `\u{1F4C4} Using the current version ${currentVersion} already resolved from the registry ${npmRegistry ?? githubRegistry}`
406302
406353
  );
406303
406354
  }
406304
406355
  }
@@ -406323,17 +406374,18 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406323
406374
  }
406324
406375
  );
406325
406376
  if (!latestMatchingGitTag) {
406326
- if (options.fallbackCurrentVersionResolver === "disk") {
406377
+ if (currentVersionFromDisk) {
406327
406378
  log(
406328
406379
  `\u{1F4C4} Unable to resolve the current version from git tag using pattern "${releaseTagPattern}". Falling back to the version on disk of ${currentVersionFromDisk}`
406329
406380
  );
406330
406381
  currentVersion = currentVersionFromDisk;
406331
- currentVersionResolvedFromFallback = true;
406332
406382
  } else {
406333
- throw new Error(
406334
- `No git tags matching pattern "${releaseTagPattern}" for project "${project.name}" were found. You will need to create an initial matching tag to use as a base for determining the next version. Alternatively, you can use the --first-release option or set "release.version.generatorOptions.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when no matching git tags are found.`
406383
+ log(
406384
+ `No git tags matching pattern "${releaseTagPattern}" for project "${project.name}" were found. This process also could not determine the version by checking the package files on disk, so we will attempt to use the default version value: "0.0.1".`
406335
406385
  );
406386
+ currentVersion = "0.0.1";
406336
406387
  }
406388
+ currentVersionResolvedFromFallback = true;
406337
406389
  } else {
406338
406390
  currentVersion = latestMatchingGitTag.extractedVersion;
406339
406391
  log(
@@ -406371,13 +406423,14 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
406371
406423
  );
406372
406424
  }
406373
406425
  const affectedProjects = options.releaseGroup.projectsRelationship === "independent" ? [projectName] : projects.map((p2) => p2.name);
406374
- const previousVersionRef = latestMatchingGitTag ? latestMatchingGitTag.tag : options.fallbackCurrentVersionResolver === "disk" ? await (0, import_git.getFirstGitCommit)() : void 0;
406426
+ let previousVersionRef = latestMatchingGitTag?.tag ? latestMatchingGitTag.tag : await (0, import_git.getFirstGitCommit)();
406375
406427
  if (!previousVersionRef) {
406376
- throw new Error(
406428
+ log(
406377
406429
  `Unable to determine previous version ref for the projects ${affectedProjects.join(
406378
406430
  ", "
406379
- )}. This is likely a bug in Nx.`
406431
+ )}. This is likely a bug in Storm's Release Versioning. We will attempt to use the default version value "0.0.1" and continue with the process.`
406380
406432
  );
406433
+ previousVersionRef = "0.0.1";
406381
406434
  }
406382
406435
  specifier = await (0, import_resolve_semver_specifier.resolveSemverSpecifierFromConventionalCommits)(
406383
406436
  previousVersionRef,
@@ -406628,7 +406681,10 @@ var generator_default4 = withRunGenerator(
406628
406681
  releaseVersionGeneratorFn
406629
406682
  );
406630
406683
  async function getNpmRegistry() {
406631
- return await new Promise((resolve3, reject) => {
406684
+ if (process.env.STORM_REGISTRY_NPM) {
406685
+ return process.env.STORM_REGISTRY_NPM;
406686
+ }
406687
+ const registry = await new Promise((resolve3, reject) => {
406632
406688
  (0, import_node_child_process6.exec)("npm config get registry", (error, stdout, stderr) => {
406633
406689
  if (error) {
406634
406690
  return reject(error);
@@ -406639,6 +406695,13 @@ async function getNpmRegistry() {
406639
406695
  return resolve3(stdout.trim());
406640
406696
  });
406641
406697
  });
406698
+ return registry ? registry : "https://registry.npmjs.org";
406699
+ }
406700
+ function getGitHubRegistry() {
406701
+ if (process.env.STORM_REGISTRY_GITHUB) {
406702
+ return process.env.STORM_REGISTRY_GITHUB;
406703
+ }
406704
+ return "https://npm.pkg.github.com";
406642
406705
  }
406643
406706
  function hasGitDiff(filePath) {
406644
406707
  try {
@@ -222221,7 +222221,7 @@ var require_package3 = __commonJS({
222221
222221
  "packages/cloudflare-tools/package.json"(exports2, module2) {
222222
222222
  module2.exports = {
222223
222223
  name: "@storm-software/cloudflare-tools",
222224
- version: "0.6.0",
222224
+ version: "0.6.1",
222225
222225
  private: false,
222226
222226
  description: "\u26A1The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
222227
222227
  keywords: [
@@ -453264,7 +453264,7 @@ var require_package13 = __commonJS({
453264
453264
  "packages/cloudflare-tools/package.json"(exports2, module2) {
453265
453265
  module2.exports = {
453266
453266
  name: "@storm-software/cloudflare-tools",
453267
- version: "0.6.0",
453267
+ version: "0.6.1",
453268
453268
  private: false,
453269
453269
  description: "\u26A1The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
453270
453270
  keywords: [
@@ -519788,7 +519788,7 @@ var init_lib = __esm({
519788
519788
  });
519789
519789
 
519790
519790
  // packages/config/src/schema.ts
519791
- var DarkColorSchema, LightColorSchema, BrandColorSchema, AccentColorSchema, HelpColorSchema, SuccessColorSchema, InfoColorSchema, WarningColorSchema, ErrorColorSchema, FatalColorSchema, DarkThemeColorConfigSchema, LightThemeColorConfigSchema, MultiThemeColorConfigSchema, SingleThemeColorConfigSchema, ColorConfigSchema, ColorConfigMapSchema, StormConfigSchema;
519791
+ var DarkColorSchema, LightColorSchema, BrandColorSchema, AccentColorSchema, HelpColorSchema, SuccessColorSchema, InfoColorSchema, WarningColorSchema, ErrorColorSchema, FatalColorSchema, DarkThemeColorConfigSchema, LightThemeColorConfigSchema, MultiThemeColorConfigSchema, SingleThemeColorConfigSchema, RegistryUrlConfigSchema, RegistryConfigSchema, ColorConfigSchema, ColorConfigMapSchema, StormConfigSchema;
519792
519792
  var init_schema = __esm({
519793
519793
  "packages/config/src/schema.ts"() {
519794
519794
  init_lib();
@@ -519842,6 +519842,13 @@ var init_schema = __esm({
519842
519842
  error: ErrorColorSchema,
519843
519843
  fatal: FatalColorSchema
519844
519844
  });
519845
+ RegistryUrlConfigSchema = z2.string().trim().toLowerCase().url().optional().describe("A remote registry URL used to publish distributable packages");
519846
+ RegistryConfigSchema = z2.object({
519847
+ github: RegistryUrlConfigSchema,
519848
+ npm: RegistryUrlConfigSchema,
519849
+ cargo: RegistryUrlConfigSchema,
519850
+ cyclone: RegistryUrlConfigSchema
519851
+ }).describe("A list of remote registry URLs used by Storm Software");
519845
519852
  ColorConfigSchema = SingleThemeColorConfigSchema.or(
519846
519853
  MultiThemeColorConfigSchema
519847
519854
  ).describe("Colors used for various workspace elements");
@@ -519897,6 +519904,7 @@ var init_schema = __esm({
519897
519904
  "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
519898
519905
  ),
519899
519906
  cloudflareAccountId: z2.string().trim().toLowerCase().length(32).regex(/^([0-9a-fA-F]{32})$/i).nullable().default(null).describe("The default Cloudflare account ID of the workspace"),
519907
+ registry: RegistryConfigSchema,
519900
519908
  configFile: z2.string().trim().nullable().default(null).describe(
519901
519909
  "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
519902
519910
  ),
@@ -520606,6 +520614,12 @@ var init_get_env = __esm({
520606
520614
  preid: process.env[`${prefix}PRE_ID`],
520607
520615
  externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
520608
520616
  cloudflareAccountId: process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] ? process.env[`${prefix}CLOUDFLARE_ACCOUNT_ID`] : process.env.CLOUDFLARE_ACCOUNT_ID ? process.env.CLOUDFLARE_ACCOUNT_ID : process.env.STORM_BOT_CLOUDFLARE_ACCOUNT,
520617
+ registry: {
520618
+ github: process.env[`${prefix}REGISTRY_GITHUB`],
520619
+ npm: process.env[`${prefix}REGISTRY_NPM`],
520620
+ cargo: process.env[`${prefix}REGISTRY_CARGO`],
520621
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`]
520622
+ },
520609
520623
  logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
520610
520624
  Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
520611
520625
  ) ? getLogLevelLabel(
@@ -520829,6 +520843,22 @@ var init_set_env = __esm({
520829
520843
  config.cloudflareAccountId
520830
520844
  );
520831
520845
  }
520846
+ if (config.registry) {
520847
+ if (config.registry.github) {
520848
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
520849
+ }
520850
+ if (config.registry.npm) {
520851
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
520852
+ }
520853
+ if (config.registry.cargo) {
520854
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
520855
+ }
520856
+ if (config.registry.cyclone) {
520857
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
520858
+ config.registry.cyclone
520859
+ );
520860
+ }
520861
+ }
520832
520862
  if (config.logLevel) {
520833
520863
  process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
520834
520864
  process.env.LOG_LEVEL = String(config.logLevel);