@dereekb/dbx-cli 14.0.0 → 14.1.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.
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli/route",
3
- "version": "14.0.0",
3
+ "version": "14.1.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
- "@dereekb/date": "14.0.0",
8
- "@dereekb/dbx-cli": "14.0.0",
9
- "@dereekb/firebase": "14.0.0",
10
- "@dereekb/model": "14.0.0",
11
- "@dereekb/nestjs": "14.0.0",
12
- "@dereekb/util": "14.0.0"
7
+ "@dereekb/date": "14.1.0",
8
+ "@dereekb/dbx-cli": "14.1.0",
9
+ "@dereekb/firebase": "14.1.0",
10
+ "@dereekb/model": "14.1.0",
11
+ "@dereekb/nestjs": "14.1.0",
12
+ "@dereekb/util": "14.1.0"
13
13
  },
14
14
  "exports": {
15
15
  "./package.json": "./package.json",
@@ -3,11 +3,12 @@
3
3
  *
4
4
  * Every generator ends the same way: group the runtime imports it needs by
5
5
  * package, render a banner + module source, format it with the workspace
6
- * prettier config so the output matches a `prettier --write` of the committed
6
+ * oxfmt config so the output matches an `oxfmt --write` of the committed
7
7
  * file, then skip the write when the bytes are unchanged so incremental builds
8
8
  * see a preserved mtime. That tail lives here once instead of being copied
9
9
  * into each `<generator>/src/emit.ts`.
10
10
  */
11
+ import { type FormatConfig } from 'oxfmt';
11
12
  /**
12
13
  * One named runtime import a generated module needs.
13
14
  */
@@ -53,12 +54,23 @@ export interface WriteGeneratedTsFileInput {
53
54
  */
54
55
  export declare function renderGroupedImportLines(imports: readonly GeneratedTsImport[]): string[];
55
56
  /**
56
- * Formats generated TypeScript source with the workspace prettier config
57
+ * Resolves the nearest `.oxfmtrc.json` by walking up from `fromFile`.
58
+ *
59
+ * oxfmt's programmatic `format` does not perform the config-file discovery the
60
+ * CLI does, so generators have to load the workspace config themselves for
61
+ * emitted bytes to match an `oxfmt --write` of the committed file.
62
+ *
63
+ * @param fromFile - Path to start the upward search from.
64
+ * @returns The parsed formatting options, or an empty object when no config file is found.
65
+ */
66
+ export declare function resolveOxfmtConfig(fromFile: string): FormatConfig;
67
+ /**
68
+ * Formats generated TypeScript source with the workspace oxfmt config
57
69
  * resolved for `outputFile`, so the emitted bytes match what
58
- * `prettier --write` would produce on the committed file.
70
+ * `oxfmt --write` would produce on the committed file.
59
71
  *
60
72
  * @param source - The unformatted module source.
61
- * @param outputFile - Path the source will be written to; selects the prettier config and parser.
73
+ * @param outputFile - Path the source will be written to; selects the oxfmt config and parser.
62
74
  * @returns The formatted source.
63
75
  */
64
76
  export declare function formatGeneratedTs(source: string, outputFile: string): Promise<string>;
package/test/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli/test",
3
- "version": "14.0.0",
3
+ "version": "14.1.0",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
- "@dereekb/date": "14.0.0",
7
- "@dereekb/dbx-cli": "14.0.0",
8
- "@dereekb/firebase": "14.0.0",
9
- "@dereekb/firebase-server/test": "14.0.0",
10
- "@dereekb/model": "14.0.0",
11
- "@dereekb/nestjs": "14.0.0",
12
- "@dereekb/rxjs": "14.0.0",
13
- "@dereekb/util": "14.0.0",
6
+ "@dereekb/date": "14.1.0",
7
+ "@dereekb/dbx-cli": "14.1.0",
8
+ "@dereekb/firebase": "14.1.0",
9
+ "@dereekb/firebase-server/test": "14.1.0",
10
+ "@dereekb/model": "14.1.0",
11
+ "@dereekb/nestjs": "14.1.0",
12
+ "@dereekb/rxjs": "14.1.0",
13
+ "@dereekb/util": "14.1.0",
14
14
  "@nestjs/common": "^12.0.1",
15
15
  "arktype": "^2.2.0",
16
16
  "vitest": "4.1.11",
package/validate/index.js CHANGED
@@ -3060,7 +3060,31 @@ function attachRemediation(code3) {
3060
3060
 
3061
3061
  // packages/dbx-cli/validate/src/lib/_core/rule-catalog/format.ts
3062
3062
  function formatRuleAsMarkdown(entry) {
3063
- const lines = [`# \`${entry.code}\``, "", `**${entry.title}**`, "", `- **Severity:** \`${entry.severity}\``, `- **Source tool:** \`${entry.source}\``, "", "## What it flags", "", entry.whatItFlags, "", "## When it applies", "", entry.whenItApplies, "", "## When it does NOT apply", "", entry.whenItDoesNotApply, "", "## Canonical fix", "", entry.canonicalFix, ""];
3063
+ const lines = [
3064
+ `# \`${entry.code}\``,
3065
+ "",
3066
+ `**${entry.title}**`,
3067
+ "",
3068
+ `- **Severity:** \`${entry.severity}\``,
3069
+ `- **Source tool:** \`${entry.source}\``,
3070
+ "",
3071
+ "## What it flags",
3072
+ "",
3073
+ entry.whatItFlags,
3074
+ "",
3075
+ "## When it applies",
3076
+ "",
3077
+ entry.whenItApplies,
3078
+ "",
3079
+ "## When it does NOT apply",
3080
+ "",
3081
+ entry.whenItDoesNotApply,
3082
+ "",
3083
+ "## Canonical fix",
3084
+ "",
3085
+ entry.canonicalFix,
3086
+ ""
3087
+ ];
3064
3088
  if (entry.canonicalFixTemplate) {
3065
3089
  lines.push("## Fix template", "", entry.canonicalFixTemplate, "");
3066
3090
  }
@@ -12873,7 +12897,45 @@ import { readdir as readdir8, readFile as readFile11, stat as stat10 } from "nod
12873
12897
  import { basename as basename5, dirname as dirname2, join as join10, relative as relative6, resolve as resolve3 } from "node:path";
12874
12898
 
12875
12899
  // packages/dbx-cli/validate/src/lib/workspace-validate/references.ts
12876
- var NX_SUBCOMMANDS = /* @__PURE__ */ new Set(["run", "run-many", "affected", "affected:graph", "affected:test", "affected:build", "graph", "dep-graph", "print-affected", "show", "list", "report", "migrate", "reset", "repair", "generate", "g", "add", "init", "import", "sync", "release", "format", "format:check", "format:write", "daemon", "connect", "login", "logout", "view-logs", "exec", "watch", "documentation", "help", "register", "record", "start-ci-run"]);
12900
+ var NX_SUBCOMMANDS = /* @__PURE__ */ new Set([
12901
+ "run",
12902
+ "run-many",
12903
+ "affected",
12904
+ "affected:graph",
12905
+ "affected:test",
12906
+ "affected:build",
12907
+ "graph",
12908
+ "dep-graph",
12909
+ "print-affected",
12910
+ "show",
12911
+ "list",
12912
+ "report",
12913
+ "migrate",
12914
+ "reset",
12915
+ "repair",
12916
+ "generate",
12917
+ "g",
12918
+ "add",
12919
+ "init",
12920
+ "import",
12921
+ "sync",
12922
+ "release",
12923
+ "format",
12924
+ "format:check",
12925
+ "format:write",
12926
+ "daemon",
12927
+ "connect",
12928
+ "login",
12929
+ "logout",
12930
+ "view-logs",
12931
+ "exec",
12932
+ "watch",
12933
+ "documentation",
12934
+ "help",
12935
+ "register",
12936
+ "record",
12937
+ "start-ci-run"
12938
+ ]);
12877
12939
  var INTERPOLATION_PATTERN = /[$`{}()*?]|\\\\/;
12878
12940
  var TOKEN_LEADING_CHARS = `"'`;
12879
12941
  var TOKEN_TRAILING_CHARS = `"',;`;
@@ -15324,7 +15386,18 @@ function formatReportAsJson4(report) {
15324
15386
  // packages/dbx-cli/validate/src/lib/dbx-asset-list-app/format.markdown.ts
15325
15387
  function formatReportAsMarkdown4(report) {
15326
15388
  const basename7 = report.componentDir.split("/").pop() ?? report.componentDir;
15327
- const lines = [`# App assets \u2014 ${basename7}`, "", `Component: \`${report.componentDir}\``, `App: \`${report.apiDir}\``, "", `\`src/lib/assets.ts\`: ${formatBool(report.assetsFileExists)}`, `Barrel re-exports \`./assets\`: ${formatBool(report.barrelReExportsAssets)}`, `\`provideDbxAssetLoader()\` called in \`src/root.app.config.ts\`: ${formatBool(report.providerWiredInApp)}`, "", `## Assets (${report.assets.length})`];
15389
+ const lines = [
15390
+ `# App assets \u2014 ${basename7}`,
15391
+ "",
15392
+ `Component: \`${report.componentDir}\``,
15393
+ `App: \`${report.apiDir}\``,
15394
+ "",
15395
+ `\`src/lib/assets.ts\`: ${formatBool(report.assetsFileExists)}`,
15396
+ `Barrel re-exports \`./assets\`: ${formatBool(report.barrelReExportsAssets)}`,
15397
+ `\`provideDbxAssetLoader()\` called in \`src/root.app.config.ts\`: ${formatBool(report.providerWiredInApp)}`,
15398
+ "",
15399
+ `## Assets (${report.assets.length})`
15400
+ ];
15328
15401
  if (report.assets.length === 0) {
15329
15402
  lines.push("", "_None found._");
15330
15403
  } else {
@@ -15715,7 +15788,18 @@ function formatReportAsJson6(report) {
15715
15788
  function formatReportAsMarkdown6(report) {
15716
15789
  const basename7 = report.componentDir.split("/").pop() ?? report.componentDir;
15717
15790
  const uploadServiceFactoryText = report.uploadServiceFactoryName ? code2(report.uploadServiceFactoryName) : "_Not defined._";
15718
- const lines = [`# App storagefiles \u2014 ${basename7}`, "", `Component: \`${report.componentDir}\``, `API: \`${report.apiDir}\``, "", `Upload service factory: ${uploadServiceFactoryText}`, `Wired via \`StorageFileInitializeFromUploadService\` provider: ${formatBool3(report.uploadServiceWiredInApi)}`, `Processing handler call present: ${formatBool3(report.processingHandlerWiredInApi)}`, "", `## Purposes (${report.purposes.length})`];
15791
+ const lines = [
15792
+ `# App storagefiles \u2014 ${basename7}`,
15793
+ "",
15794
+ `Component: \`${report.componentDir}\``,
15795
+ `API: \`${report.apiDir}\``,
15796
+ "",
15797
+ `Upload service factory: ${uploadServiceFactoryText}`,
15798
+ `Wired via \`StorageFileInitializeFromUploadService\` provider: ${formatBool3(report.uploadServiceWiredInApi)}`,
15799
+ `Processing handler call present: ${formatBool3(report.processingHandlerWiredInApi)}`,
15800
+ "",
15801
+ `## Purposes (${report.purposes.length})`
15802
+ ];
15719
15803
  if (report.purposes.length === 0) {
15720
15804
  lines.push("", "_None found._");
15721
15805
  } else {
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli/validate",
3
- "version": "14.0.0",
3
+ "version": "14.1.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
- "@dereekb/dbx-cli": "14.0.0",
8
- "@dereekb/util": "14.0.0",
7
+ "@dereekb/dbx-cli": "14.1.0",
8
+ "@dereekb/util": "14.1.0",
9
9
  "ts-morph": "^28.0.0"
10
10
  }
11
11
  }