@windwalker-io/fusion-next 0.1.0 → 0.1.2

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.cjs CHANGED
@@ -1990,6 +1990,7 @@ class ConfigBuilder {
1990
1990
  },
1991
1991
  build: {
1992
1992
  manifest: "manifest.json",
1993
+ assetsInlineLimit: 0,
1993
1994
  rollupOptions: {
1994
1995
  preserveEntrySignatures: "strict",
1995
1996
  input: {},
@@ -2030,6 +2031,7 @@ class ConfigBuilder {
2030
2031
  copyTasks = [];
2031
2032
  linkTasks = [];
2032
2033
  postBuildCallbacks = [];
2034
+ serverStopCallbacks = [];
2033
2035
  resolveIdCallbacks = [];
2034
2036
  loadCallbacks = [];
2035
2037
  // fileNameMap: Record<string, string> = {};
@@ -2852,8 +2854,8 @@ is not a problem with esbuild. You need to fix your environment instead.
2852
2854
  if (isFirstPacket) {
2853
2855
  isFirstPacket = false;
2854
2856
  let binaryVersion = String.fromCharCode(...bytes);
2855
- if (binaryVersion !== "0.25.9") {
2856
- throw new Error(`Cannot start service: Host version "${"0.25.9"}" does not match binary version ${quote(binaryVersion)}`);
2857
+ if (binaryVersion !== "0.25.10") {
2858
+ throw new Error(`Cannot start service: Host version "${"0.25.10"}" does not match binary version ${quote(binaryVersion)}`);
2857
2859
  }
2858
2860
  return;
2859
2861
  }
@@ -3979,7 +3981,7 @@ for your current platform.`);
3979
3981
  "node_modules",
3980
3982
  ".cache",
3981
3983
  "esbuild",
3982
- `pnpapi-${pkg.replace("/", "-")}-${"0.25.9"}-${path.basename(subpath)}`
3984
+ `pnpapi-${pkg.replace("/", "-")}-${"0.25.10"}-${path.basename(subpath)}`
3983
3985
  );
3984
3986
  if (!fs.existsSync(binTargetPath)) {
3985
3987
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -4014,7 +4016,7 @@ for your current platform.`);
4014
4016
  }
4015
4017
  }
4016
4018
  var _a;
4017
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.9";
4019
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.10";
4018
4020
  var esbuildCommandAndArgs = () => {
4019
4021
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
4020
4022
  throw new Error(
@@ -4079,7 +4081,7 @@ for your current platform.`);
4079
4081
  }
4080
4082
  }
4081
4083
  };
4082
- var version = "0.25.9";
4084
+ var version = "0.25.10";
4083
4085
  var build = (options) => ensureServiceIsRunning().build(options);
4084
4086
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
4085
4087
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -4182,7 +4184,7 @@ for your current platform.`);
4182
4184
  var ensureServiceIsRunning = () => {
4183
4185
  if (longLivedService) return longLivedService;
4184
4186
  let [command, args] = esbuildCommandAndArgs();
4185
- let child = child_process.spawn(command, args.concat(`--service=${"0.25.9"}`, "--ping"), {
4187
+ let child = child_process.spawn(command, args.concat(`--service=${"0.25.10"}`, "--ping"), {
4186
4188
  windowsHide: true,
4187
4189
  stdio: ["pipe", "pipe", "inherit"],
4188
4190
  cwd: defaultWD
@@ -4286,7 +4288,7 @@ for your current platform.`);
4286
4288
  esbuild: node_exports
4287
4289
  });
4288
4290
  callback(service);
4289
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.9"}`), {
4291
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.10"}`), {
4290
4292
  cwd: defaultWD,
4291
4293
  windowsHide: true,
4292
4294
  input: stdin,
@@ -4306,7 +4308,7 @@ for your current platform.`);
4306
4308
  var startWorkerThreadService = (worker_threads2) => {
4307
4309
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
4308
4310
  let worker = new worker_threads2.Worker(__filename, {
4309
- workerData: { workerPort, defaultWD, esbuildVersion: "0.25.9" },
4311
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.25.10" },
4310
4312
  transferList: [workerPort],
4311
4313
  // From node's documentation: https://nodejs.org/api/worker_threads.html
4312
4314
  //
@@ -8924,6 +8926,9 @@ function useFusion(fusionOptions = {}, tasks) {
8924
8926
  fs$1.writeFileSync(node_path.resolve(server.config.root, serverFile), url);
8925
8927
  if (!exitHandlersBound) {
8926
8928
  process.on("exit", () => {
8929
+ for (const callback of exports.builder.serverStopCallbacks) {
8930
+ callback(resolvedConfig, server);
8931
+ }
8927
8932
  if (fs$1.existsSync(serverFile)) {
8928
8933
  fs$1.rmSync(serverFile);
8929
8934
  }
@@ -8955,12 +8960,18 @@ function useFusion(fusionOptions = {}, tasks) {
8955
8960
  } else {
8956
8961
  server.ws.send({
8957
8962
  type: "update",
8958
- updates: [...mods].map((m) => ({
8959
- type: updateType,
8960
- path: m.url,
8961
- acceptedPath: m.url,
8962
- timestamp: Date.now()
8963
- }))
8963
+ updates: [...mods].map((m) => {
8964
+ let url = m.url;
8965
+ if (url.indexOf("?") !== -1) {
8966
+ url = url.substring(0, url.indexOf("?"));
8967
+ }
8968
+ return {
8969
+ type: updateType,
8970
+ path: url,
8971
+ acceptedPath: url,
8972
+ timestamp: Date.now()
8973
+ };
8974
+ })
8964
8975
  });
8965
8976
  }
8966
8977
  }