@gadmin2n/cli 0.0.90 → 0.0.92

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 (46) hide show
  1. package/.circleci/config.yml +62 -0
  2. package/.github/ISSUE_TEMPLATE/Bug_report.yml +106 -0
  3. package/.github/ISSUE_TEMPLATE/Feature_request.yml +52 -0
  4. package/.github/ISSUE_TEMPLATE/Regression.yml +78 -0
  5. package/.github/ISSUE_TEMPLATE/config.yml +7 -0
  6. package/.github/PULL_REQUEST_TEMPLATE.md +41 -0
  7. package/actions/index.d.ts +1 -1
  8. package/actions/index.js +1 -1
  9. package/actions/self-update.action.d.ts +5 -0
  10. package/actions/self-update.action.js +93 -0
  11. package/actions/update.action.d.ts +2 -0
  12. package/actions/update.action.js +945 -6
  13. package/commands/command.loader.js +2 -2
  14. package/commands/{template.command.d.ts → self-update.command.d.ts} +1 -1
  15. package/commands/self-update.command.js +35 -0
  16. package/commands/update.command.js +25 -8
  17. package/lib/install-manager.d.ts +48 -0
  18. package/lib/install-manager.js +125 -0
  19. package/lib/template-merge/config-loader.d.ts +15 -0
  20. package/lib/template-merge/config-loader.js +38 -0
  21. package/lib/template-merge/env-merger.d.ts +5 -0
  22. package/lib/template-merge/env-merger.js +57 -0
  23. package/lib/template-merge/glob.d.ts +5 -0
  24. package/lib/template-merge/glob.js +78 -0
  25. package/lib/template-merge/index.d.ts +8 -0
  26. package/lib/template-merge/index.js +24 -0
  27. package/lib/template-merge/json-merger.d.ts +5 -0
  28. package/lib/template-merge/json-merger.js +252 -0
  29. package/lib/template-merge/merger.d.ts +30 -0
  30. package/lib/template-merge/merger.js +2 -0
  31. package/lib/template-merge/prisma-merger.d.ts +5 -0
  32. package/lib/template-merge/prisma-merger.js +112 -0
  33. package/lib/template-merge/registry.d.ts +25 -0
  34. package/lib/template-merge/registry.js +42 -0
  35. package/lib/template-merge/ts-module-merger.d.ts +16 -0
  36. package/lib/template-merge/ts-module-merger.js +193 -0
  37. package/lib/version-check.d.ts +39 -0
  38. package/lib/version-check.js +157 -0
  39. package/package.json +2 -2
  40. package/test/lib/compiler/hooks/__snapshots__/tsconfig-paths.hook.spec.ts.snap +68 -0
  41. package/test/lib/compiler/hooks/fixtures/aliased-imports/src/bar.tsx +1 -0
  42. package/test/lib/compiler/hooks/fixtures/aliased-imports/src/baz.js +1 -0
  43. package/test/lib/compiler/hooks/fixtures/aliased-imports/src/qux.jsx +1 -0
  44. package/actions/template.action.d.ts +0 -7
  45. package/actions/template.action.js +0 -570
  46. package/commands/template.command.js +0 -42
@@ -9,8 +9,8 @@ const build_command_1 = require("./build.command");
9
9
  const generate_command_1 = require("./generate.command");
10
10
  const info_command_1 = require("./info.command");
11
11
  const new_command_1 = require("./new.command");
12
+ const self_update_command_1 = require("./self-update.command");
12
13
  const start_command_1 = require("./start.command");
13
- const template_command_1 = require("./template.command");
14
14
  const update_command_1 = require("./update.command");
15
15
  class CommandLoader {
16
16
  static load(program) {
@@ -19,7 +19,7 @@ class CommandLoader {
19
19
  new start_command_1.StartCommand(new actions_1.StartAction()).load(program);
20
20
  new info_command_1.InfoCommand(new actions_1.InfoAction()).load(program);
21
21
  new update_command_1.UpdateCommand(new actions_1.UpdateAction()).load(program);
22
- new template_command_1.TemplateCommand(new actions_1.TemplateAction()).load(program);
22
+ new self_update_command_1.SelfUpdateCommand(new actions_1.SelfUpdateAction()).load(program);
23
23
  new add_command_1.AddCommand(new actions_1.AddAction()).load(program);
24
24
  new generate_command_1.GenerateCommand(new actions_1.GenerateAction()).load(program);
25
25
  this.handleInvalidCommand(program);
@@ -1,5 +1,5 @@
1
1
  import { CommanderStatic } from 'commander';
2
2
  import { AbstractCommand } from './abstract.command';
3
- export declare class TemplateCommand extends AbstractCommand {
3
+ export declare class SelfUpdateCommand extends AbstractCommand {
4
4
  load(program: CommanderStatic): void;
5
5
  }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SelfUpdateCommand = void 0;
13
+ const abstract_command_1 = require("./abstract.command");
14
+ class SelfUpdateCommand extends abstract_command_1.AbstractCommand {
15
+ load(program) {
16
+ program
17
+ .command('self-update')
18
+ .description('Upgrade the gadmin2 CLI itself.\n\n' +
19
+ ' By default upgrades to the latest stable release on npm.\n' +
20
+ ' The package manager (npm | yarn | pnpm) is auto-detected from\n' +
21
+ ' the CLI install path; override with --manager if needed.\n' +
22
+ ' Pass --check to only print version status without installing.')
23
+ .option('-t, --tag <tag>', 'Install a specific dist-tag (latest | next | beta | rc | ...).', 'latest')
24
+ .option('-m, --manager <name>', 'Force the package manager (npm | yarn | pnpm); overrides auto-detection.')
25
+ .option('--check', 'Only check for updates; do not install.')
26
+ .action((command) => __awaiter(this, void 0, void 0, function* () {
27
+ const options = [];
28
+ options.push({ name: 'tag', value: command.tag || 'latest' });
29
+ options.push({ name: 'manager', value: command.manager || '' });
30
+ options.push({ name: 'check', value: !!command.check });
31
+ yield this.action.handle([], options);
32
+ }));
33
+ }
34
+ }
35
+ exports.SelfUpdateCommand = SelfUpdateCommand;
@@ -14,16 +14,33 @@ const abstract_command_1 = require("./abstract.command");
14
14
  class UpdateCommand extends abstract_command_1.AbstractCommand {
15
15
  load(program) {
16
16
  program
17
- .command('update')
17
+ .command('update [subcommand]')
18
18
  .alias('u')
19
- .description('Update Gadmin dependencies.')
20
- .option('-f, --force', 'Remove and re-install dependencies (instead of update).')
21
- .option('-t, --tag <tag>', 'Upgrade to tagged packages (latest | beta | rc | next tag).')
22
- .action((command) => __awaiter(this, void 0, void 0, function* () {
19
+ .description('Update project from template, sync .claude context, and install changed deps.\n\n' +
20
+ ' Subcommands:\n' +
21
+ ' (none) Pull updates from template into instance, sync .claude .claude-internal/.agent,\n' +
22
+ ' and run install in web/ or server/ if their package.json changed.\n' +
23
+ ' diff Show differences between instance and template (read-only).\n\n' +
24
+ ' Update strategies (per-file interactive prompt):\n' +
25
+ ' skip Keep instance file as-is\n' +
26
+ ' overwrite Replace with template version\n' +
27
+ ' merge Attempt auto merge via git merge-file\n' +
28
+ ' conflict Write conflict markers for manual resolve\n')
29
+ .option('--no-content', '[diff] Only show file list, skip inline diff content.')
30
+ .option('-d, --dry-run', '[update] Show what would be updated without making changes.')
31
+ .option('-y, --yes', '[update] Skip per-file prompt, use conflict markers for all.')
32
+ .option('--no-smart-merge', '[update] Disable smart structural mergers; use line-level prompt for every file.')
33
+ .option('--no-version-check', '[update | diff] Skip the npm registry version check at startup.')
34
+ .action((subcommand, command) => __awaiter(this, void 0, void 0, function* () {
35
+ const inputs = [];
36
+ inputs.push({ name: 'subcommand', value: subcommand || '' });
23
37
  const options = [];
24
- options.push({ name: 'force', value: !!command.force });
25
- options.push({ name: 'tag', value: command.tag });
26
- yield this.action.handle([], options);
38
+ options.push({ name: 'no-content', value: !command.content });
39
+ options.push({ name: 'dry-run', value: !!command.dryRun });
40
+ options.push({ name: 'yes', value: !!command.yes });
41
+ options.push({ name: 'smart-merge', value: command.smartMerge !== false });
42
+ options.push({ name: 'version-check', value: command.versionCheck !== false });
43
+ yield this.action.handle(inputs, options);
27
44
  }));
28
45
  }
29
46
  }
@@ -0,0 +1,48 @@
1
+ export declare type InstallManager = 'npm' | 'yarn' | 'pnpm' | 'unknown';
2
+ export interface DetectionResult {
3
+ /** Final manager to use (after applying availability fallback). */
4
+ manager: InstallManager;
5
+ /** What the path pattern told us, before any fallback. */
6
+ pathHint: InstallManager;
7
+ /** Why we landed on `manager`. Used purely for human-readable output. */
8
+ reason: string;
9
+ }
10
+ /**
11
+ * Detect how the CLI is currently installed by inspecting the absolute path
12
+ * of this file (__dirname). Each global package manager drops binaries into
13
+ * a distinctive directory layout:
14
+ *
15
+ * - npm : .../lib/node_modules/<pkg>/... (Unix; nvm/fnm/system/Homebrew)
16
+ * .../npm/node_modules/<pkg>/... (Windows %APPDATA%/npm)
17
+ * - yarn : ~/.config/yarn/global/node_modules/... (yarn classic v1, *nix)
18
+ * ~/.yarn/global/node_modules/... (alt yarn classic layout)
19
+ * %LOCALAPPDATA%/Yarn/Data/global/node_modules/... (Windows)
20
+ * - pnpm : ~/.local/share/pnpm/global/<v>/node_modules/... (Unix)
21
+ * %LOCALAPPDATA%/pnpm/global/<v>/node_modules/... (Windows)
22
+ * also matches PNPM_HOME-rooted layouts
23
+ *
24
+ * Returns 'unknown' if no pattern matches (e.g. yalc / npm link / monorepo dev).
25
+ */
26
+ export declare function detectFromPath(dir?: string): InstallManager;
27
+ /**
28
+ * Full detection: path inspection + availability fallback.
29
+ *
30
+ * If the path tells us 'yarn' or 'pnpm' but that binary is no longer on
31
+ * PATH (user uninstalled it), we degrade to 'npm' so the upgrade command
32
+ * still works. The original path hint is preserved in `pathHint` for
33
+ * diagnostics.
34
+ *
35
+ * If `override` is given (from --manager flag), it wins unconditionally —
36
+ * we still report the underlying path hint for transparency.
37
+ */
38
+ export declare function detectInstallManager(override?: InstallManager): DetectionResult;
39
+ /**
40
+ * Build the canonical "install this package globally" command for a given
41
+ * manager. The version specifier is appended via `pkg@tag`.
42
+ */
43
+ export declare function buildUpgradeCommand(manager: InstallManager, packageName: string, tag?: string): string;
44
+ /**
45
+ * Validate a string from the --manager flag. Returns the normalized
46
+ * InstallManager value, or null if invalid.
47
+ */
48
+ export declare function parseManagerFlag(input: string | undefined): InstallManager | null;
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseManagerFlag = exports.buildUpgradeCommand = exports.detectInstallManager = exports.detectFromPath = void 0;
4
+ const child_process_1 = require("child_process");
5
+ /**
6
+ * Detect how the CLI is currently installed by inspecting the absolute path
7
+ * of this file (__dirname). Each global package manager drops binaries into
8
+ * a distinctive directory layout:
9
+ *
10
+ * - npm : .../lib/node_modules/<pkg>/... (Unix; nvm/fnm/system/Homebrew)
11
+ * .../npm/node_modules/<pkg>/... (Windows %APPDATA%/npm)
12
+ * - yarn : ~/.config/yarn/global/node_modules/... (yarn classic v1, *nix)
13
+ * ~/.yarn/global/node_modules/... (alt yarn classic layout)
14
+ * %LOCALAPPDATA%/Yarn/Data/global/node_modules/... (Windows)
15
+ * - pnpm : ~/.local/share/pnpm/global/<v>/node_modules/... (Unix)
16
+ * %LOCALAPPDATA%/pnpm/global/<v>/node_modules/... (Windows)
17
+ * also matches PNPM_HOME-rooted layouts
18
+ *
19
+ * Returns 'unknown' if no pattern matches (e.g. yalc / npm link / monorepo dev).
20
+ */
21
+ function detectFromPath(dir = __dirname) {
22
+ const normalized = dir.replace(/\\/g, '/');
23
+ // yarn classic global
24
+ if (/(?:\/\.config\/yarn\/global|\/\.yarn\/global|\/Yarn\/Data\/global)\//i.test(normalized)) {
25
+ return 'yarn';
26
+ }
27
+ // pnpm global
28
+ if (/\/pnpm\/global\//.test(normalized)) {
29
+ return 'pnpm';
30
+ }
31
+ // npm global (Unix-like or Windows AppData)
32
+ if (/\/lib\/node_modules\//.test(normalized) ||
33
+ /\/npm\/node_modules\//i.test(normalized)) {
34
+ return 'npm';
35
+ }
36
+ return 'unknown';
37
+ }
38
+ exports.detectFromPath = detectFromPath;
39
+ /** Cheap "is X on PATH?" check, returns false on any error/timeout. */
40
+ function isCommandAvailable(cmd) {
41
+ try {
42
+ const probe = process.platform === 'win32' ? `where ${cmd}` : `command -v ${cmd}`;
43
+ (0, child_process_1.execSync)(probe, { stdio: 'pipe', timeout: 2000 });
44
+ return true;
45
+ }
46
+ catch (_a) {
47
+ return false;
48
+ }
49
+ }
50
+ /**
51
+ * Full detection: path inspection + availability fallback.
52
+ *
53
+ * If the path tells us 'yarn' or 'pnpm' but that binary is no longer on
54
+ * PATH (user uninstalled it), we degrade to 'npm' so the upgrade command
55
+ * still works. The original path hint is preserved in `pathHint` for
56
+ * diagnostics.
57
+ *
58
+ * If `override` is given (from --manager flag), it wins unconditionally —
59
+ * we still report the underlying path hint for transparency.
60
+ */
61
+ function detectInstallManager(override) {
62
+ const pathHint = detectFromPath();
63
+ if (override && override !== 'unknown') {
64
+ return {
65
+ manager: override,
66
+ pathHint,
67
+ reason: `manager forced via --manager=${override} (path hint: ${pathHint})`,
68
+ };
69
+ }
70
+ if (pathHint === 'unknown') {
71
+ return {
72
+ manager: 'npm',
73
+ pathHint,
74
+ reason: 'install path did not match any known global package manager layout — defaulting to npm',
75
+ };
76
+ }
77
+ if (pathHint !== 'npm' && !isCommandAvailable(pathHint)) {
78
+ return {
79
+ manager: 'npm',
80
+ pathHint,
81
+ reason: `install path suggests ${pathHint}, but \`${pathHint}\` is not on PATH — falling back to npm`,
82
+ };
83
+ }
84
+ return {
85
+ manager: pathHint,
86
+ pathHint,
87
+ reason: `detected from install path`,
88
+ };
89
+ }
90
+ exports.detectInstallManager = detectInstallManager;
91
+ /**
92
+ * Build the canonical "install this package globally" command for a given
93
+ * manager. The version specifier is appended via `pkg@tag`.
94
+ */
95
+ function buildUpgradeCommand(manager, packageName, tag = 'latest') {
96
+ const target = `${packageName}@${tag}`;
97
+ switch (manager) {
98
+ case 'yarn':
99
+ // yarn classic v1: `yarn global add`. Yarn berry (2+) deprecated this
100
+ // in favour of `yarn dlx`; users on berry typically still install
101
+ // global CLIs via npm or pnpm, so this command is the right default
102
+ // for the "yarn classic" detection path.
103
+ return `yarn global add ${target}`;
104
+ case 'pnpm':
105
+ return `pnpm add -g ${target}`;
106
+ case 'npm':
107
+ case 'unknown':
108
+ default:
109
+ return `npm install -g ${target}`;
110
+ }
111
+ }
112
+ exports.buildUpgradeCommand = buildUpgradeCommand;
113
+ /**
114
+ * Validate a string from the --manager flag. Returns the normalized
115
+ * InstallManager value, or null if invalid.
116
+ */
117
+ function parseManagerFlag(input) {
118
+ if (!input)
119
+ return null;
120
+ const v = input.toLowerCase().trim();
121
+ if (v === 'npm' || v === 'yarn' || v === 'pnpm')
122
+ return v;
123
+ return null;
124
+ }
125
+ exports.parseManagerFlag = parseManagerFlag;
@@ -0,0 +1,15 @@
1
+ export interface TemplateUpdateConfig {
2
+ /** Glob → merger name. Insertion order is preserved (use plain object/array, not Map). */
3
+ mergers?: Record<string, string>;
4
+ /** Dot-namespaced key → value, e.g. 'json.scripts': 'preserve-instance' */
5
+ policies?: Record<string, string>;
6
+ }
7
+ /**
8
+ * Load the templateUpdate section from gadmin-cli.json.
9
+ * Searches in this order:
10
+ * 1. <instanceDir>/server/gadmin-cli.json
11
+ * 2. <instanceDir>/gadmin-cli.json
12
+ * Returns null if no config file found, no `templateUpdate` key, or on parse error.
13
+ * On parse error, also console.warn with the error and the file path.
14
+ */
15
+ export declare function loadTemplateUpdateConfig(instanceDir: string): TemplateUpdateConfig | null;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadTemplateUpdateConfig = void 0;
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ /**
7
+ * Load the templateUpdate section from gadmin-cli.json.
8
+ * Searches in this order:
9
+ * 1. <instanceDir>/server/gadmin-cli.json
10
+ * 2. <instanceDir>/gadmin-cli.json
11
+ * Returns null if no config file found, no `templateUpdate` key, or on parse error.
12
+ * On parse error, also console.warn with the error and the file path.
13
+ */
14
+ function loadTemplateUpdateConfig(instanceDir) {
15
+ const candidates = [
16
+ path.join(instanceDir, 'server', 'gadmin-cli.json'),
17
+ path.join(instanceDir, 'gadmin-cli.json'),
18
+ ];
19
+ for (const configPath of candidates) {
20
+ if (!fs.existsSync(configPath))
21
+ continue;
22
+ try {
23
+ const raw = fs.readFileSync(configPath, 'utf-8');
24
+ const parsed = JSON.parse(raw);
25
+ const section = parsed === null || parsed === void 0 ? void 0 : parsed.templateUpdate;
26
+ if (!section || typeof section !== 'object') {
27
+ return null;
28
+ }
29
+ return section;
30
+ }
31
+ catch (err) {
32
+ console.warn(`Failed to parse templateUpdate config at ${configPath}: ${(err === null || err === void 0 ? void 0 : err.message) || err}`);
33
+ return null;
34
+ }
35
+ }
36
+ return null;
37
+ }
38
+ exports.loadTemplateUpdateConfig = loadTemplateUpdateConfig;
@@ -0,0 +1,5 @@
1
+ import { Merger, MergeContext, MergeResult } from './merger';
2
+ export declare class EnvMerger implements Merger {
3
+ readonly name = "env";
4
+ merge(ctx: MergeContext): MergeResult;
5
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnvMerger = void 0;
4
+ const KEY_RE = /^([A-Za-z_][A-Za-z0-9_]*)=/;
5
+ class EnvMerger {
6
+ constructor() {
7
+ this.name = 'env';
8
+ }
9
+ merge(ctx) {
10
+ try {
11
+ const instLines = ctx.instanceContent.split('\n');
12
+ const instKeys = new Set();
13
+ for (const line of instLines) {
14
+ const m = line.match(KEY_RE);
15
+ if (m)
16
+ instKeys.add(m[1]);
17
+ }
18
+ const tmplLines = ctx.templateContent.split('\n');
19
+ const toAdd = [];
20
+ const addedKeys = [];
21
+ for (const line of tmplLines) {
22
+ const trimmed = line.trim();
23
+ if (trimmed === '' || trimmed.startsWith('#'))
24
+ continue;
25
+ const m = line.match(KEY_RE);
26
+ if (!m)
27
+ continue;
28
+ const key = m[1];
29
+ if (instKeys.has(key))
30
+ continue;
31
+ toAdd.push(line);
32
+ addedKeys.push(key);
33
+ }
34
+ if (toAdd.length === 0) {
35
+ return {
36
+ ok: true,
37
+ merged: ctx.instanceContent,
38
+ notes: ['no changes'],
39
+ };
40
+ }
41
+ let merged = ctx.instanceContent;
42
+ if (!merged.endsWith('\n'))
43
+ merged += '\n';
44
+ merged += '\n# --- added from template ---\n';
45
+ merged += toAdd.join('\n');
46
+ if (!merged.endsWith('\n'))
47
+ merged += '\n';
48
+ const notes = addedKeys.map((k) => `added ${k}`);
49
+ return { ok: true, merged, notes };
50
+ }
51
+ catch (e) {
52
+ const msg = e instanceof Error ? e.message : String(e);
53
+ return { ok: false, reason: `env merge error: ${msg}` };
54
+ }
55
+ }
56
+ }
57
+ exports.EnvMerger = EnvMerger;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Match a file path against a glob pattern.
3
+ * Equivalent to `matchesPattern` in actions/update.action.ts.
4
+ */
5
+ export declare function globMatch(filePath: string, pattern: string): boolean;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.globMatch = void 0;
4
+ /**
5
+ * Convert a glob pattern to a RegExp.
6
+ * Supports: * (any chars except /), ** (any path segments), ? (single char)
7
+ */
8
+ function globToRegex(pattern) {
9
+ let regexStr = '^';
10
+ let i = 0;
11
+ while (i < pattern.length) {
12
+ const c = pattern[i];
13
+ if (c === '*') {
14
+ if (pattern[i + 1] === '*') {
15
+ if (pattern[i + 2] === '/') {
16
+ regexStr += '(?:.+/)?';
17
+ i += 3;
18
+ }
19
+ else {
20
+ regexStr += '.*';
21
+ i += 2;
22
+ }
23
+ }
24
+ else {
25
+ regexStr += '[^/]*';
26
+ i++;
27
+ }
28
+ }
29
+ else if (c === '?') {
30
+ regexStr += '[^/]';
31
+ i++;
32
+ }
33
+ else if (c === '.' ||
34
+ c === '(' ||
35
+ c === ')' ||
36
+ c === '[' ||
37
+ c === ']' ||
38
+ c === '{' ||
39
+ c === '}' ||
40
+ c === '+' ||
41
+ c === '^' ||
42
+ c === '$' ||
43
+ c === '|' ||
44
+ c === '\\') {
45
+ regexStr += '\\' + c;
46
+ i++;
47
+ }
48
+ else {
49
+ regexStr += c;
50
+ i++;
51
+ }
52
+ }
53
+ regexStr += '$';
54
+ return new RegExp(regexStr);
55
+ }
56
+ /**
57
+ * Match a file path against a glob pattern.
58
+ * Equivalent to `matchesPattern` in actions/update.action.ts.
59
+ */
60
+ function globMatch(filePath, pattern) {
61
+ if (filePath === pattern)
62
+ return true;
63
+ if (filePath.startsWith(pattern + '/'))
64
+ return true;
65
+ const parts = filePath.split('/');
66
+ if (!pattern.includes('/') &&
67
+ !pattern.includes('*') &&
68
+ !pattern.includes('?')) {
69
+ if (parts.includes(pattern))
70
+ return true;
71
+ }
72
+ if (pattern.includes('*') || pattern.includes('?')) {
73
+ const regex = globToRegex(pattern);
74
+ return regex.test(filePath);
75
+ }
76
+ return false;
77
+ }
78
+ exports.globMatch = globMatch;
@@ -0,0 +1,8 @@
1
+ export * from './merger';
2
+ export * from './registry';
3
+ export * from './config-loader';
4
+ export * from './glob';
5
+ export * from './json-merger';
6
+ export * from './env-merger';
7
+ export * from './prisma-merger';
8
+ export * from './ts-module-merger';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./merger"), exports);
18
+ __exportStar(require("./registry"), exports);
19
+ __exportStar(require("./config-loader"), exports);
20
+ __exportStar(require("./glob"), exports);
21
+ __exportStar(require("./json-merger"), exports);
22
+ __exportStar(require("./env-merger"), exports);
23
+ __exportStar(require("./prisma-merger"), exports);
24
+ __exportStar(require("./ts-module-merger"), exports);
@@ -0,0 +1,5 @@
1
+ import { Merger, MergeContext, MergeResult } from './merger';
2
+ export declare class JsonMerger implements Merger {
3
+ readonly name = "json";
4
+ merge(ctx: MergeContext): MergeResult;
5
+ }