@jpp-toolkit/plugin-build-react 0.0.10 → 0.0.12

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
@@ -23,7 +23,7 @@ var ReactBuildCommand = class ReactBuildCommand extends Command {
23
23
  const { flags: { watch } } = await this.parse(ReactBuildCommand);
24
24
  const config = createReactRspackConfig(void 0, { isProduction: !watch })({
25
25
  RSPACK_BUILD: !watch,
26
- RSPACK_WATCH: watch
26
+ RSPACK_SERVE: watch
27
27
  });
28
28
  const compiler = rspack(config);
29
29
  const compilerCallback = (err, stats) => {
@@ -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_WATCH: 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,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"}
@@ -32,5 +32,5 @@
32
32
  "summary": "Build React project using Rspack."
33
33
  }
34
34
  },
35
- "version": "0.0.10"
35
+ "version": "0.0.12"
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpp-toolkit/plugin-build-react",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Plugin that add the react build command to the jpp cli.",
5
5
  "keywords": [
6
6
  "jpp",
@@ -37,8 +37,8 @@
37
37
  "@oclif/core": "4.8.0",
38
38
  "@rspack/core": "1.7.3",
39
39
  "@rspack/dev-server": "1.2.1",
40
- "@jpp-toolkit/core": "0.0.23",
41
- "@jpp-toolkit/rspack-config": "0.0.20"
40
+ "@jpp-toolkit/core": "0.0.24",
41
+ "@jpp-toolkit/rspack-config": "0.0.21"
42
42
  },
43
43
  "devDependencies": {
44
44
  "oclif": "4.22.70"
@@ -36,7 +36,7 @@ export class ReactBuildCommand extends Command {
36
36
  isProduction: !watch,
37
37
  })({
38
38
  RSPACK_BUILD: !watch,
39
- RSPACK_WATCH: watch,
39
+ RSPACK_SERVE: watch,
40
40
  });
41
41
  const compiler = rspack(config);
42
42