@decohere/flux 0.0.1-dev.93 → 0.0.1-dev.95

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.
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "FluxModule", {
8
8
  return FluxModule;
9
9
  }
10
10
  });
11
- const _mesh = require("@decohere/mesh");
11
+ const _forge = require("@decohere/forge");
12
12
  const _cli = require("@decohere/nexus/cli");
13
13
  const _deferredscriptrunner = require("./deferred-script-runner.js");
14
14
  const _fluxcommand = require("./flux.command.js");
@@ -27,8 +27,7 @@ class FluxModule extends _cli.ModuleManifest {
27
27
  builder.registerSingleton(_deferredscriptrunner.DeferredScriptRunner);
28
28
  }
29
29
  createWorkspace(options) {
30
- return _mesh.WorkspaceFactory.create({
31
- configFile: options.configFile
32
- });
30
+ // Same workspace as `flux.run` / `flux.serve` and forge (#516).
31
+ return (0, _forge.createWorkspace)(options);
33
32
  }
34
33
  }
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "SourceModuleLoader", {
10
10
  });
11
11
  const _nodemodule = require("node:module");
12
12
  const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
13
+ const _nodeurl = require("node:url");
13
14
  const _decorators = require("@decohere/crucible/decorators");
14
15
  const _forge = require("@decohere/forge");
15
16
  const _mesh = require("@decohere/mesh");
@@ -102,10 +103,7 @@ class SourceModuleLoader {
102
103
  this.disposed = false;
103
104
  this.transpileCache.clear();
104
105
  this.buildConfig = options.buildConfig;
105
- this.workspace = options.workspace ?? await _mesh.WorkspaceFactory.create({
106
- ..._forge.WorkspaceDefaults,
107
- rootDir: process.cwd()
108
- });
106
+ this.workspace = options.workspace ?? await (0, _forge.createWorkspace)();
109
107
  this.versionFileUrl = options.versionFileUrl ?? ((fileUrl)=>fileUrl);
110
108
  this.onResolved = options.onResolved;
111
109
  this.fileInfoMap = await this.buildFileInfoMap(this.buildConfig);
@@ -182,7 +180,9 @@ class SourceModuleLoader {
182
180
  }
183
181
  loadTs(url) {
184
182
  if (!url.startsWith("file:")) return null;
185
- const cleanPath = new URL(url).pathname;
183
+ // fileURLToPath, not URL.pathname: decodes %20 and gives Windows paths, so files
184
+ // whose path has a space still match Mesh's list (#511).
185
+ const cleanPath = (0, _nodeurl.fileURLToPath)(url);
186
186
  const fileInfo = this.fileInfoMap.get(cleanPath);
187
187
  if (fileInfo == null) return null;
188
188
  const cached = this.transpileCache.get(cleanPath);
@@ -1,4 +1,4 @@
1
- import { WorkspaceFactory } from "@decohere/mesh";
1
+ import { createWorkspace } from "@decohere/forge";
2
2
  import { ModuleManifest } from "@decohere/nexus/cli";
3
3
  import { DeferredScriptRunner } from "./deferred-script-runner.js";
4
4
  import { FluxCommand } from "./flux.command.js";
@@ -17,8 +17,7 @@ export class FluxModule extends ModuleManifest {
17
17
  builder.registerSingleton(DeferredScriptRunner);
18
18
  }
19
19
  createWorkspace(options) {
20
- return WorkspaceFactory.create({
21
- configFile: options.configFile
22
- });
20
+ // Same workspace as `flux.run` / `flux.serve` and forge (#516).
21
+ return createWorkspace(options);
23
22
  }
24
23
  }
@@ -6,9 +6,10 @@ function _ts_decorate(decorators, target, key, desc) {
6
6
  }
7
7
  import { registerHooks } from "node:module";
8
8
  import path from "node:path";
9
+ import { fileURLToPath } from "node:url";
9
10
  import { injectable } from "@decohere/crucible/decorators";
10
- import { BuildTargets, SwcTranspiler, WorkspaceDefaults } from "@decohere/forge";
11
- import { packageAliases, WorkspaceFactory } from "@decohere/mesh";
11
+ import { BuildTargets, createWorkspace, SwcTranspiler } from "@decohere/forge";
12
+ import { packageAliases } from "@decohere/mesh";
12
13
  import { FileEx, io } from "@decohere/nexus/io";
13
14
  import { scribe } from "@decohere/scribe";
14
15
  import { rewriteServeSpecifier } from "./rewrite-serve-specifier.js";
@@ -46,10 +47,7 @@ export class SourceModuleLoader {
46
47
  this.disposed = false;
47
48
  this.transpileCache.clear();
48
49
  this.buildConfig = options.buildConfig;
49
- this.workspace = options.workspace ?? await WorkspaceFactory.create({
50
- ...WorkspaceDefaults,
51
- rootDir: process.cwd()
52
- });
50
+ this.workspace = options.workspace ?? await createWorkspace();
53
51
  this.versionFileUrl = options.versionFileUrl ?? ((fileUrl)=>fileUrl);
54
52
  this.onResolved = options.onResolved;
55
53
  this.fileInfoMap = await this.buildFileInfoMap(this.buildConfig);
@@ -126,7 +124,9 @@ export class SourceModuleLoader {
126
124
  }
127
125
  loadTs(url) {
128
126
  if (!url.startsWith("file:")) return null;
129
- const cleanPath = new URL(url).pathname;
127
+ // fileURLToPath, not URL.pathname: decodes %20 and gives Windows paths, so files
128
+ // whose path has a space still match Mesh's list (#511).
129
+ const cleanPath = fileURLToPath(url);
130
130
  const fileInfo = this.fileInfoMap.get(cleanPath);
131
131
  if (fileInfo == null) return null;
132
132
  const cached = this.transpileCache.get(cleanPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decohere/flux",
3
- "version": "0.0.1-dev.93",
3
+ "version": "0.0.1-dev.95",
4
4
  "description": "Hot module reload server for Node.js ESM applications",
5
5
  "keywords": [
6
6
  "typescript",
@@ -25,11 +25,11 @@
25
25
  "test": "echo \"Error: no test specified\" && exit 1"
26
26
  },
27
27
  "dependencies": {
28
- "@decohere/crucible": "0.0.1-dev.93",
29
- "@decohere/forge": "0.0.1-dev.93",
30
- "@decohere/mesh": "0.0.1-dev.93",
31
- "@decohere/nexus": "0.0.1-dev.93",
32
- "@decohere/scribe": "0.0.1-dev.93",
28
+ "@decohere/crucible": "0.0.1-dev.95",
29
+ "@decohere/forge": "0.0.1-dev.95",
30
+ "@decohere/mesh": "0.0.1-dev.95",
31
+ "@decohere/nexus": "0.0.1-dev.95",
32
+ "@decohere/scribe": "0.0.1-dev.95",
33
33
  "commander": "^13.1.0",
34
34
  "rxjs": "^7.8.2"
35
35
  },