@memberjunction/cli 4.4.0 → 5.0.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.
Files changed (44) hide show
  1. package/README.md +130 -0
  2. package/bin/dev.cmd +2 -2
  3. package/bin/run.cmd +3 -3
  4. package/dist/commands/clean/index.d.ts +0 -2
  5. package/dist/commands/clean/index.d.ts.map +1 -1
  6. package/dist/commands/clean/index.js +31 -19
  7. package/dist/commands/clean/index.js.map +1 -1
  8. package/dist/commands/codegen/5-0-fix-entity-names.d.ts +17 -0
  9. package/dist/commands/codegen/5-0-fix-entity-names.d.ts.map +1 -0
  10. package/dist/commands/codegen/5-0-fix-entity-names.js +104 -0
  11. package/dist/commands/codegen/5-0-fix-entity-names.js.map +1 -0
  12. package/dist/commands/codegen/5-0-fix-html-entity-names.d.ts +17 -0
  13. package/dist/commands/codegen/5-0-fix-html-entity-names.d.ts.map +1 -0
  14. package/dist/commands/codegen/5-0-fix-html-entity-names.js +92 -0
  15. package/dist/commands/codegen/5-0-fix-html-entity-names.js.map +1 -0
  16. package/dist/commands/codegen/5-0-fix-metadata-names.d.ts +17 -0
  17. package/dist/commands/codegen/5-0-fix-metadata-names.d.ts.map +1 -0
  18. package/dist/commands/codegen/5-0-fix-metadata-names.js +93 -0
  19. package/dist/commands/codegen/5-0-fix-metadata-names.js.map +1 -0
  20. package/dist/commands/codegen/index.d.ts +4 -1
  21. package/dist/commands/codegen/index.d.ts.map +1 -1
  22. package/dist/commands/codegen/index.js +30 -5
  23. package/dist/commands/codegen/index.js.map +1 -1
  24. package/dist/commands/codegen/manifest.d.ts +4 -1
  25. package/dist/commands/codegen/manifest.d.ts.map +1 -1
  26. package/dist/commands/codegen/manifest.js +34 -11
  27. package/dist/commands/codegen/manifest.js.map +1 -1
  28. package/dist/commands/migrate/index.d.ts +5 -1
  29. package/dist/commands/migrate/index.d.ts.map +1 -1
  30. package/dist/commands/migrate/index.js +102 -229
  31. package/dist/commands/migrate/index.js.map +1 -1
  32. package/dist/commands/sync/init.js +1 -1
  33. package/dist/commands/sync/init.js.map +1 -1
  34. package/dist/commands/sync/pull.js +4 -4
  35. package/dist/commands/sync/pull.js.map +1 -1
  36. package/dist/config.d.ts +15 -4
  37. package/dist/config.d.ts.map +1 -1
  38. package/dist/config.js +50 -48
  39. package/dist/config.js.map +1 -1
  40. package/dist/light-commands.d.ts +1 -1
  41. package/dist/light-commands.js +2 -2
  42. package/dist/light-commands.js.map +1 -1
  43. package/oclif.manifest.json +425 -181
  44. package/package.json +12 -12
@@ -2,7 +2,10 @@ import { Command } from '@oclif/core';
2
2
  import type { ParserOutput } from '@oclif/core/lib/interfaces/parser';
3
3
  export default class CodeGen extends Command {
4
4
  static description: string;
5
- static examples: string[];
5
+ static examples: {
6
+ command: string;
7
+ description: string;
8
+ }[];
6
9
  static flags: {
7
10
  skipdb: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAAyE;IAE3F,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;MAEV;IAEF,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IAEhC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAiBA;IAElB,MAAM,CAAC,QAAQ;;;QASb;IAEF,MAAM,CAAC,KAAK;;MAIV;IAEF,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IAEhC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB3B"}
@@ -1,13 +1,38 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
2
  import { updatedConfig } from '../../config.js';
3
3
  export default class CodeGen extends Command {
4
- static { this.description = 'Run CodeGen to generate code and update metadata for MemberJunction'; }
4
+ static { this.description = `Run the full MemberJunction code generation pipeline.
5
+
6
+ Analyzes your SQL Server database schema, updates MemberJunction metadata, and
7
+ generates synchronized code across the entire stack:
8
+
9
+ - SQL views, stored procedures, indexes, and permissions
10
+ - TypeScript entity classes with Zod validation schemas
11
+ - Angular form components with AI-driven layouts
12
+ - GraphQL resolvers and type definitions
13
+ - Action subclasses and DB schema JSON
14
+
15
+ Configuration is loaded from mj.config.cjs in the current directory (or parent
16
+ directories). Database connection can also be set via environment variables:
17
+ DB_HOST, DB_DATABASE, CODEGEN_DB_USERNAME, CODEGEN_DB_PASSWORD.
18
+
19
+ Use --skipdb to skip all database operations (metadata sync, SQL object
20
+ generation) and only regenerate TypeScript, Angular, and GraphQL output from
21
+ existing metadata.`; }
5
22
  static { this.examples = [
6
- `<%= config.bin %> <%= command.id %>
7
- `,
23
+ {
24
+ command: '<%= config.bin %> <%= command.id %>',
25
+ description: 'Run the full code generation pipeline',
26
+ },
27
+ {
28
+ command: '<%= config.bin %> <%= command.id %> --skipdb',
29
+ description: 'Regenerate code files without touching the database',
30
+ },
8
31
  ]; }
9
32
  static { this.flags = {
10
- skipdb: Flags.boolean({ description: 'Skip database migration' }),
33
+ skipdb: Flags.boolean({
34
+ description: 'Skip database operations (metadata sync, SQL generation). Only regenerate TypeScript entities, Angular components, and GraphQL resolvers from existing metadata.',
35
+ }),
11
36
  }; }
12
37
  async run() {
13
38
  const { runMemberJunctionCodeGeneration, initializeConfig } = await import('@memberjunction/codegen-lib');
@@ -15,7 +40,7 @@ export default class CodeGen extends Command {
15
40
  this.flags = parsed.flags;
16
41
  const config = updatedConfig();
17
42
  if (!config) {
18
- this.error('No configuration found');
43
+ this.error('No configuration found. Ensure mj.config.cjs exists in the current directory or a parent directory.');
19
44
  }
20
45
  // Initialize configuration
21
46
  initializeConfig(process.cwd());
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;aACnC,gBAAW,GAAG,qEAAqE,CAAC;aAEpF,aAAQ,GAAG;QAChB;CACH;KACE,CAAC;aAEK,UAAK,GAAG;QACb,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;KAClE,CAAC;IAIF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QAE1G,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;QAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACvC,CAAC;QAED,2BAA2B;QAC3B,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAEhC,iDAAiD;QACjD,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/codegen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;aACnC,gBAAW,GAAG;;;;;;;;;;;;;;;;;mBAiBJ,CAAC;aAEX,aAAQ,GAAG;QAChB;YACE,OAAO,EAAE,qCAAqC;YAC9C,WAAW,EAAE,uCAAuC;SACrD;QACD;YACE,OAAO,EAAE,8CAA8C;YACvD,WAAW,EAAE,qDAAqD;SACnE;KACF,CAAC;aAEK,UAAK,GAAG;QACb,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC;YACpB,WAAW,EAAE,kKAAkK;SAChL,CAAC;KACH,CAAC;IAIF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QAE1G,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;QAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,qGAAqG,CAAC,CAAC;QACpH,CAAC;QAED,2BAA2B;QAC3B,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAEhC,iDAAiD;QACjD,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import { Command } from '@oclif/core';
2
2
  export default class CodeGenManifest extends Command {
3
3
  static description: string;
4
- static examples: string[];
4
+ static examples: {
5
+ command: string;
6
+ description: string;
7
+ }[];
5
8
  static flags: {
6
9
  output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
10
  appDir: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAChD,MAAM,CAAC,WAAW,SAAyG;IAE3H,MAAM,CAAC,QAAQ,WAKb;IAEF,MAAM,CAAC,KAAK;;;;;;;MA8BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0B7B"}
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAChD,MAAM,CAAC,WAAW,SAWwD;IAE1E,MAAM,CAAC,QAAQ;;;QAiBb;IAEF,MAAM,CAAC,KAAK;;;;;;;MA8BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0B7B"}
@@ -1,40 +1,63 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
2
  export default class CodeGenManifest extends Command {
3
- static { this.description = 'Generate a class registrations manifest to prevent tree-shaking of @RegisterClass decorated classes'; }
3
+ static { this.description = `Generate a class registration manifest to prevent tree-shaking.
4
+
5
+ MemberJunction uses @RegisterClass decorators with a dynamic class factory.
6
+ Modern bundlers (ESBuild, Vite) cannot detect dynamic instantiation and will
7
+ tree-shake these classes out of production builds. This command scans the
8
+ dependency tree for all @RegisterClass-decorated classes and emits a manifest
9
+ file with static imports that the bundler cannot eliminate.
10
+
11
+ Typically used as a prebuild/prestart script for MJAPI and MJExplorer. For
12
+ MJ distribution users, pre-built manifests ship inside @memberjunction/server-bootstrap
13
+ and @memberjunction/ng-bootstrap -- use --exclude-packages @memberjunction to
14
+ generate a supplemental manifest covering only your own application classes.`; }
4
15
  static { this.examples = [
5
- `<%= config.bin %> <%= command.id %> --output ./src/generated/class-registrations-manifest.ts`,
6
- `<%= config.bin %> <%= command.id %> --appDir ./packages/MJAPI --output ./packages/MJAPI/src/generated/class-registrations-manifest.ts`,
7
- `<%= config.bin %> <%= command.id %> --filter BaseEngine --filter BaseAction`,
8
- `<%= config.bin %> <%= command.id %> --verbose`,
16
+ {
17
+ command: '<%= config.bin %> <%= command.id %>',
18
+ description: 'Generate manifest with default output path',
19
+ },
20
+ {
21
+ command: '<%= config.bin %> <%= command.id %> --appDir ./packages/MJAPI --output ./packages/MJAPI/src/generated/class-registrations-manifest.ts',
22
+ description: 'Generate manifest for a specific application directory',
23
+ },
24
+ {
25
+ command: '<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction',
26
+ description: 'Exclude MJ packages (use pre-built bootstrap manifests instead)',
27
+ },
28
+ {
29
+ command: '<%= config.bin %> <%= command.id %> --filter BaseEngine --filter BaseAction --verbose',
30
+ description: 'Only include specific base classes with detailed progress',
31
+ },
9
32
  ]; }
10
33
  static { this.flags = {
11
34
  output: Flags.string({
12
35
  char: 'o',
13
- description: 'Output manifest file path',
36
+ description: 'Output file path for the generated manifest. The file will contain named imports and a CLASS_REGISTRATIONS array.',
14
37
  default: './src/generated/class-registrations-manifest.ts',
15
38
  }),
16
39
  appDir: Flags.string({
17
40
  char: 'a',
18
- description: 'App directory containing package.json (defaults to current directory)',
41
+ description: 'Root directory of the application whose package.json dependency tree will be scanned. Defaults to the current working directory.',
19
42
  }),
20
43
  filter: Flags.string({
21
44
  char: 'f',
22
- description: 'Only include classes with this base class (can be repeated)',
45
+ description: 'Only include classes extending this base class. Can be repeated (e.g., --filter BaseEngine --filter BaseAction).',
23
46
  multiple: true,
24
47
  }),
25
48
  'exclude-packages': Flags.string({
26
49
  char: 'e',
27
- description: 'Exclude packages matching this prefix from scanning (can be repeated). Example: --exclude-packages @memberjunction',
50
+ description: 'Skip packages whose name starts with this prefix. Useful for excluding @memberjunction packages when using pre-built bootstrap manifests. Can be repeated.',
28
51
  multiple: true,
29
52
  }),
30
53
  quiet: Flags.boolean({
31
54
  char: 'q',
32
- description: 'Suppress all output',
55
+ description: 'Suppress all output except errors.',
33
56
  default: false,
34
57
  }),
35
58
  verbose: Flags.boolean({
36
59
  char: 'v',
37
- description: 'Show detailed progress including skipped classes and per-package info',
60
+ description: 'Show detailed progress including per-package scanning info and skipped classes.',
38
61
  default: false,
39
62
  }),
40
63
  }; }
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/commands/codegen/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;aACzC,gBAAW,GAAG,qGAAqG,CAAC;aAEpH,aAAQ,GAAG;QACd,8FAA8F;QAC9F,uIAAuI;QACvI,6EAA6E;QAC7E,+CAA+C;KAClD,CAAC;aAEK,UAAK,GAAG;QACX,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,2BAA2B;YACxC,OAAO,EAAE,iDAAiD;SAC7D,CAAC;QACF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,uEAAuE;SACvF,CAAC;QACF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,kBAAkB,EAA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C,CAAC,CAAC,SAAS;SAC/F,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,CAAC,gCAAgC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChG,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,6BAA6B,MAAM,CAAC,OAAO,CAAC,MAAM,iBAAiB,MAAM,CAAC,QAAQ,CAAC,MAAM,cAAc,MAAM,CAAC,eAAe,eAAe,CAAC,CAAC;YAC3J,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,GAAG,CAAC,yCAAyC,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY,CAAC,CAAC;YAC5H,CAAC;QACL,CAAC;IACL,CAAC"}
@@ -9,6 +9,10 @@ export default class Migrate extends Command {
9
9
  dir: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  };
11
11
  run(): Promise<void>;
12
- private analyzeFlywayError;
12
+ /**
13
+ * Prints error details captured by OnProgress callbacks.
14
+ * Used when Skyway's result.Details is empty (transaction-level errors).
15
+ */
16
+ private printCallbackErrors;
13
17
  }
14
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAQ7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAAuD;IAEzE,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAwJ1B,OAAO,CAAC,kBAAkB;CAkH3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAM7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAAuD;IAEzE,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAoG1B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CAmC5B"}
@@ -1,10 +1,7 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { Flyway } from 'node-flyway';
2
+ import { Skyway } from '@memberjunction/skyway-core';
3
3
  import ora from 'ora-classic';
4
- import { spawnSync } from 'child_process';
5
- import path from 'path';
6
- import os from 'os';
7
- import { getValidatedConfig, getFlywayConfig } from '../../config.js';
4
+ import { getValidatedConfig, getSkywayConfig } from '../../config.js';
8
5
  export default class Migrate extends Command {
9
6
  static { this.description = 'Migrate MemberJunction database to latest version'; }
10
7
  static { this.examples = [
@@ -25,253 +22,129 @@ export default class Migrate extends Command {
25
22
  const { flags } = await this.parse(Migrate);
26
23
  const config = getValidatedConfig();
27
24
  const targetSchema = flags.schema || config.coreSchema;
28
- const flywayConfig = await getFlywayConfig(config, flags.tag, flags.schema, flags.dir);
29
- const flyway = new Flyway(flywayConfig);
25
+ const skywayConfig = await getSkywayConfig(config, flags.tag, flags.schema, flags.dir);
26
+ const skyway = new Skyway(skywayConfig);
27
+ // Always capture progress for error diagnostics; verbose mode prints it live
28
+ const errorLog = [];
29
+ const failedMigrations = [];
30
+ let lastMigrationStarted;
31
+ skyway.OnProgress({
32
+ OnLog: (msg) => {
33
+ errorLog.push(msg);
34
+ if (flags.verbose)
35
+ this.log(` ${msg}`);
36
+ },
37
+ OnMigrationStart: (m) => {
38
+ lastMigrationStarted = m;
39
+ if (flags.verbose)
40
+ this.log(` Applying: ${m.Version ?? '(repeatable)'} — ${m.Description}`);
41
+ },
42
+ OnMigrationEnd: (r) => {
43
+ if (!r.Success)
44
+ failedMigrations.push(r);
45
+ if (flags.verbose)
46
+ this.log(` ${r.Success ? 'OK' : 'FAIL'}: ${r.Migration.Description} (${r.ExecutionTimeMS}ms)`);
47
+ },
48
+ });
30
49
  if (flags.verbose) {
31
- this.log(`Connecting to ${flywayConfig.url}`);
32
- this.log(`Database Connection: ${config.dbHost}, ${config.dbDatabase}, User: ${flywayConfig.user}`);
33
- this.log(`Migrating ${targetSchema} schema using migrations from:\n\t- ${flywayConfig.migrationLocations.join('\n\t- ')}\n`);
34
- this.log(`Flyway config settings: baselineVersion: ${config.baselineVersion}, baselineMigrate: ${config.baselineOnMigrate}\n`);
50
+ this.log(`Database Connection: ${config.dbHost}:${config.dbPort}, ${config.dbDatabase}, User: ${config.codeGenLogin}`);
51
+ this.log(`Migrating ${targetSchema} schema using migrations from:\n\t- ${skywayConfig.Migrations.Locations.join('\n\t- ')}\n`);
52
+ this.log(`Skyway config: baselineVersion: ${config.baselineVersion ?? '(auto-detect)'}, baselineOnMigrate: ${config.baselineOnMigrate}\n`);
35
53
  }
36
54
  if (flags.tag) {
37
55
  this.log(`Migrating to ${flags.tag}`);
38
56
  }
39
57
  const spinner = ora('Running migrations...');
40
58
  spinner.start();
41
- const result = await flyway.migrate();
42
- const isParseError = result.error?.errorCode === 'UNABLE_TO_PARSE_RESPONSE';
43
- if (result.success) {
59
+ let result;
60
+ try {
61
+ result = await skyway.Migrate();
62
+ }
63
+ catch (err) {
64
+ spinner.fail();
65
+ const message = err instanceof Error ? err.message : String(err);
66
+ this.logToStderr(`\nMigration error: ${message}\n`);
67
+ this.printCallbackErrors(failedMigrations, lastMigrationStarted, errorLog);
68
+ this.error('Migrations failed');
69
+ }
70
+ finally {
71
+ await skyway.Close();
72
+ }
73
+ if (result.Success) {
44
74
  spinner.succeed();
45
- this.log(`Migrations complete in ${result.additionalDetails.executionTime / 1000}s`);
46
- if (result.flywayResponse?.success && flags.verbose) {
47
- this.log(`\tUpdated to ${result.flywayResponse?.targetSchemaVersion}`);
75
+ this.log(`Migrations complete in ${(result.TotalExecutionTimeMS / 1000).toFixed(1)}s — ${result.MigrationsApplied} applied`);
76
+ if (result.CurrentVersion && flags.verbose) {
77
+ this.log(`\tCurrent version: ${result.CurrentVersion}`);
48
78
  }
49
- }
50
- else if (isParseError) {
51
- // Parse error - could be SQL error or connection issue, or just a node-flyway bug
52
- // Run Flyway CLI directly to determine if migration actually succeeded
53
- spinner.text = 'Verifying migration status...';
54
- try {
55
- // Construct Flyway executable path
56
- const flywayDir = result.additionalDetails.flywayCli.location;
57
- const flywayExeName = os.platform() === 'win32' ? 'flyway.cmd' : 'flyway';
58
- const flywayExePath = path.join(flywayDir, flywayExeName);
59
- // Use spawnSync to avoid shell interpretation of special characters in password
60
- const jdbcUrl = `jdbc:sqlserver://${config.dbHost}:${config.dbPort};databaseName=${config.dbDatabase};trustServerCertificate=${config.dbTrustServerCertificate}`;
61
- // Build common args - use targetSchema instead of coreSchema
62
- // This ensures diagnostic validates the schema being migrated, not the core MJ schema
63
- const baseArgs = [
64
- `-url=${jdbcUrl}`,
65
- `-user=${config.codeGenLogin}`,
66
- `-password=${config.codeGenPassword}`,
67
- `-schemas=${targetSchema}`
68
- ];
69
- // Add placeholder arguments from config
70
- // Read directly from config.SQLOutput.schemaPlaceholders since node-flyway doesn't use them
71
- const schemaPlaceholders = config.SQLOutput?.schemaPlaceholders;
72
- if (schemaPlaceholders && schemaPlaceholders.length > 0) {
73
- schemaPlaceholders.forEach(({ schema, placeholder }) => {
74
- const cleanPlaceholder = placeholder.replace(/^\$\{|\}$/g, '');
75
- // Skip Flyway built-in placeholders
76
- if (cleanPlaceholder.startsWith('flyway:'))
77
- return;
78
- // Flyway CLI format: -placeholders.PLACEHOLDER_NAME=value
79
- baseArgs.push(`-placeholders.${cleanPlaceholder}=${schema}`);
80
- });
81
- }
82
- // Convert relative migration paths to absolute paths
83
- const absoluteMigrationPaths = flywayConfig.migrationLocations.map((loc) => {
84
- // Remove 'filesystem:' prefix if present
85
- const cleanLoc = loc.replace(/^filesystem:/, '');
86
- // Convert to absolute path if relative
87
- return path.isAbsolute(cleanLoc) ? loc : `filesystem:${path.resolve(cleanLoc)}`;
88
- });
89
- // Skip validation and go straight to migrate
90
- // node-flyway already tried and failed, so we just need to run the actual migration
91
- const migrateArgs = [
92
- ...baseArgs,
93
- `-baselineVersion=${config.baselineVersion}`,
94
- `-baselineOnMigrate=${config.baselineOnMigrate}`,
95
- `-createSchemas=true`,
96
- `-locations=${absoluteMigrationPaths.join(',')}`,
97
- 'migrate'
98
- ];
99
- const migrateResult = spawnSync(flywayExePath, migrateArgs, { encoding: 'utf8' });
100
- const migrateOutput = migrateResult.stderr || migrateResult.stdout || '';
101
- // DEBUG: Show raw output to diagnose false positives
102
- if (flags.verbose) {
103
- this.log('\n--- DEBUG: Raw Flyway Output ---');
104
- this.log(migrateOutput);
105
- this.log('--- END DEBUG ---\n');
106
- }
107
- // Check if output contains error messages even if exit code is 0
108
- // But trust success indicators - Flyway explicitly says "Successfully applied" when it works
109
- const hasSuccessIndicator = migrateOutput.includes('Successfully applied') ||
110
- migrateOutput.includes('is up to date') ||
111
- migrateOutput.includes('Schema creation not necessary');
112
- // Only flag errors if there's no success indicator AND error patterns exist
113
- // Exclude SQL Server informational messages and recompilation warnings
114
- const hasErrorsInOutput = !hasSuccessIndicator && ((migrateOutput.toLowerCase().includes('error') &&
115
- !migrateOutput.includes('Error Code: 0') && // Informational messages
116
- !migrateOutput.includes('Error Code: 15070') && // Recompilation warnings
117
- !migrateOutput.includes('Error Code: 1945')) || // Index key length warnings
118
- migrateOutput.toLowerCase().includes('incorrect syntax') ||
119
- migrateOutput.toLowerCase().includes('must be the only statement'));
120
- if (migrateResult.status === 0 && !hasErrorsInOutput) {
121
- // Migration actually succeeded - don't throw error
122
- spinner.succeed('Migrations complete');
123
- this.log(`Execution time: ${result.additionalDetails.executionTime / 1000}s`);
124
- if (flags.verbose) {
125
- this.logToStderr('\n💡 Note: Migration succeeded but node-flyway had trouble parsing the response.');
126
- this.logToStderr(' This is a known issue with node-flyway and does not affect migration success.\n');
127
- }
128
- return;
79
+ if (flags.verbose && result.Details.length > 0) {
80
+ for (const detail of result.Details) {
81
+ this.log(`\t${detail.Migration.Version ?? '(R)'} ${detail.Migration.Description} ${detail.ExecutionTimeMS}ms`);
129
82
  }
130
- else if (migrateResult.status === 0 && hasErrorsInOutput) {
131
- // Exit code was 0 but output contains errors - SQL script likely has error handling
132
- spinner.fail();
133
- this.logToStderr('\n⚠️ Migration completed but errors were detected in output:\n');
134
- this.analyzeFlywayError(migrateOutput, config);
135
- }
136
- else {
137
- // Migration failed with non-zero exit code
138
- spinner.fail();
139
- this.logToStderr('\n❌ Migration failed:\n');
140
- this.analyzeFlywayError(migrateOutput, config);
141
- }
142
- }
143
- catch (err) {
144
- spinner.fail();
145
- this.logToStderr(`\n❌ Error running diagnostic: ${err.message || err}\n`);
146
83
  }
147
- this.error('Migration failed - see diagnostic information above');
148
84
  }
149
85
  else {
150
86
  spinner.fail();
151
- if (result.error) {
152
- this.logToStderr(result.error.message);
153
- if (flags.verbose) {
154
- this.logToStderr(`ERROR CODE: ${result.error.errorCode}`);
155
- this.logToStderr(result.error.stackTrace);
87
+ this.logToStderr(`\nMigration failed: ${result.ErrorMessage ?? 'unknown error'}\n`);
88
+ if (result.Details.length > 0) {
89
+ // We have per-migration details — show them
90
+ const succeeded = result.Details.filter(d => d.Success);
91
+ if (succeeded.length > 0) {
92
+ this.logToStderr(` Applied ${succeeded.length} migration(s) before failure:`);
93
+ for (const detail of succeeded) {
94
+ this.logToStderr(` OK: ${detail.Migration.Filename} (${detail.ExecutionTimeMS}ms)`);
95
+ }
96
+ this.logToStderr('');
97
+ }
98
+ const failed = result.Details.filter(d => !d.Success);
99
+ for (const detail of failed) {
100
+ this.logToStderr(` FAILED: ${detail.Migration.Filename}`);
101
+ this.logToStderr(` Script: ${detail.Migration.FilePath}`);
102
+ this.logToStderr(` Version: ${detail.Migration.Version ?? '(repeatable)'}`);
103
+ this.logToStderr(` Description: ${detail.Migration.Description}`);
104
+ if (detail.Error) {
105
+ this.logToStderr(` Error: ${detail.Error.message}`);
106
+ }
156
107
  }
157
108
  }
109
+ else {
110
+ // Details is empty — error was caught at the transaction/connection level.
111
+ // Fall back to errors captured by OnProgress callbacks.
112
+ this.printCallbackErrors(failedMigrations, lastMigrationStarted, errorLog);
113
+ }
158
114
  this.error('Migrations failed');
159
115
  }
160
116
  }
161
- analyzeFlywayError(errorOutput, config) {
162
- const errorLines = errorOutput.split('\n');
163
- const fullError = errorOutput.toLowerCase();
164
- // Find error details
165
- const errorCodeLine = errorLines.find(line => line.includes('Error Code')) || '';
166
- const messageLine = errorLines.find(line => line.includes('Message')) || '';
167
- const errorLine = errorLines.find(line => line.includes('ERROR:') && !line.includes('Skipping filesystem location')) || '';
168
- // Determine error type
169
- const isValidationError = fullError.includes('validate failed') ||
170
- fullError.includes('checksum mismatch') ||
171
- fullError.includes('migrations have failed validation');
172
- const isSqlError = fullError.includes('incorrect syntax') ||
173
- fullError.includes('must be the only statement in the batch') ||
174
- fullError.includes('invalid object name') ||
175
- fullError.includes('permission denied') ||
176
- (fullError.includes('error') && fullError.includes('line'));
177
- const isConnectionError = fullError.includes('login failed') ||
178
- fullError.includes('unable to obtain connection') ||
179
- fullError.includes('connection refused') ||
180
- fullError.includes('connection timed out') ||
181
- fullError.includes('unable to connect');
182
- // Display error header
183
- if (isValidationError) {
184
- this.logToStderr('❌ Validation Failed - Checksum Mismatch Detected\n');
185
- }
186
- else if (isSqlError) {
187
- this.logToStderr('❌ SQL Migration Error Detected\n');
188
- }
189
- else if (isConnectionError) {
190
- this.logToStderr('❌ Database Connection Failed\n');
191
- }
192
- else {
193
- this.logToStderr('❌ Migration Failed\n');
194
- }
195
- // Display error details
196
- if (isValidationError) {
197
- // For validation errors, show the COMPLETE raw Flyway output
198
- // This includes all checksum details which are critical for debugging
199
- this.logToStderr('\n📋 Full Flyway Validation Output:');
200
- this.logToStderr('='.repeat(100));
201
- this.logToStderr(errorOutput);
202
- this.logToStderr('='.repeat(100));
203
- this.logToStderr('');
204
- }
205
- else if (errorCodeLine && messageLine) {
206
- this.logToStderr(` ${errorCodeLine.trim()}`);
207
- this.logToStderr(` ${messageLine.trim()}\n`);
208
- }
209
- else if (errorLine) {
210
- const cleanError = errorLine.replace(/^ERROR:\s*/, '').trim();
211
- this.logToStderr(` Error: ${cleanError}\n`);
212
- }
213
- else if (errorOutput) {
214
- if (false) { // Disabled - keeping structure for non-validation errors
215
- // Show lines containing error-related keywords
216
- const errorKeywords = ['error', 'incorrect', 'syntax', 'invalid', 'failed', 'must be', 'cannot', 'line'];
217
- const relevantLines = errorOutput.split('\n')
218
- .filter(line => {
219
- const lower = line.toLowerCase();
220
- return line.trim() &&
221
- !lower.includes('flyway community') &&
222
- !lower.includes('skipping filesystem location') &&
223
- errorKeywords.some(keyword => lower.includes(keyword));
224
- })
225
- .slice(0, 15);
226
- if (relevantLines.length > 0) {
227
- this.logToStderr(' Error details from Flyway output:');
228
- relevantLines.forEach(line => this.logToStderr(` ${line.trim()}`));
229
- this.logToStderr('');
230
- }
231
- else {
232
- // If no error keywords found, show last 20 lines of output
233
- const allLines = errorOutput.split('\n').filter(l => l.trim());
234
- const lastLines = allLines.slice(-20);
235
- this.logToStderr(' Last 20 lines of Flyway output:');
236
- lastLines.forEach(line => this.logToStderr(` ${line.trim()}`));
237
- this.logToStderr('');
117
+ /**
118
+ * Prints error details captured by OnProgress callbacks.
119
+ * Used when Skyway's result.Details is empty (transaction-level errors).
120
+ */
121
+ printCallbackErrors(failedMigrations, lastMigrationStarted, errorLog) {
122
+ // Show any migration failures captured by OnMigrationEnd
123
+ if (failedMigrations.length > 0) {
124
+ for (const detail of failedMigrations) {
125
+ this.logToStderr(` FAILED: ${detail.Migration.Filename}`);
126
+ this.logToStderr(` Script: ${detail.Migration.FilePath}`);
127
+ this.logToStderr(` Version: ${detail.Migration.Version ?? '(repeatable)'}`);
128
+ this.logToStderr(` Description: ${detail.Migration.Description}`);
129
+ if (detail.Error) {
130
+ this.logToStderr(` Error: ${detail.Error.message}`);
238
131
  }
239
132
  }
240
133
  }
241
- // Provide guidance
242
- if (isValidationError) {
243
- this.logToStderr('💡 Migration checksum validation failed:');
244
- this.logToStderr(' - A migration file has been modified after it was applied to the database');
245
- this.logToStderr(' - Check the migration file(s) listed above for unexpected changes');
246
- this.logToStderr(' - To repair: Use `flyway repair` if you intentionally modified the file');
247
- this.logToStderr(' - Or revert the file to match the checksum in the database');
248
- }
249
- else if (isSqlError) {
250
- this.logToStderr('💡 This is a SQL script error:');
251
- this.logToStderr(' - Check the migration SQL file for syntax errors');
252
- this.logToStderr(' - Look for missing GO statements before CREATE TRIGGER/PROCEDURE/FUNCTION');
253
- this.logToStderr(' - Verify all object names and references are correct');
254
- this.logToStderr(' - Check database permissions for the migration user');
255
- }
256
- else if (fullError.includes('login failed') || fullError.includes('password')) {
257
- this.logToStderr('💡 This is a credential issue:');
258
- this.logToStderr(' - Check CODEGEN_DB_USERNAME and CODEGEN_DB_PASSWORD in .env file');
259
- this.logToStderr(' - Verify the user has permission to access the database');
260
- this.logToStderr(' - Check for shell environment variables overriding .env settings');
261
- }
262
- else if (fullError.includes('database') && fullError.includes('does not exist')) {
263
- this.logToStderr('💡 The database does not exist:');
264
- this.logToStderr(` - Create the database: CREATE DATABASE ${config.dbDatabase}`);
265
- this.logToStderr(' - Or verify DB_DATABASE is set correctly in .env file');
134
+ else if (lastMigrationStarted) {
135
+ // OnMigrationEnd never fired, but we know which migration was running
136
+ this.logToStderr(` Failed while executing: ${lastMigrationStarted.Filename}`);
137
+ this.logToStderr(` Script: ${lastMigrationStarted.FilePath}`);
138
+ this.logToStderr(` Version: ${lastMigrationStarted.Version ?? '(repeatable)'}`);
266
139
  }
267
- else if (isConnectionError) {
268
- this.logToStderr('💡 Cannot connect to SQL Server:');
269
- this.logToStderr(' - Verify SQL Server is running');
270
- this.logToStderr(` - Check host and port: ${config.dbHost}:${config.dbPort}`);
271
- this.logToStderr(' - Check firewall settings');
272
- }
273
- else {
274
- this.logToStderr('💡 Check the error details above to diagnose the issue');
140
+ // Show relevant log messages from Skyway (error/failure lines)
141
+ const relevantLogs = errorLog.filter(msg => msg.toLowerCase().includes('fail') || msg.toLowerCase().includes('error') || msg.toLowerCase().includes('rolled back'));
142
+ if (relevantLogs.length > 0) {
143
+ this.logToStderr('');
144
+ this.logToStderr(' Skyway log:');
145
+ for (const msg of relevantLogs) {
146
+ this.logToStderr(` ${msg}`);
147
+ }
275
148
  }
276
149
  }
277
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;aACnC,gBAAW,GAAG,mDAAmD,CAAC;aAElE,aAAQ,GAAG;QAChB;CACH;QACG;CACH;QACG;CACH;KACE,CAAC;aAEK,UAAK,GAAG;QACb,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,2BAA2B,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