@jpp-toolkit/plugin-build-react 0.0.40 → 0.0.42

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
@@ -3,7 +3,6 @@ import { createReactRspackConfig } from "@jpp-toolkit/rspack-config";
3
3
  import { Flags } from "@oclif/core";
4
4
  import { rspack } from "@rspack/core";
5
5
  import { RspackDevServer } from "@rspack/dev-server";
6
-
7
6
  //#region src/react-build-command.ts
8
7
  var ReactBuildCommand = class ReactBuildCommand extends Command {
9
8
  static summary = "Build React project using Rspack.";
@@ -49,11 +48,10 @@ var ReactBuildCommand = class ReactBuildCommand extends Command {
49
48
  });
50
49
  }
51
50
  };
52
-
53
51
  //#endregion
54
52
  //#region src/index.ts
55
53
  const commands = { "build:react": ReactBuildCommand };
56
-
57
54
  //#endregion
58
55
  export { commands };
56
+
59
57
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/react-build-command.ts","../src/index.ts"],"sourcesContent":["import { Command } from '@jpp-toolkit/core';\nimport { createReactRspackConfig } from '@jpp-toolkit/rspack-config';\nimport { Flags } from '@oclif/core';\nimport type { MultiStats, Stats } from '@rspack/core';\nimport { rspack } from '@rspack/core';\nimport { RspackDevServer } from '@rspack/dev-server';\n\nexport class ReactBuildCommand extends Command {\n static override summary = 'Build React project using Rspack.';\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 };\n\n static override examples = [\n {\n description: 'Build the React project once.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Build the React project in watch mode.',\n command: '<%= config.bin %> <%= command.id %> --watch',\n },\n ];\n\n public async run(): Promise<void> {\n const {\n flags: { watch },\n } = await this.parse(ReactBuildCommand);\n\n const config = createReactRspackConfig(undefined, {\n isProduction: !watch,\n })({\n RSPACK_BUILD: !watch,\n RSPACK_SERVE: watch,\n });\n const compiler = rspack(config);\n\n const compilerCallback = (err: Error | null, stats: Stats | MultiStats | undefined) => {\n if (err) {\n this.logger.error(err.toString());\n return;\n }\n if (!stats) return;\n this.logger.log(stats.toString({ preset: 'normal', colors: true }), '\\n');\n };\n\n if (watch) {\n const devServerOptions = config.devServer ?? {};\n devServerOptions.hot = true;\n const devServer = new RspackDevServer(devServerOptions, compiler);\n await devServer.start();\n } else {\n compiler.run((error: Error | null, stats: Stats | MultiStats | undefined) => {\n compiler.close((closeErr) => {\n if (closeErr) this.logger.error(closeErr.toString());\n compilerCallback(error, stats);\n });\n });\n }\n }\n}\n","import { ReactBuildCommand } from './react-build-command';\n\nexport const commands = {\n 'build:react': ReactBuildCommand,\n};\n"],"mappings":";;;;;;;AAOA,IAAa,oBAAb,MAAa,0BAA0B,QAAQ;CAC3C,OAAgB,UAAU;CAE1B,OAAgB,QAAQ,EACpB,OAAO,MAAM,QAAQ;EACjB,MAAM;EACN,aAAa;EACb,SAAS;EACZ,CAAC,EACL;CAED,OAAgB,WAAW,CACvB;EACI,aAAa;EACb,SAAS;EACZ,EACD;EACI,aAAa;EACb,SAAS;EACZ,CACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EACF,OAAO,EAAE,YACT,MAAM,KAAK,MAAM,kBAAkB;EAEvC,MAAM,SAAS,wBAAwB,QAAW,EAC9C,cAAc,CAAC,OAClB,CAAC,CAAC;GACC,cAAc,CAAC;GACf,cAAc;GACjB,CAAC;EACF,MAAM,WAAW,OAAO,OAAO;EAE/B,MAAM,oBAAoB,KAAmB,UAA0C;AACnF,OAAI,KAAK;AACL,SAAK,OAAO,MAAM,IAAI,UAAU,CAAC;AACjC;;AAEJ,OAAI,CAAC,MAAO;AACZ,QAAK,OAAO,IAAI,MAAM,SAAS;IAAE,QAAQ;IAAU,QAAQ;IAAM,CAAC,EAAE,KAAK;;AAG7E,MAAI,OAAO;GACP,MAAM,mBAAmB,OAAO,aAAa,EAAE;AAC/C,oBAAiB,MAAM;AAEvB,SADkB,IAAI,gBAAgB,kBAAkB,SAAS,CACjD,OAAO;QAEvB,UAAS,KAAK,OAAqB,UAA0C;AACzE,YAAS,OAAO,aAAa;AACzB,QAAI,SAAU,MAAK,OAAO,MAAM,SAAS,UAAU,CAAC;AACpD,qBAAiB,OAAO,MAAM;KAChC;IACJ;;;;;;AC5Dd,MAAa,WAAW,EACpB,eAAe,mBAClB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/react-build-command.ts","../src/index.ts"],"sourcesContent":["import { Command } from '@jpp-toolkit/core';\nimport { createReactRspackConfig } from '@jpp-toolkit/rspack-config';\nimport { Flags } from '@oclif/core';\nimport type { MultiStats, Stats } from '@rspack/core';\nimport { rspack } from '@rspack/core';\nimport { RspackDevServer } from '@rspack/dev-server';\n\nexport class ReactBuildCommand extends Command {\n static override summary = 'Build React project using Rspack.';\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 };\n\n static override examples = [\n {\n description: 'Build the React project once.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Build the React project in watch mode.',\n command: '<%= config.bin %> <%= command.id %> --watch',\n },\n ];\n\n public async run(): Promise<void> {\n const {\n flags: { watch },\n } = await this.parse(ReactBuildCommand);\n\n const config = createReactRspackConfig(undefined, {\n isProduction: !watch,\n })({\n RSPACK_BUILD: !watch,\n RSPACK_SERVE: watch,\n });\n const compiler = rspack(config);\n\n const compilerCallback = (err: Error | null, stats: Stats | MultiStats | undefined) => {\n if (err) {\n this.logger.error(err.toString());\n return;\n }\n if (!stats) return;\n this.logger.log(stats.toString({ preset: 'normal', colors: true }), '\\n');\n };\n\n if (watch) {\n const devServerOptions = config.devServer ?? {};\n devServerOptions.hot = true;\n const devServer = new RspackDevServer(devServerOptions, compiler);\n await devServer.start();\n } else {\n compiler.run((error: Error | null, stats: Stats | MultiStats | undefined) => {\n compiler.close((closeErr) => {\n if (closeErr) this.logger.error(closeErr.toString());\n compilerCallback(error, stats);\n });\n });\n }\n }\n}\n","import { ReactBuildCommand } from './react-build-command';\n\nexport const commands = {\n 'build:react': ReactBuildCommand,\n};\n"],"mappings":";;;;;;AAOA,IAAa,oBAAb,MAAa,0BAA0B,QAAQ;CAC3C,OAAgB,UAAU;CAE1B,OAAgB,QAAQ,EACpB,OAAO,MAAM,QAAQ;EACjB,MAAM;EACN,aAAa;EACb,SAAS;EACZ,CAAC,EACL;CAED,OAAgB,WAAW,CACvB;EACI,aAAa;EACb,SAAS;EACZ,EACD;EACI,aAAa;EACb,SAAS;EACZ,CACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EACF,OAAO,EAAE,YACT,MAAM,KAAK,MAAM,kBAAkB;EAEvC,MAAM,SAAS,wBAAwB,KAAA,GAAW,EAC9C,cAAc,CAAC,OAClB,CAAC,CAAC;GACC,cAAc,CAAC;GACf,cAAc;GACjB,CAAC;EACF,MAAM,WAAW,OAAO,OAAO;EAE/B,MAAM,oBAAoB,KAAmB,UAA0C;AACnF,OAAI,KAAK;AACL,SAAK,OAAO,MAAM,IAAI,UAAU,CAAC;AACjC;;AAEJ,OAAI,CAAC,MAAO;AACZ,QAAK,OAAO,IAAI,MAAM,SAAS;IAAE,QAAQ;IAAU,QAAQ;IAAM,CAAC,EAAE,KAAK;;AAG7E,MAAI,OAAO;GACP,MAAM,mBAAmB,OAAO,aAAa,EAAE;AAC/C,oBAAiB,MAAM;AAEvB,SADkB,IAAI,gBAAgB,kBAAkB,SAAS,CACjD,OAAO;QAEvB,UAAS,KAAK,OAAqB,UAA0C;AACzE,YAAS,OAAO,aAAa;AACzB,QAAI,SAAU,MAAK,OAAO,MAAM,SAAS,UAAU,CAAC;AACpD,qBAAiB,OAAO,MAAM;KAChC;IACJ;;;;;AC5Dd,MAAa,WAAW,EACpB,eAAe,mBAClB"}
@@ -32,5 +32,5 @@
32
32
  "summary": "Build React project using Rspack."
33
33
  }
34
34
  },
35
- "version": "0.0.40"
35
+ "version": "0.0.42"
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpp-toolkit/plugin-build-react",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "Plugin that add the react build command to the jpp cli.",
5
5
  "keywords": [
6
6
  "jpp",
@@ -41,7 +41,7 @@
41
41
  "@jpp-toolkit/rspack-config": "0.0.38"
42
42
  },
43
43
  "devDependencies": {
44
- "oclif": "4.22.82"
44
+ "oclif": "4.22.84"
45
45
  },
46
46
  "engines": {
47
47
  "node": "24",