@storm-software/cloudflare-tools 0.24.1 → 0.26.0

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.24.1",
3
+ "version": "0.26.0",
4
4
  "type": "commonjs",
5
5
  "description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
6
6
  "repository": {
@@ -4,3 +4,4 @@ import type { TypeScriptBuildOptions } from "../../declarations";
4
4
  export declare const generatePackageJson: (config: StormConfig, projectRoot: string, sourceRoot: string, projectName: string, options: TypeScriptBuildOptions) => Promise<Record<string, any>>;
5
5
  export declare const formatPackageJson: (config: StormConfig, projectRoot: string, sourceRoot: string, projectName: string, options: Pick<TypeScriptBuildOptions, "tsConfig" | "external" | "generatePackageJson" | "bundle" | "includeSrc">, packageJson: Record<string, any>, projectGraph: ProjectGraph, projectsConfigurations: Record<string, ProjectConfiguration>) => Promise<Record<string, any>>;
6
6
  export declare const addWorkspacePackageJsonFields: (config: StormConfig, projectRoot: string, sourceRoot: string, projectName: string, includeSrc: boolean | undefined, packageJson: Record<string, any>) => Record<string, any>;
7
+ export declare const addPackageJsonExports: (sourceRoot: string, packageJson: Record<string, any>) => Promise<Record<string, any>>;
@@ -148,7 +148,6 @@ export declare const defineConfig: (input: StormConfigInput) => {
148
148
  owner?: string | undefined;
149
149
  worker?: string | undefined;
150
150
  env?: "development" | "staging" | "production" | undefined;
151
- ci?: boolean | undefined;
152
151
  workspaceRoot?: string | undefined;
153
152
  packageDirectory?: string | undefined;
154
153
  externalPackagePatterns?: string[] | undefined;
@@ -922,7 +922,6 @@ export declare const StormConfigSchema: z.ZodObject<{
922
922
  owner: z.ZodDefault<z.ZodString>;
923
923
  worker: z.ZodDefault<z.ZodString>;
924
924
  env: z.ZodDefault<z.ZodEnum<["development", "staging", "production"]>>;
925
- ci: z.ZodDefault<z.ZodBoolean>;
926
925
  workspaceRoot: z.ZodDefault<z.ZodString>;
927
926
  packageDirectory: z.ZodOptional<z.ZodString>;
928
927
  externalPackagePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -1588,7 +1587,6 @@ export declare const StormConfigSchema: z.ZodObject<{
1588
1587
  owner: string;
1589
1588
  worker: string;
1590
1589
  env: "development" | "staging" | "production";
1591
- ci: boolean;
1592
1590
  workspaceRoot: string;
1593
1591
  externalPackagePatterns: string[];
1594
1592
  skipCache: boolean;
@@ -1887,7 +1885,6 @@ export declare const StormConfigSchema: z.ZodObject<{
1887
1885
  owner?: string | undefined;
1888
1886
  worker?: string | undefined;
1889
1887
  env?: "development" | "staging" | "production" | undefined;
1890
- ci?: boolean | undefined;
1891
1888
  workspaceRoot?: string | undefined;
1892
1889
  packageDirectory?: string | undefined;
1893
1890
  externalPackagePatterns?: string[] | undefined;
@@ -11,6 +11,8 @@ export type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undef
11
11
  * @param config - The Storm configuration object
12
12
  * @param command - The command to run
13
13
  * @param cwd - The current working directory
14
+ * @param stdio - The standard input/output options
15
+ * @param env - The environment variables
14
16
  * @returns The result of the command
15
17
  */
16
- export declare const run: (config: StormConfig, command: string, cwd?: string, stdio?: StdioOptions) => Buffer;
18
+ export declare const run: (config: StormConfig, command: string, cwd?: string, stdio?: StdioOptions, env?: NodeJS.ProcessEnv) => Buffer;
@@ -1,4 +1,7 @@
1
1
  import type { ExecutorContext, PromiseExecutor } from "@nx/devkit";
2
2
  import type { StormConfig } from "@storm-software/config";
3
- import type { BaseExecutorOptions, BaseExecutorResult, BaseExecutorSchema } from "../../declarations";
4
- export declare const withRunExecutor: <TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema>(name: string, executorFn: (options: TExecutorSchema, context: ExecutorContext, config: StormConfig) => Promise<BaseExecutorResult | null | undefined> | AsyncGenerator<any, BaseExecutorResult | null | undefined> | BaseExecutorResult | null | undefined, executorOptions: BaseExecutorOptions<TExecutorSchema>) => PromiseExecutor<TExecutorSchema>;
3
+ import type { BaseExecutorOptions as _BaseExecutorOptions, BaseExecutorResult as _BaseExecutorResult, BaseExecutorSchema as _BaseExecutorSchema } from "../../declarations";
4
+ export type BaseExecutorOptions<TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema> = _BaseExecutorOptions<TExecutorSchema>;
5
+ export type BaseExecutorResult = _BaseExecutorResult;
6
+ export type BaseExecutorSchema = _BaseExecutorSchema;
7
+ export declare const withRunExecutor: <TExecutorSchema extends BaseExecutorSchema = _BaseExecutorSchema>(name: string, executorFn: (options: TExecutorSchema, context: ExecutorContext, config: StormConfig) => Promise<BaseExecutorResult | null | undefined> | AsyncGenerator<any, BaseExecutorResult | null | undefined> | BaseExecutorResult | null | undefined, executorOptions?: BaseExecutorOptions<TExecutorSchema>) => PromiseExecutor<TExecutorSchema>;
@@ -1,4 +1,4 @@
1
1
  import { type Tree } from "@nx/devkit";
2
2
  import type { Schema } from "./schema";
3
- export declare function stormInitGenerator(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
4
- export default stormInitGenerator;
3
+ export declare function initGenerator(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
4
+ export default initGenerator;
@@ -65400,9 +65400,6 @@ var init_schema = __esm({
65400
65400
  "The worker of the package (this is the bot that will be used to perform various tasks)"
65401
65401
  ),
65402
65402
  env: z2.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment of the package"),
65403
- ci: z2.boolean().default(true).describe(
65404
- "An indicator specifying if the current environment is a CI environment"
65405
- ),
65406
65403
  workspaceRoot: z2.string().trim().default("").describe("The root directory of the workspace"),
65407
65404
  packageDirectory: z2.string().trim().optional().describe("The root directory of the package"),
65408
65405
  externalPackagePatterns: z2.array(z2.string()).default([]).describe(
@@ -65529,7 +65526,6 @@ var init_get_default_config = __esm({
65529
65526
  env: "production",
65530
65527
  branch: "main",
65531
65528
  organization: "storm-software",
65532
- ci: true,
65533
65529
  configFile: null,
65534
65530
  runtimeVersion: "1.0.0",
65535
65531
  colors: { ...DEFAULT_COLOR_CONFIG },
@@ -67436,11 +67432,13 @@ var init_run = __esm({
67436
67432
  "packages/config-tools/src/utilities/run.ts"() {
67437
67433
  import_node_child_process5 = require("node:child_process");
67438
67434
  LARGE_BUFFER = 1024 * 1e6;
67439
- run = (config, command, cwd2 = config.workspaceRoot ?? process.cwd(), stdio = "inherit") => {
67435
+ run = (config, command, cwd2 = config.workspaceRoot ?? process.cwd(), stdio = "inherit", env = process.env) => {
67440
67436
  return (0, import_node_child_process5.execSync)(command, {
67441
67437
  cwd: cwd2,
67442
67438
  env: {
67443
67439
  ...process.env,
67440
+ ...env,
67441
+ CLICOLOR: "true",
67444
67442
  FORCE_COLOR: "true"
67445
67443
  },
67446
67444
  stdio,
@@ -67682,9 +67680,14 @@ var init_get_env = __esm({
67682
67680
  runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
67683
67681
  outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
67684
67682
  env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
67685
- ci: process.env[`${prefix}CI`] !== void 0 ? Boolean(
67686
- process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
67687
- ) : void 0,
67683
+ // ci:
67684
+ // process.env[`${prefix}CI`] !== undefined
67685
+ // ? Boolean(
67686
+ // process.env[`${prefix}CI`] ??
67687
+ // process.env.CI ??
67688
+ // process.env.CONTINUOUS_INTEGRATION
67689
+ // )
67690
+ // : undefined,
67688
67691
  repository: process.env[`${prefix}REPOSITORY`],
67689
67692
  branch: process.env[`${prefix}BRANCH`],
67690
67693
  preid: process.env[`${prefix}PRE_ID`],
@@ -67885,11 +67888,6 @@ var init_set_env = __esm({
67885
67888
  process.env.NODE_ENV = config.env;
67886
67889
  process.env.ENVIRONMENT = config.env;
67887
67890
  }
67888
- if (config.ci) {
67889
- process.env[`${prefix}CI`] = String(config.ci);
67890
- process.env.CI = String(config.ci);
67891
- process.env.CONTINUOUS_INTEGRATION = String(config.ci);
67892
- }
67893
67891
  if (config.colors?.base?.light || config.colors?.base?.dark) {
67894
67892
  for (const key of Object.keys(config.colors)) {
67895
67893
  setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
@@ -68058,7 +68056,7 @@ var init_create_storm_config = __esm({
68058
68056
  };
68059
68057
  createStormConfig = (extensionName, schema, workspaceRoot3) => {
68060
68058
  let result;
68061
- if (!_static_cache) {
68059
+ if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 3e4) {
68062
68060
  const config = getConfigEnv();
68063
68061
  const defaultConfig = getDefaultConfig(config, workspaceRoot3);
68064
68062
  result = StormConfigSchema.parse({
@@ -68071,7 +68069,7 @@ var init_create_storm_config = __esm({
68071
68069
  });
68072
68070
  result.workspaceRoot ??= defaultConfig.workspaceRoot ? defaultConfig.workspaceRoot : findWorkspaceRoot(workspaceRoot3);
68073
68071
  } else {
68074
- result = _static_cache;
68072
+ result = _static_cache.data;
68075
68073
  }
68076
68074
  if (schema && extensionName) {
68077
68075
  result.extensions = {
@@ -68079,7 +68077,10 @@ var init_create_storm_config = __esm({
68079
68077
  [extensionName]: createConfigExtension(extensionName, schema)
68080
68078
  };
68081
68079
  }
68082
- _static_cache = result;
68080
+ _static_cache = {
68081
+ timestamp: Date.now(),
68082
+ data: result
68083
+ };
68083
68084
  return result;
68084
68085
  };
68085
68086
  createConfigExtension = (extensionName, schema) => {
@@ -68096,6 +68097,13 @@ var init_create_storm_config = __esm({
68096
68097
  };
68097
68098
  loadStormConfig = async (workspaceRoot3) => {
68098
68099
  let config = {};
68100
+ if (_static_cache?.data && _static_cache?.timestamp && _static_cache.timestamp >= Date.now() + 3e4) {
68101
+ writeInfo(
68102
+ `Configuration cache hit - ${_static_cache.timestamp}`,
68103
+ _static_cache.data
68104
+ );
68105
+ return _static_cache.data;
68106
+ }
68099
68107
  let _workspaceRoot = workspaceRoot3;
68100
68108
  if (!_workspaceRoot) {
68101
68109
  _workspaceRoot = findWorkspaceRoot();
@@ -207045,9 +207053,9 @@ ${lanes.join("\n")}
207045
207053
  function checkDeprecations(deprecatedIn, stopsWorkingIn, removedIn, createDiagnostic, fn2) {
207046
207054
  const deprecatedInVersion = new Version(deprecatedIn);
207047
207055
  const removedInVersion = new Version(removedIn);
207048
- const typescriptVersion2 = new Version(typeScriptVersion3 || versionMajorMinor);
207056
+ const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor);
207049
207057
  const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion();
207050
- const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion2) === 1);
207058
+ const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1);
207051
207059
  const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1;
207052
207060
  if (mustBeRemoved || canBeSilenced) {
207053
207061
  fn2((name, value2, useInstead) => {
@@ -421380,9 +421388,9 @@ ${lanes.join("\n")}
421380
421388
  function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn2) {
421381
421389
  const deprecatedInVersion = new Version(deprecatedIn);
421382
421390
  const removedInVersion = new Version(removedIn);
421383
- const typescriptVersion2 = new Version(typeScriptVersion3 || versionMajorMinor);
421391
+ const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor);
421384
421392
  const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion();
421385
- const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion2) === 1);
421393
+ const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1);
421386
421394
  const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1;
421387
421395
  if (mustBeRemoved || canBeSilenced) {
421388
421396
  fn2((name, value2, useInstead) => {
@@ -605970,7 +605978,7 @@ var applyWorkspaceExecutorTokens = async (option, tokenizerOptions) => {
605970
605978
  };
605971
605979
 
605972
605980
  // packages/workspace-tools/src/base/base-executor.ts
605973
- var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
605981
+ var withRunExecutor = (name, executorFn, executorOptions = {}) => async (_options, context) => {
605974
605982
  const {
605975
605983
  getStopwatch: getStopwatch2,
605976
605984
  writeDebug: writeDebug2,
@@ -606198,7 +606206,6 @@ var import_generator = __toESM(require_generator());
606198
606206
 
606199
606207
  // packages/workspace-tools/src/utils/versions.ts
606200
606208
  var typesNodeVersion = "20.9.0";
606201
- var typescriptVersion = "~5.2.2";
606202
606209
  var nxVersion = "^18.0.4";
606203
606210
  var nodeVersion = "20.11.0";
606204
606211
  var pnpmVersion = "8.10.2";
@@ -618539,7 +618546,7 @@ async function presetGeneratorFn(tree, options) {
618539
618546
  ];
618540
618547
  json.homepage ??= "https://stormsoftware.com";
618541
618548
  json.bugs ??= {
618542
- url: "https://stormsoftware.com/support",
618549
+ url: `https://github.com/${options.organization}/${options.name}/issues`,
618543
618550
  email: "support@stormsoftware.com"
618544
618551
  };
618545
618552
  json.license = "Apache-2.0";
@@ -618548,17 +618555,49 @@ async function presetGeneratorFn(tree, options) {
618548
618555
  email: "contact@stormsoftware.com",
618549
618556
  url: "https://stormsoftware.com"
618550
618557
  };
618558
+ json.maintainers ??= [
618559
+ {
618560
+ "name": "Storm Software",
618561
+ "email": "contact@stormsoftware.com",
618562
+ "url": "https://stormsoftware.com"
618563
+ },
618564
+ {
618565
+ "name": "Pat Sullivan",
618566
+ "email": "pat@stormsoftware.com",
618567
+ "url": "https://patsullivan.org"
618568
+ }
618569
+ ];
618551
618570
  json.funding ??= {
618552
618571
  type: "github",
618553
618572
  url: "https://github.com/sponsors/storm-software"
618554
618573
  };
618555
618574
  json.namespace ??= `@${options.namespace}`;
618556
618575
  json.description ??= options.description;
618557
- options.repositoryUrl ??= `https://github.com/${options.organization}/${options.name}}`;
618576
+ options.repositoryUrl ??= `https://github.com/${options.organization}/${options.name}`;
618558
618577
  json.repository ??= {
618559
618578
  type: "github",
618560
618579
  url: `${options.repositoryUrl}.git`
618561
618580
  };
618581
+ json.packageManager ??= "pnpm@9.6.0";
618582
+ json.engines ??= {
618583
+ "node": ">=20.11.0",
618584
+ "pnpm": ">=9.6.0"
618585
+ };
618586
+ json.devEngines ??= {
618587
+ "node": "20.x || 21.x"
618588
+ };
618589
+ json.nx ??= {
618590
+ "includedScripts": [
618591
+ "lint-ls",
618592
+ "lint",
618593
+ "format",
618594
+ "format-readme",
618595
+ "format-prettier",
618596
+ "format-toml",
618597
+ "commit",
618598
+ "release"
618599
+ ]
618600
+ };
618562
618601
  json.scripts.adr = "pnpm log4brains adr new";
618563
618602
  json.scripts["adr-preview"] = "pnpm log4brains preview";
618564
618603
  json.scripts.prepare = "pnpm add lefthook -w && pnpm lefthook install";
@@ -618615,25 +618654,6 @@ async function presetGeneratorFn(tree, options) {
618615
618654
  node: `>=${nodeVersion}`,
618616
618655
  pnpm: `>=${pnpmVersion}`
618617
618656
  };
618618
- if (options.includeApps) {
618619
- json.bundlewatch = {
618620
- files: [
618621
- {
618622
- path: "dist/*/*.js",
618623
- maxSize: "200kB"
618624
- }
618625
- ],
618626
- ci: {
618627
- trackBranches: ["main", "alpha", "beta"]
618628
- }
618629
- };
618630
- json.nextBundleAnalysis = {
618631
- buildOutputDirectory: "dist/apps/web/app/.next"
618632
- };
618633
- }
618634
- json.nx = {
618635
- includedScripts: ["lint", "format"]
618636
- };
618637
618657
  return json;
618638
618658
  });
618639
618659
  (0, import_devkit10.generateFiles)(tree, path7.join(__dirname, "files"), projectRoot, {
@@ -618643,15 +618663,15 @@ async function presetGeneratorFn(tree, options) {
618643
618663
  });
618644
618664
  await (0, import_devkit10.formatFiles)(tree);
618645
618665
  let dependencies = {
618646
- "@commitlint/cli": "19.2.1",
618647
618666
  "@ls-lint/ls-lint": "2.2.3",
618648
618667
  "@ltd/j-toml": "1.38.0",
618649
- "@nx/devkit": "19.1.0",
618650
- "@nx/esbuild": "19.1.0",
618651
- "@nx/eslint": "19.1.0",
618652
- "@nx/js": "19.1.0",
618653
- "@nx/plugin": "19.1.0",
618654
- "@nx/workspace": "19.1.0",
618668
+ "@microsoft/tsdoc": "0.15.0",
618669
+ "@nx/devkit": "^19.5.3",
618670
+ "@nx/esbuild": "19.5.3",
618671
+ "@nx/eslint-plugin": ">=19.5.3",
618672
+ "@nx/js": "^19.5.3",
618673
+ "@nx/plugin": "19.5.3",
618674
+ "@nx/workspace": "^19.5.3",
618655
618675
  "@storm-software/config": "latest",
618656
618676
  "@storm-software/config-tools": "latest",
618657
618677
  "@storm-software/git-tools": "latest",
@@ -618661,44 +618681,35 @@ async function presetGeneratorFn(tree, options) {
618661
618681
  "@storm-software/eslint": "latest",
618662
618682
  "@storm-software/eslint-plugin": "latest",
618663
618683
  "@storm-software/prettier": "latest",
618664
- "@swc-node/register": "1.9.0",
618665
- "@swc/cli": "0.3.12",
618666
- "@swc/core": "1.4.12",
618667
- "@swc/helpers": "0.5.8",
618668
- "@swc/wasm": "1.4.12",
618669
618684
  "@taplo/cli": "0.7.0",
618670
618685
  "@types/jest": "29.5.12",
618671
- "@types/node": "20.12.5",
618672
- "conventional-changelog-conventionalcommits": "7.0.2",
618673
- "esbuild": "0.20.2",
618686
+ "@types/node": "^20.14.10",
618687
+ "conventional-changelog-conventionalcommits": "8.0.0",
618688
+ "copyfiles": "2.4.1",
618689
+ "esbuild": "0.21.5",
618674
618690
  "esbuild-register": "3.5.0",
618675
- "eslint": "^9.0.0",
618676
- "eslint-config-storm-software": "latest",
618677
- "eslint-plugin-import": "^2.29.1",
618678
- "eslint-plugin-jsx-a11y": "^6.8.0",
618679
- "eslint-plugin-react": "^7.34.1",
618680
- "eslint-plugin-react-hooks": "^4.6.0",
618691
+ "eslint": "9.5.0",
618681
618692
  "jest": "29.7.0",
618682
618693
  "jest-environment-jsdom": "29.7.0",
618683
618694
  "jest-environment-node": "29.7.0",
618684
- "lefthook": "1.6.8",
618685
- "nx": "19.1.0",
618686
- "prettier": "3.2.5",
618687
- "rimraf": "5.0.5",
618688
- "ts-jest": "29.1.2",
618695
+ "knip": "5.25.2",
618696
+ "lefthook": "1.6.18",
618697
+ "nx": "^19.5.3",
618698
+ "prettier": "3.3.2",
618699
+ "prettier-plugin-prisma": "5.0.0",
618700
+ "rimraf": "5.0.7",
618701
+ "sherif": "0.10.0",
618702
+ "ts-jest": "29.1.5",
618689
618703
  "ts-loader": "9.5.1",
618690
618704
  "ts-node": "10.9.2",
618691
618705
  "tsconfig-paths": "4.2.0",
618692
- "tslib": "2.6.2",
618693
- "typescript": typescriptVersion,
618694
- "verdaccio": "5.30.3",
618695
- "knip": "5.25.2",
618696
- "sherif": "0.10.0"
618706
+ "tslib": "2.6.3",
618707
+ "typescript": "5.5.3",
618708
+ "verdaccio": "5.31.1"
618697
618709
  };
618698
618710
  if (options.includeApps) {
618699
618711
  dependencies = {
618700
618712
  ...dependencies,
618701
- bundlewatch: "latest",
618702
618713
  react: "latest",
618703
618714
  "react-dom": "latest",
618704
618715
  storybook: "latest",