@jpp-toolkit/plugin-build-lib 0.0.106 → 0.0.107

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/dist/index.mjs CHANGED
@@ -14,7 +14,9 @@ const presetFormatMap = {
14
14
  [Preset.CJS]: ["cjs"],
15
15
  [Preset.HYBRID]: ["esm", "cjs"]
16
16
  };
17
- var LibBuildCommand = class LibBuildCommand extends Command {
17
+ //#endregion
18
+ //#region src/index.ts
19
+ const commands = { "build:lib": class LibBuildCommand extends Command {
18
20
  static summary = "Build the project using predefined library build presets.";
19
21
  static args = { preset: Args.string({
20
22
  name: "preset",
@@ -68,10 +70,7 @@ var LibBuildCommand = class LibBuildCommand extends Command {
68
70
  ...entry ? { entry: path.resolve(process.cwd(), entry) } : {}
69
71
  }));
70
72
  }
71
- };
72
- //#endregion
73
- //#region src/index.ts
74
- const commands = { "build:lib": LibBuildCommand };
73
+ } };
75
74
  //#endregion
76
75
  export { commands };
77
76
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["tsdownBuild"],"sources":["../src/lib-build-command.ts","../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { Command } from '@jpp-toolkit/core';\nimport { createTsdownConfig } from '@jpp-toolkit/tsdown-config';\nimport { Args, Flags } from '@oclif/core';\nimport { build as tsdownBuild } from 'tsdown';\n\nconst Preset = {\n ESM: 'esm',\n CJS: 'cjs',\n HYBRID: 'hybrid',\n} as const;\ntype Preset = (typeof Preset)[keyof typeof Preset];\n\nconst presetFormatMap = {\n [Preset.ESM]: ['esm' as const],\n [Preset.CJS]: ['cjs' as const],\n [Preset.HYBRID]: ['esm' as const, 'cjs' as const],\n};\n\nexport class LibBuildCommand extends Command {\n static override summary = 'Build the project using predefined library build presets.';\n\n static override args = {\n preset: Args.string({\n name: 'preset',\n required: true,\n description: 'The build preset to use.',\n options: Object.values(Preset),\n }),\n };\n\n static override flags = {\n watch: Flags.boolean({\n char: 'w',\n description: 'Watch files for changes and rebuild automatically.',\n default: false,\n }),\n entry: Flags.string({\n char: 'e',\n description: 'The entry file for the build process.',\n }),\n };\n\n static override examples = [\n {\n description: 'Build the library using the esm preset.',\n command: '<%= config.bin %> <%= command.id %> esm',\n },\n {\n description: 'Build the library using the cjs preset.',\n command: '<%= config.bin %> <%= command.id %> cjs',\n },\n {\n description: 'Build the library using the hybrid preset.',\n command: '<%= config.bin %> <%= command.id %> hybrid',\n },\n {\n description: 'Build the library and watch for changes.',\n command: '<%= config.bin %> <%= command.id %> esm --watch',\n },\n {\n description: 'Build the library with a custom entry file.',\n command: '<%= config.bin %> <%= command.id %> esm --entry src/main.ts',\n },\n ];\n\n public async run(): Promise<void> {\n const { args, flags } = await this.parse(LibBuildCommand);\n const preset = args.preset as Preset;\n const { watch, entry } = flags;\n\n this.logger.info(`Building library using the '${preset}' preset...`);\n\n if (entry) {\n this.logger.info(`Using custom entry file: ${entry}`);\n }\n\n const format = presetFormatMap[preset];\n const config = createTsdownConfig({\n format,\n watch,\n ...(entry ? { entry: path.resolve(process.cwd(), entry) } : {}),\n });\n await tsdownBuild(config);\n }\n}\n","import { LibBuildCommand } from './lib-build-command';\n\nexport const commands = {\n 'build:lib': LibBuildCommand,\n};\n"],"mappings":";;;;;;AAOA,MAAM,SAAS;CACX,KAAK;CACL,KAAK;CACL,QAAQ;CACX;AAGD,MAAM,kBAAkB;EACnB,OAAO,MAAM,CAAC,MAAe;EAC7B,OAAO,MAAM,CAAC,MAAe;EAC7B,OAAO,SAAS,CAAC,OAAgB,MAAe;CACpD;AAED,IAAa,kBAAb,MAAa,wBAAwB,QAAQ;CACzC,OAAgB,UAAU;CAE1B,OAAgB,OAAO,EACnB,QAAQ,KAAK,OAAO;EAChB,MAAM;EACN,UAAU;EACV,aAAa;EACb,SAAS,OAAO,OAAO,OAAO;EACjC,CAAC,EACL;CAED,OAAgB,QAAQ;EACpB,OAAO,MAAM,QAAQ;GACjB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,OAAO,MAAM,OAAO;GAChB,MAAM;GACN,aAAa;GAChB,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,MAAM,UAAU,MAAM,KAAK,MAAM,gBAAgB;EACzD,MAAM,SAAS,KAAK;EACpB,MAAM,EAAE,OAAO,UAAU;AAEzB,OAAK,OAAO,KAAK,+BAA+B,OAAO,aAAa;AAEpE,MAAI,MACA,MAAK,OAAO,KAAK,4BAA4B,QAAQ;EAGzD,MAAM,SAAS,gBAAgB;AAM/B,QAAMA,MALS,mBAAmB;GAC9B;GACA;GACA,GAAI,QAAQ,EAAE,OAAO,KAAK,QAAQ,QAAQ,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE;GACjE,CAAC,CACuB;;;;;AClFjC,MAAa,WAAW,EACpB,aAAa,iBAChB"}
1
+ {"version":3,"file":"index.mjs","names":["tsdownBuild"],"sources":["../src/lib-build-command.ts","../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { Command } from '@jpp-toolkit/core';\nimport { createTsdownConfig } from '@jpp-toolkit/tsdown-config';\nimport { Args, Flags } from '@oclif/core';\nimport { build as tsdownBuild } from 'tsdown';\n\nconst Preset = {\n ESM: 'esm',\n CJS: 'cjs',\n HYBRID: 'hybrid',\n} as const;\ntype Preset = (typeof Preset)[keyof typeof Preset];\n\nconst presetFormatMap = {\n [Preset.ESM]: ['esm' as const],\n [Preset.CJS]: ['cjs' as const],\n [Preset.HYBRID]: ['esm' as const, 'cjs' as const],\n};\n\nexport class LibBuildCommand extends Command {\n static override summary = 'Build the project using predefined library build presets.';\n\n static override args = {\n preset: Args.string({\n name: 'preset',\n required: true,\n description: 'The build preset to use.',\n options: Object.values(Preset),\n }),\n };\n\n static override flags = {\n watch: Flags.boolean({\n char: 'w',\n description: 'Watch files for changes and rebuild automatically.',\n default: false,\n }),\n entry: Flags.string({\n char: 'e',\n description: 'The entry file for the build process.',\n }),\n };\n\n static override examples = [\n {\n description: 'Build the library using the esm preset.',\n command: '<%= config.bin %> <%= command.id %> esm',\n },\n {\n description: 'Build the library using the cjs preset.',\n command: '<%= config.bin %> <%= command.id %> cjs',\n },\n {\n description: 'Build the library using the hybrid preset.',\n command: '<%= config.bin %> <%= command.id %> hybrid',\n },\n {\n description: 'Build the library and watch for changes.',\n command: '<%= config.bin %> <%= command.id %> esm --watch',\n },\n {\n description: 'Build the library with a custom entry file.',\n command: '<%= config.bin %> <%= command.id %> esm --entry src/main.ts',\n },\n ];\n\n public async run(): Promise<void> {\n const { args, flags } = await this.parse(LibBuildCommand);\n const preset = args.preset as Preset;\n const { watch, entry } = flags;\n\n this.logger.info(`Building library using the '${preset}' preset...`);\n\n if (entry) {\n this.logger.info(`Using custom entry file: ${entry}`);\n }\n\n const format = presetFormatMap[preset];\n const config = createTsdownConfig({\n format,\n watch,\n ...(entry ? { entry: path.resolve(process.cwd(), entry) } : {}),\n });\n await tsdownBuild(config);\n }\n}\n","import { LibBuildCommand } from './lib-build-command';\n\nexport const commands = {\n 'build:lib': LibBuildCommand,\n};\n"],"mappings":";;;;;;AAOA,MAAM,SAAS;CACX,KAAK;CACL,KAAK;CACL,QAAQ;CACX;AAGD,MAAM,kBAAkB;EACnB,OAAO,MAAM,CAAC,MAAe;EAC7B,OAAO,MAAM,CAAC,MAAe;EAC7B,OAAO,SAAS,CAAC,OAAgB,MAAe;CACpD;;;AChBD,MAAa,WAAW,EACpB,aDiBJ,MAAa,wBAAwB,QAAQ;CACzC,OAAgB,UAAU;CAE1B,OAAgB,OAAO,EACnB,QAAQ,KAAK,OAAO;EAChB,MAAM;EACN,UAAU;EACV,aAAa;EACb,SAAS,OAAO,OAAO,OAAO;EACjC,CAAC,EACL;CAED,OAAgB,QAAQ;EACpB,OAAO,MAAM,QAAQ;GACjB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,OAAO,MAAM,OAAO;GAChB,MAAM;GACN,aAAa;GAChB,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,MAAM,UAAU,MAAM,KAAK,MAAM,gBAAgB;EACzD,MAAM,SAAS,KAAK;EACpB,MAAM,EAAE,OAAO,UAAU;AAEzB,OAAK,OAAO,KAAK,+BAA+B,OAAO,aAAa;AAEpE,MAAI,MACA,MAAK,OAAO,KAAK,4BAA4B,QAAQ;EAGzD,MAAM,SAAS,gBAAgB;AAM/B,QAAMA,MALS,mBAAmB;GAC9B;GACA;GACA,GAAI,QAAQ,EAAE,OAAO,KAAK,QAAQ,QAAQ,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE;GACjE,CAAC,CACuB;;GChFhC"}
@@ -63,5 +63,5 @@
63
63
  "summary": "Build the project using predefined library build presets."
64
64
  }
65
65
  },
66
- "version": "0.0.106"
66
+ "version": "0.0.107"
67
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpp-toolkit/plugin-build-lib",
3
- "version": "0.0.106",
3
+ "version": "0.0.107",
4
4
  "description": "Plugin that add the library build command to the jpp cli.",
5
5
  "keywords": [
6
6
  "jpp",
@@ -35,9 +35,9 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@oclif/core": "4.10.5",
38
- "tsdown": "0.21.7",
38
+ "tsdown": "0.21.8",
39
39
  "@jpp-toolkit/core": "0.0.45",
40
- "@jpp-toolkit/tsdown-config": "0.0.54",
40
+ "@jpp-toolkit/tsdown-config": "0.0.55",
41
41
  "@jpp-toolkit/utils": "0.0.33"
42
42
  },
43
43
  "devDependencies": {