@rspack/cli 0.0.0-01dbf86423-20221210100716

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/bin/rspack ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ try {
3
+ require("source-map-support").install({
4
+ handleUncaughtExceptions: false
5
+ });
6
+ } catch (err) {}
7
+ const runCLI = require("../dist/bootstrap").runCLI;
8
+ runCLI(process.argv);
@@ -0,0 +1,2 @@
1
+ export declare function runCLI(argv: string[]): Promise<void>;
2
+ //# sourceMappingURL=bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAEA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,iBAG1C"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runCLI = void 0;
4
+ const rspack_cli_1 = require("./rspack-cli");
5
+ async function runCLI(argv) {
6
+ const cli = new rspack_cli_1.RspackCLI();
7
+ await cli.run(argv);
8
+ }
9
+ exports.runCLI = runCLI;
10
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAElC,KAAK,UAAU,MAAM,CAAC,IAAc;IAC1C,MAAM,GAAG,GAAG,IAAI,sBAAS,EAAE,CAAC;IAC5B,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AAHD,wBAGC"}
@@ -0,0 +1,6 @@
1
+ import type { RspackCLI } from "../rspack-cli";
2
+ import { RspackCommand } from "../types";
3
+ export declare class BuildCommand implements RspackCommand {
4
+ apply(cli: RspackCLI): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,qBAAa,YAAa,YAAW,aAAa;IAC3C,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAiF1C"}
@@ -0,0 +1,104 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.BuildCommand = void 0;
27
+ const fs = __importStar(require("fs"));
28
+ const options_1 = require("../utils/options");
29
+ class BuildCommand {
30
+ async apply(cli) {
31
+ cli.program.command(["build [entry..]", "$0", "bundle", "b"], "run the rspack build", yargs => (0, options_1.commonOptions)(yargs).options({
32
+ analyze: {
33
+ type: "boolean",
34
+ default: false,
35
+ describe: "analyze"
36
+ },
37
+ json: {
38
+ describe: "emit stats json"
39
+ }
40
+ }), async (options) => {
41
+ const logger = cli.getLogger();
42
+ let createJsonStringifyStream;
43
+ if (options.json) {
44
+ const jsonExt = await Promise.resolve().then(() => __importStar(require("@discoveryjs/json-ext")));
45
+ createJsonStringifyStream = jsonExt.stringifyStream;
46
+ }
47
+ const callback = (error, stats) => {
48
+ if (error) {
49
+ logger.error(error);
50
+ process.exit(2);
51
+ }
52
+ if (stats && stats.hasErrors()) {
53
+ process.exitCode = 1;
54
+ }
55
+ if (!compiler || !stats) {
56
+ return;
57
+ }
58
+ const statsOptions = compiler.options
59
+ ? compiler.options.stats
60
+ : undefined;
61
+ if (options.json && createJsonStringifyStream) {
62
+ const handleWriteError = error => {
63
+ logger.error(error);
64
+ process.exit(2);
65
+ };
66
+ if (options.json === true) {
67
+ createJsonStringifyStream(stats.toJson(statsOptions))
68
+ .on("error", handleWriteError)
69
+ .pipe(process.stdout)
70
+ .on("error", handleWriteError)
71
+ .on("close", () => process.stdout.write("\n"));
72
+ }
73
+ else if (typeof options.json === "string") {
74
+ createJsonStringifyStream(stats.toJson(statsOptions))
75
+ .on("error", handleWriteError)
76
+ .pipe(fs.createWriteStream(options.json))
77
+ .on("error", handleWriteError)
78
+ // Use stderr to logging
79
+ .on("close", () => {
80
+ process.stderr.write(`[rspack-cli] ${cli.colors.green(`stats are successfully stored as json to ${options.json}`)}\n`);
81
+ });
82
+ }
83
+ }
84
+ else {
85
+ const printedStats = stats.toString(statsOptions);
86
+ // Avoid extra empty line when `stats: 'none'`
87
+ if (printedStats) {
88
+ logger.raw(printedStats);
89
+ }
90
+ }
91
+ };
92
+ console.time("build");
93
+ const rspackOptions = { ...options };
94
+ rspackOptions.argv = options;
95
+ const compiler = await cli.createCompiler(rspackOptions, "production");
96
+ compiler.run((err, Stats) => {
97
+ callback(err, Stats);
98
+ console.timeEnd("build");
99
+ });
100
+ });
101
+ }
102
+ }
103
+ exports.BuildCommand = BuildCommand;
104
+ //# sourceMappingURL=build.js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AAQ,CAAC,YAAY,CAAC,CAAC;oBAClD,8CAA8C;oBAC9C,IAAI,YAAY,EAAE;wBACjB,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;qBACzB;iBACD;YACF,CAAC,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,aAAa,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;YACrC,aAAa,CAAC,IAAI,GAAG,OAAO,CAAC;YAC7B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;YACvE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;gBAC3B,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACrB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;QACJ,CAAC,CACD,CAAC;IACH,CAAC;CACD;AAlFD,oCAkFC"}
@@ -0,0 +1,6 @@
1
+ import type { RspackCLI } from "../rspack-cli";
2
+ import { RspackCommand } from "../types";
3
+ export declare class ServeCommand implements RspackCommand {
4
+ apply(cli: RspackCLI): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,qBAAa,YAAa,YAAW,aAAa;IAC3C,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAe1C"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServeCommand = void 0;
4
+ const dev_server_1 = require("@rspack/dev-server");
5
+ const options_1 = require("../utils/options");
6
+ class ServeCommand {
7
+ async apply(cli) {
8
+ cli.program.command(["serve [entry..]", "server", "s"], "run the rspack dev server.", options_1.commonOptions, async (options) => {
9
+ const rspackOptions = { ...options };
10
+ // Todo will support more complex options in the future
11
+ rspackOptions.argv = options;
12
+ const compiler = await cli.createCompiler(rspackOptions, "development");
13
+ const server = new dev_server_1.RspackDevServer(compiler);
14
+ await server.start();
15
+ });
16
+ }
17
+ }
18
+ exports.ServeCommand = ServeCommand;
19
+ //# sourceMappingURL=serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;AACA,mDAAqD;AAErD,8CAAiD;AACjD,MAAa,YAAY;IACxB,KAAK,CAAC,KAAK,CAAC,GAAc;QACzB,GAAG,CAAC,OAAO,CAAC,OAAO,CAClB,CAAC,iBAAiB,EAAE,QAAQ,EAAE,GAAG,CAAC,EAClC,4BAA4B,EAC5B,uBAAa,EACb,KAAK,EAAC,OAAO,EAAC,EAAE;YACf,MAAM,aAAa,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;YACrC,uDAAuD;YACvD,aAAa,CAAC,IAAI,GAAG,OAAO,CAAC;YAC7B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YACxE,MAAM,MAAM,GAAG,IAAI,4BAAe,CAAC,QAAQ,CAAC,CAAC;YAC7C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC,CACD,CAAC;IACH,CAAC;CACD;AAhBD,oCAgBC"}
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export { RspackCLI } from "./rspack-cli";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
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
+ exports.RspackCLI = void 0;
18
+ __exportStar(require("./types"), exports);
19
+ var rspack_cli_1 = require("./rspack-cli");
20
+ Object.defineProperty(exports, "RspackCLI", { enumerable: true, get: function () { return rspack_cli_1.RspackCLI; } });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,0CAAwB;AACxB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA"}
@@ -0,0 +1,18 @@
1
+ import yargs from "yargs";
2
+ import { RspackCLIColors, RspackCLILogger, RspackCLIOptions } from "./types";
3
+ import { RspackOptions } from "@rspack/core";
4
+ declare type RspackEnv = "development" | "production";
5
+ export declare class RspackCLI {
6
+ colors: RspackCLIColors;
7
+ program: yargs.Argv<{}>;
8
+ constructor();
9
+ createCompiler(options: RspackCLIOptions, rspackEnv: RspackEnv): Promise<import("@rspack/core/src/compiler").Compiler>;
10
+ createColors(useColor?: boolean): RspackCLIColors;
11
+ getLogger(): RspackCLILogger;
12
+ run(argv: string[]): Promise<void>;
13
+ registerCommands(): Promise<void>;
14
+ buildConfig(item: any, options: RspackCLIOptions, rspackEnv: RspackEnv): Promise<any>;
15
+ loadConfig(options: RspackCLIOptions): Promise<RspackOptions>;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=rspack-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack-cli.d.ts","sourceRoot":"","sources":["../src/rspack-cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG7E,OAAO,EAAU,aAAa,EAAkB,MAAM,cAAc,CAAC;AAIrE,aAAK,SAAS,GAAG,aAAa,GAAG,YAAY,CAAC;AAC9C,qBAAa,SAAS;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;IAKlB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS;IAMpE,YAAY,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,eAAe;IAgBjD,SAAS,IAAI,eAAe;IAWtB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE;IAMlB,gBAAgB;IAMhB,WAAW,CAChB,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,SAAS;IAmEf,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;CAuCnE"}
@@ -0,0 +1,191 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.RspackCLI = void 0;
30
+ const helpers_1 = require("yargs/helpers");
31
+ const yargs_1 = __importDefault(require("yargs"));
32
+ const util_1 = __importDefault(require("util"));
33
+ const path_1 = __importDefault(require("path"));
34
+ const fs_1 = __importDefault(require("fs"));
35
+ const build_1 = require("./commands/build");
36
+ const serve_1 = require("./commands/serve");
37
+ const core_1 = require("@rspack/core");
38
+ const defaultConfig = "rspack.config.js";
39
+ const defaultEntry = "src/index.js";
40
+ class RspackCLI {
41
+ constructor() {
42
+ this.colors = this.createColors();
43
+ this.program = (0, yargs_1.default)();
44
+ }
45
+ async createCompiler(options, rspackEnv) {
46
+ let config = await this.loadConfig(options);
47
+ config = await this.buildConfig(config, options, rspackEnv);
48
+ const compiler = (0, core_1.createCompiler)(config);
49
+ return compiler;
50
+ }
51
+ createColors(useColor) {
52
+ const { createColors, isColorSupported } = require("colorette");
53
+ let shouldUseColor;
54
+ if (useColor) {
55
+ shouldUseColor = useColor;
56
+ }
57
+ else {
58
+ shouldUseColor = isColorSupported;
59
+ }
60
+ return {
61
+ ...createColors({ useColor: shouldUseColor }),
62
+ isColorSupported: shouldUseColor
63
+ };
64
+ }
65
+ getLogger() {
66
+ return {
67
+ error: val => console.error(`[rspack-cli] ${this.colors.red(util_1.default.format(val))}`),
68
+ warn: val => console.warn(`[rspack-cli] ${this.colors.yellow(val)}`),
69
+ info: val => console.info(`[rspack-cli] ${this.colors.cyan(val)}`),
70
+ success: val => console.log(`[rspack-cli] ${this.colors.green(val)}`),
71
+ log: val => console.log(`[rspack-cli] ${val}`),
72
+ raw: val => console.log(val)
73
+ };
74
+ }
75
+ async run(argv) {
76
+ this.program.usage("[options]");
77
+ this.program.scriptName("rspack");
78
+ this.registerCommands();
79
+ await this.program.parseAsync((0, helpers_1.hideBin)(argv));
80
+ }
81
+ async registerCommands() {
82
+ const builtinCommands = [new build_1.BuildCommand(), new serve_1.ServeCommand()];
83
+ for (const command of builtinCommands) {
84
+ command.apply(this);
85
+ }
86
+ }
87
+ async buildConfig(item, options, rspackEnv) {
88
+ var _a, _b, _c, _d, _e;
89
+ const isEnvProduction = rspackEnv === "production";
90
+ const isEnvDevelopment = rspackEnv === "development";
91
+ if (options.analyze) {
92
+ const { BundleAnalyzerPlugin } = await Promise.resolve().then(() => __importStar(require("webpack-bundle-analyzer")));
93
+ ((_a = item.plugins) !== null && _a !== void 0 ? _a : (item.plugins = [])).push({
94
+ name: "rspack-bundle-analyzer",
95
+ apply(compiler) {
96
+ new BundleAnalyzerPlugin({
97
+ generateStatsFile: true,
98
+ // TODO: delete this once runtime refacted.
99
+ excludeAssets: "runtime.js"
100
+ }).apply(compiler);
101
+ }
102
+ });
103
+ }
104
+ // auto set default mode if user config don't set it
105
+ if (!item.mode) {
106
+ item.mode = rspackEnv !== null && rspackEnv !== void 0 ? rspackEnv : "none";
107
+ }
108
+ // user parameters always has highest priority than default mode and config mode
109
+ if (options.mode) {
110
+ item.mode = options.mode;
111
+ }
112
+ // false is also a valid value for sourcemap, so don't override it
113
+ if (typeof item.devtool === "undefined") {
114
+ item.devtool = isEnvProduction ? "source-map" : "cheap-module-source-map";
115
+ }
116
+ item.builtins = {
117
+ ...item.builtins,
118
+ minify: (_c = (_b = item.builtins) === null || _b === void 0 ? void 0 : _b.minify) !== null && _c !== void 0 ? _c : isEnvProduction
119
+ };
120
+ // Tells webpack to set process.env.NODE_ENV to a given string value.
121
+ // optimization.nodeEnv uses DefinePlugin unless set to false.
122
+ // optimization.nodeEnv defaults to mode if set, else falls back to 'production'.
123
+ // See doc: https://webpack.js.org/configuration/optimization/#optimizationnodeenv
124
+ // See source: https://github.com/webpack/webpack/blob/8241da7f1e75c5581ba535d127fa66aeb9eb2ac8/lib/WebpackOptionsApply.js#L563
125
+ // When mode is set to 'none', optimization.nodeEnv defaults to false.
126
+ if (item.mode !== "none") {
127
+ item.builtins.define = {
128
+ // User defined `process.env.NODE_ENV` always has highest priority than default define
129
+ "process.env.NODE_ENV": JSON.stringify(item.mode),
130
+ ...item.builtins.define
131
+ };
132
+ }
133
+ item.output = {
134
+ ...item.output,
135
+ publicPath: (_e = (_d = item.output) === null || _d === void 0 ? void 0 : _d.publicPath) !== null && _e !== void 0 ? _e : "/"
136
+ };
137
+ if (typeof item.stats === "undefined") {
138
+ item.stats = { preset: "normal" };
139
+ }
140
+ else if (typeof item.stats === "boolean") {
141
+ item.stats = item.stats ? { preset: "normal" } : { preset: "none" };
142
+ }
143
+ else if (typeof item.stats === "string") {
144
+ item.stats = { preset: item.stats };
145
+ }
146
+ if (this.colors.isColorSupported && !item.stats.colors) {
147
+ item.stats.colors = true;
148
+ }
149
+ return item;
150
+ }
151
+ async loadConfig(options) {
152
+ var _a;
153
+ let loadedConfig;
154
+ // if we pass config paras
155
+ if (options.config) {
156
+ const resolvedConfigPath = path_1.default.resolve(process.cwd(), options.config);
157
+ if (!fs_1.default.existsSync(resolvedConfigPath)) {
158
+ throw new Error(`config file "${resolvedConfigPath}" not exists`);
159
+ }
160
+ loadedConfig = require(resolvedConfigPath);
161
+ }
162
+ else {
163
+ let defaultConfigPath = path_1.default.resolve(process.cwd(), defaultConfig);
164
+ if (fs_1.default.existsSync(defaultConfigPath)) {
165
+ loadedConfig = require(defaultConfigPath);
166
+ }
167
+ else {
168
+ let entry = {};
169
+ if (options.entry) {
170
+ entry = {
171
+ main: options.entry.map(x => path_1.default.resolve(process.cwd(), x))[0] // Fix me when entry supports array
172
+ };
173
+ }
174
+ else {
175
+ entry = {
176
+ main: path_1.default.resolve(process.cwd(), defaultEntry)
177
+ };
178
+ }
179
+ loadedConfig = {
180
+ entry
181
+ };
182
+ }
183
+ }
184
+ if (typeof loadedConfig === "function") {
185
+ loadedConfig = loadedConfig((_a = options.argv) === null || _a === void 0 ? void 0 : _a.env, options.argv);
186
+ }
187
+ return loadedConfig;
188
+ }
189
+ }
190
+ exports.RspackCLI = RspackCLI;
191
+ //# sourceMappingURL=rspack-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack-cli.js","sourceRoot":"","sources":["../src/rspack-cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,kDAA0B;AAC1B,gDAAwB;AACxB,gDAAwB;AACxB,4CAAoB;AAEpB,4CAAgD;AAChD,4CAAgD;AAChD,uCAAqE;AACrE,MAAM,aAAa,GAAG,kBAAkB,CAAC;AACzC,MAAM,YAAY,GAAG,cAAc,CAAC;AAGpC,MAAa,SAAS;IAGrB;QACC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,IAAA,eAAK,GAAE,CAAC;IACxB,CAAC;IACD,KAAK,CAAC,cAAc,CAAC,OAAyB,EAAE,SAAoB;QACnE,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAC5D,MAAM,QAAQ,GAAG,IAAA,qBAAc,EAAC,MAAM,CAAC,CAAC;QACxC,OAAO,QAAQ,CAAC;I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GAAG;wBACP,IAAI,EAAE,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC;qBAC/C,CAAC;iBACF;gBACD,YAAY,GAAG;oBACd,KAAK;iBACL,CAAC;aACF;SACD;QACD,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE;YACvC,YAAY,GAAG,YAAY,CAAC,MAAA,OAAO,CAAC,IAAI,0CAAE,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;SAC7D;QACD,OAAO,YAAY,CAAC;IACrB,CAAC;CACD;AAjKD,8BAiKC"}
@@ -0,0 +1,34 @@
1
+ import { Colorette } from "colorette";
2
+ import { RspackCLI } from "./rspack-cli";
3
+ import { WebpackOptionsNormalized } from "webpack";
4
+ export type { Configuration } from "@rspack/core";
5
+ import { Configuration as DevServerConfig } from "webpack-dev-server";
6
+ export interface IRspackCLI {
7
+ runRspack(): Promise<void>;
8
+ }
9
+ export declare type LogHandler = (value: any) => void;
10
+ export interface RspackCLIColors extends Colorette {
11
+ isColorSupported: boolean;
12
+ }
13
+ export interface RspackCLILogger {
14
+ error: LogHandler;
15
+ warn: LogHandler;
16
+ info: LogHandler;
17
+ success: LogHandler;
18
+ log: LogHandler;
19
+ raw: LogHandler;
20
+ }
21
+ export interface RspackCLIOptions {
22
+ entry?: string[];
23
+ config?: string;
24
+ devtool?: boolean;
25
+ mode?: string;
26
+ watch?: boolean;
27
+ analyze?: boolean;
28
+ argv?: Record<string, any>;
29
+ }
30
+ export interface RspackCommand {
31
+ apply(cli: RspackCLI): Promise<void>;
32
+ }
33
+ export declare type RspackDevServerOptions = DevServerConfig & WebpackOptionsNormalized;
34
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,MAAM,WAAW,UAAU;IAC1B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AACD,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;AAC9C,MAAM,WAAW,eAAgB,SAAQ,SAAS;IACjD,gBAAgB,EAAE,OAAO,CAAC;CAC1B;AACD,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,GAAG,EAAE,UAAU,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAChC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AACD,oBAAY,sBAAsB,GAAG,eAAe,GAAG,wBAAwB,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import yargs from "yargs";
2
+ export declare const commonOptions: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{
3
+ entry: string[];
4
+ }, "config" | "watch" | "mode" | "devtool"> & yargs.InferredOptionTypes<{
5
+ config: {
6
+ g: boolean;
7
+ type: "string";
8
+ describe: string;
9
+ alias: string;
10
+ };
11
+ mode: {
12
+ type: "string";
13
+ describe: string;
14
+ };
15
+ watch: {
16
+ type: "boolean";
17
+ default: boolean;
18
+ describe: string;
19
+ };
20
+ devtool: {
21
+ type: "boolean";
22
+ default: boolean;
23
+ describe: string;
24
+ };
25
+ }>>;
26
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/utils/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;GA0BzB,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commonOptions = void 0;
4
+ const commonOptions = (yargs) => {
5
+ return yargs
6
+ .positional("entry", {
7
+ type: "string",
8
+ array: true,
9
+ describe: "entry"
10
+ })
11
+ .options({
12
+ config: {
13
+ g: true,
14
+ type: "string",
15
+ describe: "config file",
16
+ alias: "c"
17
+ },
18
+ mode: { type: "string", describe: "mode" },
19
+ watch: {
20
+ type: "boolean",
21
+ default: false,
22
+ describe: "watch"
23
+ },
24
+ devtool: {
25
+ type: "boolean",
26
+ default: false,
27
+ describe: "devtool"
28
+ }
29
+ });
30
+ };
31
+ exports.commonOptions = commonOptions;
32
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/utils/options.ts"],"names":[],"mappings":";;;AACO,MAAM,aAAa,GAAG,CAAC,KAAqB,EAAE,EAAE;IACtD,OAAO,KAAK;SACV,UAAU,CAAC,OAAO,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,OAAO;KACjB,CAAC;SACD,OAAO,CAAC;QACR,MAAM,EAAE;YACP,CAAC,EAAE,IAAI;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,aAAa;YACvB,KAAK,EAAE,GAAG;SACV;QACD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE;QAC1C,KAAK,EAAE;YACN,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,OAAO;SACjB;QACD,OAAO,EAAE;YACR,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,SAAS;SACnB;KACD,CAAC,CAAC;AACL,CAAC,CAAC;AA1BW,QAAA,aAAa,iBA0BxB"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@rspack/cli",
3
+ "version": "0.0.0-01dbf86423-20221210100716",
4
+ "bin": {
5
+ "rspack": "./bin/rspack"
6
+ },
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "bin",
11
+ "dist"
12
+ ],
13
+ "devDependencies": {
14
+ "@types/webpack-bundle-analyzer": "^4.6.0",
15
+ "concat-stream": "^2.0.0",
16
+ "execa": "^5.0.0",
17
+ "internal-ip": "6.2.0",
18
+ "source-map-support": "^0.5.19",
19
+ "ts-node": "10.9.1"
20
+ },
21
+ "dependencies": {
22
+ "@discoveryjs/json-ext": "^0.5.7",
23
+ "colorette": "2.0.19",
24
+ "webpack": "5.74.0",
25
+ "webpack-bundle-analyzer": "4.6.1",
26
+ "webpack-dev-server": "4.11.1",
27
+ "yargs": "17.5.1",
28
+ "@rspack/dev-server": "0.0.0-01dbf86423-20221210100716",
29
+ "@rspack/core": "0.0.0-01dbf86423-20221210100716"
30
+ },
31
+ "scripts": {
32
+ "build": "rm -rf dist/ && tsc -b --force",
33
+ "dev": "tsc -b -w",
34
+ "test": "jest --verbose"
35
+ }
36
+ }