@mxpicture/build-cli 0.2.56 → 0.2.57

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,10 +1,26 @@
1
1
  import { Option } from "@commander-js/extra-typings";
2
2
  import { DepsProcessMode, DepsReplacementMode } from "@mxpicture/build-api/types";
3
+ /**
4
+ * Resolves a repository root path to an absolute path.
5
+ *
6
+ * @param repoRoot - The repository root path, either absolute or relative to the current working directory.
7
+ * @returns The absolute path to the repository root.
8
+ */
3
9
  export declare const resolveRoot: (repoRoot: string) => string;
10
+ /** Commander option for specifying the repository root path, defaulting to the current working directory. */
4
11
  export declare const repoRootOption: Option<"-r, --repoRoot <root>", undefined, string, string, false, undefined>;
12
+ /** Commander option for selecting the dependency process mode (mandatory). */
5
13
  export declare const processModeOption: Option<"-m, --mode <mode>", undefined, undefined, undefined, true, DepsProcessMode>;
14
+ /** Commander option for selecting the dependency replacement mode (mandatory). */
6
15
  export declare const replacementModeOption: Option<"-n, --replacement <replacementMode>", undefined, undefined, undefined, true, DepsReplacementMode>;
16
+ /** Commander option for specifying a dependency name pattern (mandatory). */
7
17
  export declare const depPatternOption: Option<"-p, --pattern <pattern>", undefined, undefined, undefined, true, undefined>;
18
+ /** Commander option for enabling selective exports via the TypeScript Compiler API. */
8
19
  export declare const selectiveExportsOption: Option<"-s, --selective-exports", undefined, undefined, undefined, false, undefined>;
20
+ /**
21
+ * Reads the CLI package version from its package.json.
22
+ *
23
+ * @returns The version string of the CLI package.
24
+ */
9
25
  export declare const readVersion: () => string;
10
26
  //# sourceMappingURL=cli.common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.common.d.ts","sourceRoot":"","sources":["../src/cli.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EACL,eAAe,EACf,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAOpC,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MACa,CAAC;AAE7D,eAAO,MAAM,cAAc,8EAKF,CAAC;AAE1B,eAAO,MAAM,iBAAiB,qFAEF,CAAC;AAE7B,eAAO,MAAM,qBAAqB,2GAKN,CAAC;AAE7B,eAAO,MAAM,gBAAgB,qFAGF,CAAC;AAE5B,eAAO,MAAM,sBAAsB,sFAGlC,CAAC;AAEF,eAAO,MAAM,WAAW,cAC4C,CAAC"}
1
+ {"version":3,"file":"cli.common.d.ts","sourceRoot":"","sources":["../src/cli.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EACL,eAAe,EACf,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAQpC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MACa,CAAC;AAE7D,6GAA6G;AAC7G,eAAO,MAAM,cAAc,8EAKF,CAAC;AAE1B,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,qFAEF,CAAC;AAE7B,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,2GAKN,CAAC;AAE7B,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,qFAGF,CAAC;AAE5B,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,sFAGlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,cAC4C,CAAC"}
@@ -5,17 +5,33 @@ import { cwd } from "node:process";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { readPackageJsonSync } from "@mxpicture/build-api/pkg";
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ /**
9
+ * Resolves a repository root path to an absolute path.
10
+ *
11
+ * @param repoRoot - The repository root path, either absolute or relative to the current working directory.
12
+ * @returns The absolute path to the repository root.
13
+ */
8
14
  export const resolveRoot = (repoRoot) => isAbsolute(repoRoot) ? repoRoot : resolve(cwd(), repoRoot);
15
+ /** Commander option for specifying the repository root path, defaulting to the current working directory. */
9
16
  export const repoRootOption = new Option("-r, --repoRoot <root>", "Repo root path")
10
17
  .default(cwd())
11
18
  .argParser(resolveRoot);
19
+ /** Commander option for selecting the dependency process mode (mandatory). */
12
20
  export const processModeOption = new Option("-m, --mode <mode>", "Process mode")
13
21
  .choices(Object.values(DepsProcessMode))
14
22
  .makeOptionMandatory(true);
23
+ /** Commander option for selecting the dependency replacement mode (mandatory). */
15
24
  export const replacementModeOption = new Option("-n, --replacement <replacementMode>", "Replacement mode")
16
25
  .choices(Object.values(DepsReplacementMode))
17
26
  .makeOptionMandatory(true);
27
+ /** Commander option for specifying a dependency name pattern (mandatory). */
18
28
  export const depPatternOption = new Option("-p, --pattern <pattern>", "Dependency pattern").makeOptionMandatory(true);
29
+ /** Commander option for enabling selective exports via the TypeScript Compiler API. */
19
30
  export const selectiveExportsOption = new Option("-s, --selective-exports", "Use TS Compiler API for selective exports");
31
+ /**
32
+ * Reads the CLI package version from its package.json.
33
+ *
34
+ * @returns The version string of the CLI package.
35
+ */
20
36
  export const readVersion = () => readPackageJsonSync(resolve(__dirname, "../package.json")).version;
21
37
  //# sourceMappingURL=cli.common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.common.js","sourceRoot":"","sources":["../src/cli.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE,CACtD,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,MAAM,CACtC,uBAAuB,EACvB,gBAAgB,CACjB;KACE,OAAO,CAAC,GAAG,EAAE,CAAC;KACd,SAAS,CAAC,WAAW,CAAC,CAAC;AAE1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,MAAM,CAAC,mBAAmB,EAAE,cAAc,CAAC;KAC7E,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;KACvC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,MAAM,CAC7C,qCAAqC,EACrC,kBAAkB,CACnB;KACE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;KAC3C,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,MAAM,CACxC,yBAAyB,EACzB,oBAAoB,CACrB,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,MAAM,CAC9C,yBAAyB,EACzB,2CAA2C,CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAC9B,mBAAmB,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC","sourcesContent":["import { Option } from \"@commander-js/extra-typings\";\nimport {\n DepsProcessMode,\n DepsReplacementMode,\n} from \"@mxpicture/build-api/types\";\nimport { dirname, isAbsolute, resolve } from \"node:path\";\nimport { cwd } from \"node:process\";\nimport { fileURLToPath } from \"node:url\";\nimport { readPackageJsonSync } from \"@mxpicture/build-api/pkg\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nexport const resolveRoot = (repoRoot: string): string =>\n isAbsolute(repoRoot) ? repoRoot : resolve(cwd(), repoRoot);\n\nexport const repoRootOption = new Option(\n \"-r, --repoRoot <root>\",\n \"Repo root path\",\n)\n .default(cwd())\n .argParser(resolveRoot);\n\nexport const processModeOption = new Option(\"-m, --mode <mode>\", \"Process mode\")\n .choices(Object.values(DepsProcessMode))\n .makeOptionMandatory(true);\n\nexport const replacementModeOption = new Option(\n \"-n, --replacement <replacementMode>\",\n \"Replacement mode\",\n)\n .choices(Object.values(DepsReplacementMode))\n .makeOptionMandatory(true);\n\nexport const depPatternOption = new Option(\n \"-p, --pattern <pattern>\",\n \"Dependency pattern\",\n).makeOptionMandatory(true);\n\nexport const selectiveExportsOption = new Option(\n \"-s, --selective-exports\",\n \"Use TS Compiler API for selective exports\",\n);\n\nexport const readVersion = () =>\n readPackageJsonSync(resolve(__dirname, \"../package.json\")).version;\n"]}
1
+ {"version":3,"file":"cli.common.js","sourceRoot":"","sources":["../src/cli.common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE,CACtD,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;AAE7D,6GAA6G;AAC7G,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,MAAM,CACtC,uBAAuB,EACvB,gBAAgB,CACjB;KACE,OAAO,CAAC,GAAG,EAAE,CAAC;KACd,SAAS,CAAC,WAAW,CAAC,CAAC;AAE1B,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,MAAM,CAAC,mBAAmB,EAAE,cAAc,CAAC;KAC7E,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;KACvC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE7B,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,MAAM,CAC7C,qCAAqC,EACrC,kBAAkB,CACnB;KACE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;KAC3C,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE7B,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,MAAM,CACxC,yBAAyB,EACzB,oBAAoB,CACrB,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAE5B,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,MAAM,CAC9C,yBAAyB,EACzB,2CAA2C,CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAC9B,mBAAmB,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC","sourcesContent":["import { Option } from \"@commander-js/extra-typings\";\nimport {\n DepsProcessMode,\n DepsReplacementMode,\n} from \"@mxpicture/build-api/types\";\nimport { dirname, isAbsolute, resolve } from \"node:path\";\nimport { cwd } from \"node:process\";\nimport { fileURLToPath } from \"node:url\";\nimport { readPackageJsonSync } from \"@mxpicture/build-api/pkg\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\n/**\n * Resolves a repository root path to an absolute path.\n *\n * @param repoRoot - The repository root path, either absolute or relative to the current working directory.\n * @returns The absolute path to the repository root.\n */\nexport const resolveRoot = (repoRoot: string): string =>\n isAbsolute(repoRoot) ? repoRoot : resolve(cwd(), repoRoot);\n\n/** Commander option for specifying the repository root path, defaulting to the current working directory. */\nexport const repoRootOption = new Option(\n \"-r, --repoRoot <root>\",\n \"Repo root path\",\n)\n .default(cwd())\n .argParser(resolveRoot);\n\n/** Commander option for selecting the dependency process mode (mandatory). */\nexport const processModeOption = new Option(\"-m, --mode <mode>\", \"Process mode\")\n .choices(Object.values(DepsProcessMode))\n .makeOptionMandatory(true);\n\n/** Commander option for selecting the dependency replacement mode (mandatory). */\nexport const replacementModeOption = new Option(\n \"-n, --replacement <replacementMode>\",\n \"Replacement mode\",\n)\n .choices(Object.values(DepsReplacementMode))\n .makeOptionMandatory(true);\n\n/** Commander option for specifying a dependency name pattern (mandatory). */\nexport const depPatternOption = new Option(\n \"-p, --pattern <pattern>\",\n \"Dependency pattern\",\n).makeOptionMandatory(true);\n\n/** Commander option for enabling selective exports via the TypeScript Compiler API. */\nexport const selectiveExportsOption = new Option(\n \"-s, --selective-exports\",\n \"Use TS Compiler API for selective exports\",\n);\n\n/**\n * Reads the CLI package version from its package.json.\n *\n * @returns The version string of the CLI package.\n */\nexport const readVersion = () =>\n readPackageJsonSync(resolve(__dirname, \"../package.json\")).version;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/build-cli",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "description": "Build utilities CLI",
5
5
  "type": "module",
6
6
  "author": "MXPicture",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@commander-js/extra-typings": "^14.0.0",
37
- "@mxpicture/build-api": "^0.2.56",
37
+ "@mxpicture/build-api": "^0.2.57",
38
38
  "commander": "^14.0.3"
39
39
  },
40
40
  "devDependencies": {