@jointhedots/gear 1.2.2 → 1.2.3

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.
Files changed (32) hide show
  1. package/esm/builder/build-app-bundle.d.ts +1 -0
  2. package/esm/builder/build-app-bundle.js +9 -5
  3. package/esm/builder/build-app-host.js +20 -18
  4. package/esm/builder/build-application.d.ts +4 -0
  5. package/esm/builder/build-application.js +52 -72
  6. package/esm/builder/build-library.d.ts +1 -0
  7. package/esm/builder/build-library.js +12 -8
  8. package/esm/builder/build-target.d.ts +13 -4
  9. package/esm/builder/build-target.js +20 -11
  10. package/esm/builder/helpers/emit-artifact.d.ts +13 -0
  11. package/esm/builder/helpers/emit-artifact.js +40 -0
  12. package/esm/builder/helpers/emit-bundle-manifest.d.ts +12 -2
  13. package/esm/builder/helpers/emit-bundle-manifest.js +37 -14
  14. package/esm/builder/helpers/emit-esmodules.d.ts +2 -2
  15. package/esm/builder/helpers/emit-esmodules.js +17 -17
  16. package/esm/builder/helpers/emit-package-manifest.js +1 -1
  17. package/esm/builder/helpers/emit-typescript-definition.js +1 -1
  18. package/esm/commands/install.js +1 -1
  19. package/esm/commands/make.d.ts +1 -0
  20. package/esm/commands/make.js +10 -2
  21. package/esm/commands/serve.js +8 -9
  22. package/esm/workspace/helpers/create-manifests.js +3 -3
  23. package/esm/workspace/helpers/discover-workspace.d.ts +2 -2
  24. package/esm/workspace/helpers/discover-workspace.js +19 -29
  25. package/esm/workspace/helpers/lockfile.d.ts +3 -3
  26. package/esm/workspace/helpers/lockfile.js +13 -13
  27. package/esm/workspace/helpers/logger.d.ts +1 -1
  28. package/esm/workspace/helpers/logger.js +1 -1
  29. package/esm/workspace/packagers/packager-standard.js +3 -3
  30. package/esm/workspace/workspace.d.ts +11 -7
  31. package/esm/workspace/workspace.js +26 -14
  32. package/package.json +74 -73
@@ -1,6 +1,7 @@
1
1
  import { type BundleID, type BundleManifest, type ComponentManifest, type DistributedConfig } from "./component.ts";
2
2
  import type { WebAppManifest } from "web-app-manifest";
3
3
  import { Logger, Log } from "./helpers/logger.ts";
4
+ import type { PackageDepsInfo } from "./helpers/lockfile.ts";
4
5
  export type FileID = string;
5
6
  export type ModuleID = string;
6
7
  export type ExportID = string;
@@ -91,34 +92,35 @@ export interface PackageDescriptor {
91
92
  };
92
93
  [metadata: string]: any;
93
94
  }
94
- export declare class WorkspaceItem {
95
+ export declare abstract class WorkspaceItem {
95
96
  readonly workspace: Workspace;
96
97
  readonly log: Log;
97
98
  constructor(workspace: Workspace, loggerId: string);
99
+ make_file_id(prefix: string, id: string): string;
100
+ abstract resolve_entry_path(entryId: string, baseDir: string): string;
98
101
  }
99
102
  export declare class Library extends WorkspaceItem {
100
103
  readonly name: string;
101
104
  readonly path: FileID;
102
105
  readonly descriptor: PackageDescriptor;
103
106
  readonly workspace: Workspace;
104
- bundle: Bundle;
107
+ master: Bundle;
105
108
  declarations: Map<string, DeclarationDescriptor>;
106
109
  applications: Map<string, AppDescriptor>;
107
110
  externals: Record<string, string>;
108
- resolved_versions: Record<string, string>;
111
+ deps: PackageDepsInfo;
109
112
  search_directories: FileID[];
110
113
  constants: Constants;
111
114
  shelve: Bundle[];
112
115
  constructor(name: string, path: FileID, descriptor: PackageDescriptor, workspace: Workspace);
113
116
  get_id(): string;
114
117
  get_bundle(id: string): Bundle;
115
- make_file_id(prefix: string, id: string): string;
116
118
  resolve_entry_path(entryId: string, baseDir: string): string;
117
119
  }
118
120
  export declare class Bundle extends WorkspaceItem {
119
121
  manifest: BundleManifest;
120
122
  readonly path: string;
121
- readonly workspace: Workspace;
123
+ readonly library: Library;
122
124
  readonly source: Library;
123
125
  alias: string;
124
126
  components: Map<string, ComponentManifest>;
@@ -126,13 +128,14 @@ export declare class Bundle extends WorkspaceItem {
126
128
  [packageName: string]: string | DistributedConfig;
127
129
  };
128
130
  configured: boolean;
129
- constructor(manifest: BundleManifest, path: string, workspace: Workspace, source?: Library);
131
+ constructor(manifest: BundleManifest, path: string, library: Library, source?: Library);
130
132
  get id(): BundleID;
131
133
  get dependencies(): string[];
132
134
  get exports(): {
133
135
  [id: string]: string;
134
136
  };
135
137
  resolve_export(ref: string): string;
138
+ resolve_entry_path(entryId: string, baseDir: string): string;
136
139
  }
137
140
  export type Constants = {
138
141
  [key: string]: string | number;
@@ -147,12 +150,13 @@ export declare class Workspace {
147
150
  readonly version: string;
148
151
  readonly path: string;
149
152
  readonly devmode: boolean;
153
+ readonly debugmode: boolean;
150
154
  libraries: Library[];
151
155
  constants: Constants;
152
156
  ignored_directories: Set<string>;
153
157
  readonly logger: Logger;
154
158
  readonly log: Log;
155
- constructor(name: string, version: string, path: string, devmode: boolean);
159
+ constructor(name: string, version: string, path: string, devmode: boolean, debugmode?: boolean);
156
160
  get_bundle(id: string): Bundle;
157
161
  get_library(name: string): Library;
158
162
  get_application(name: string): AppEntry;
@@ -16,6 +16,12 @@ export class WorkspaceItem {
16
16
  this.workspace = workspace;
17
17
  this.log = workspace.logger.get(loggerId);
18
18
  }
19
+ make_file_id(prefix, id) {
20
+ const base = this.workspace.debugmode
21
+ ? id.replace(/[^a-zA-Z0-9]+/g, "_")
22
+ : computeNameHashID(id);
23
+ return base ? prefix + "." + base : prefix;
24
+ }
19
25
  }
20
26
  // Une librairie represente des plans de construction avec un ensemble de code source
21
27
  export class Library extends WorkspaceItem {
@@ -23,11 +29,11 @@ export class Library extends WorkspaceItem {
23
29
  path;
24
30
  descriptor;
25
31
  workspace;
26
- bundle = null;
32
+ master = null;
27
33
  declarations = new Map();
28
34
  applications = new Map();
29
35
  externals = {};
30
- resolved_versions = {};
36
+ deps;
31
37
  search_directories = [];
32
38
  constants = {};
33
39
  shelve = [];
@@ -54,11 +60,6 @@ export class Library extends WorkspaceItem {
54
60
  }
55
61
  return null;
56
62
  }
57
- make_file_id(prefix, id) {
58
- const devmode = true;
59
- const base = devmode ? id.replace(/[^a-zA-Z0-9]+/g, "_") : computeNameHashID(id);
60
- return base ? prefix + "." + base : prefix;
61
- }
62
63
  resolve_entry_path(entryId, baseDir) {
63
64
  const fpath = make_normalized_path(Path.resolve(baseDir, entryId));
64
65
  if (entryId.startsWith("."))
@@ -78,17 +79,17 @@ export class Library extends WorkspaceItem {
78
79
  export class Bundle extends WorkspaceItem {
79
80
  manifest;
80
81
  path;
81
- workspace;
82
+ library;
82
83
  source;
83
84
  alias;
84
85
  components = new Map();
85
86
  distribueds = {};
86
87
  configured = false;
87
- constructor(manifest, path, workspace, source = null) {
88
- super(workspace, `bundle:${manifest.$id}`);
88
+ constructor(manifest, path, library, source = null) {
89
+ super(library.workspace, `bundle:${manifest.$id}`);
89
90
  this.manifest = manifest;
90
91
  this.path = path;
91
- this.workspace = workspace;
92
+ this.library = library;
92
93
  this.source = source;
93
94
  this.configured = (source === null);
94
95
  }
@@ -108,6 +109,15 @@ export class Bundle extends WorkspaceItem {
108
109
  }
109
110
  return this.exports?.[ref];
110
111
  }
112
+ resolve_entry_path(entryId, baseDir) {
113
+ const fpath = make_normalized_path(Path.resolve(baseDir, entryId));
114
+ if (entryId.startsWith("."))
115
+ return fpath;
116
+ if (this.source) {
117
+ return this.source.resolve_entry_path(entryId, baseDir);
118
+ }
119
+ return null;
120
+ }
111
121
  }
112
122
  // Workspace est l'objet a travers lequel on connecte tous les elements
113
123
  export class Workspace {
@@ -115,22 +125,24 @@ export class Workspace {
115
125
  version;
116
126
  path;
117
127
  devmode;
128
+ debugmode;
118
129
  libraries = [];
119
130
  constants = {};
120
131
  ignored_directories = new Set();
121
132
  logger = new Logger();
122
133
  log;
123
- constructor(name, version, path, devmode) {
134
+ constructor(name, version, path, devmode, debugmode = false) {
124
135
  this.name = name;
125
136
  this.version = version;
126
137
  this.path = path;
127
138
  this.devmode = devmode;
139
+ this.debugmode = debugmode;
128
140
  this.log = this.logger.get(`workspace:${name}`);
129
141
  }
130
142
  get_bundle(id) {
131
143
  for (const lib of this.libraries) {
132
- if (lib.bundle.id === id)
133
- return lib.bundle;
144
+ if (lib.master.id === id)
145
+ return lib.master;
134
146
  }
135
147
  for (const lib of this.libraries) {
136
148
  const bun = lib.get_bundle(id);
package/package.json CHANGED
@@ -1,74 +1,75 @@
1
- {
2
- "name": "@jointhedots/gear",
3
- "version": "1.2.2",
4
- "type": "module",
5
- "packageManager": "pnpm@10.30.3",
6
- "bin": {
7
- "jointhedots-gear": "esm/cli.js"
8
- },
9
- "exports": {
10
- "./workspace": "./esm/workspace/mod.js",
11
- "./core": {
12
- "browser": "./esm/core/mod-browser.js",
13
- "node": "./esm/core/mod-node.js",
14
- "deno": "./src/core/mod.ts",
15
- "default": "./esm/core/mod.js"
16
- }
17
- },
18
- "files": [
19
- "esm",
20
- "browser-modules",
21
- "schemas",
22
- "!**/*.map"
23
- ],
24
- "scripts": {
25
- "watch": "tsc -w --sourceMap",
26
- "build": "tsc",
27
- ":serve": "deno --allow-all --watch=src src/cli.ts serve --app playground:agent --devmode --port 3001 --ws ../jointhedots-core/packages/jointhedots-agent",
28
- ":build:core": "deno --allow-all --watch=src src/cli.ts make --buns jointhedots.core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
29
- ":build:ui": "deno --allow-all --watch=src src/cli.ts make --buns jointhedots.ui --ws ../jointhedots-core/packages/jointhedots-ui",
30
- ":build:cortex": "deno --allow-all --watch=src src/cli.ts make --buns @jointhedots/cortex --devmode --ws ../jointhedots-core/packages/jointhedots-cortex",
31
- ":build:libs": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/core,@jointhedots/ui --devmode --ws ../jointhedots-core",
32
- ":build:lib:core": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
33
- ":build:lib:ui": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/ui --devmode --ws ../jointhedots-core/packages/jointhedots-ui",
34
- ":build:app": "deno --allow-all --watch=src src/cli.ts make --apps playground:ui --ws ../jointhedots-core",
35
- "serve:mono": "deno --allow-all --watch=src src/cli.ts serve --app playground:ui --devmode --port 3002 --ws ../jointhedots-core",
36
- "serve:host": "deno --allow-all --watch=src src/cli.ts serve --app playground:ui:host --devmode --port 3002 --ws ../jointhedots-core",
37
- "serve:sfe": "deno --allow-all --watch=src src/cli.ts serve --app sfe-webapp --devmode --ws ../sf-explorer-app",
38
- "serve:demo": "deno --allow-all --watch=src src/cli.ts serve --app sfe-demo --devmode --ws ../sf-explorer-demo",
39
- "make:sfe": "deno --allow-all --watch=src src/cli.ts make --libs @sf-explorer/app --devmode --ws ../sf-explorer-app",
40
- "prepublishOnly": "node scripts/prepublish.mjs"
41
- },
42
- "dependencies": {
43
- "@jspm/core": "^2.1.0",
44
- "@tailwindcss/postcss": "~4.1.3",
45
- "@typescript/native-preview": "^7.0.0-dev.20260310.1",
46
- "json-schema": "^0.4.0",
47
- "vscode-uri": "^3.1.0",
48
- "zod": "^4.3.6",
49
- "dotenv": "~17.2.3",
50
- "esbuild": "~0.27.2",
51
- "esbuild-sass-plugin": "~3.6.0",
52
- "express": "~5.2.1",
53
- "mime": "~4.1.0",
54
- "postcss": "~8.5.6",
55
- "sass": "~1.97.2",
56
- "semver": "~7.7.3",
57
- "sharp": "~0.34.5",
58
- "toml": "^3.0.0",
59
- "typescript": "~5.9.3",
60
- "yaml": "^2.8.2",
61
- "yargs": "~18.0.0"
62
- },
63
- "devDependencies": {
64
- "@polycuber/script.cli": "~1.0.5",
65
- "@types/chrome": "~0.1.33",
66
- "@types/node": "~22.7.4",
67
- "@types/semver": "~7.7.1",
68
- "@types/web-app-manifest": "~1.0.9",
69
- "@types/yargs": "~17.0.35"
70
- },
71
- "bundleDependencies": [
72
- "@jspm/core"
73
- ]
1
+ {
2
+ "name": "@jointhedots/gear",
3
+ "version": "1.2.3",
4
+ "type": "module",
5
+ "packageManager": "pnpm@10.30.3",
6
+ "bin": {
7
+ "jointhedots-gear": "esm/cli.js"
8
+ },
9
+ "exports": {
10
+ "./workspace": "./esm/workspace/mod.js",
11
+ "./core": {
12
+ "browser": "./esm/core/mod-browser.js",
13
+ "node": "./esm/core/mod-node.js",
14
+ "deno": "./src/core/mod.ts",
15
+ "default": "./esm/core/mod.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "esm",
20
+ "browser-modules",
21
+ "schemas",
22
+ "!**/*.map"
23
+ ],
24
+ "scripts": {
25
+ "watch": "tsc -w --sourceMap",
26
+ "build": "tsc",
27
+ ":serve": "deno --allow-all --watch=src src/cli.ts serve --app playground:agent --devmode --port 3001 --ws ../jointhedots-core/packages/jointhedots-agent",
28
+ ":build:core": "deno --allow-all --watch=src src/cli.ts make --buns jointhedots.core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
29
+ ":build:ui": "deno --allow-all --watch=src src/cli.ts make --buns jointhedots.ui --ws ../jointhedots-core/packages/jointhedots-ui",
30
+ ":build:cortex": "deno --allow-all --watch=src src/cli.ts make --buns @jointhedots/cortex --devmode --ws ../jointhedots-core/packages/jointhedots-cortex",
31
+ ":build:libs": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/core,@jointhedots/ui --devmode --ws ../jointhedots-core",
32
+ ":build:lib:core": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/core --devmode --ws ../jointhedots-core/packages/jointhedots-core",
33
+ ":build:lib:ui": "deno --allow-all --watch=src src/cli.ts make --libs @jointhedots/ui --devmode --ws ../jointhedots-core/packages/jointhedots-ui",
34
+ ":build:app": "deno --allow-all --watch=src src/cli.ts make --apps playground:ui --ws ../jointhedots-core",
35
+ "serve:mono": "deno --allow-all --watch=src src/cli.ts serve --app playground:ui --devmode --port 3002 --ws ../jointhedots-core",
36
+ "serve:host": "deno --allow-all --watch=src src/cli.ts serve --app playground:ui:host --devmode --port 3002 --ws ../jointhedots-core",
37
+ "serve:sfe": "deno --allow-all --watch=src src/cli.ts serve --app sfe-webapp --devmode --ws ../sf-explorer-app",
38
+ "serve:demo": "deno --allow-all --watch=src src/cli.ts serve --app sfe-demo --devmode --ws ../sf-explorer-demo",
39
+ "make:sfe": "deno --allow-all --watch=src src/cli.ts make --libs @sf-explorer/app --devmode --ws ../sf-explorer-app",
40
+ "prepublishOnly": "node scripts/prepublish.mjs"
41
+ },
42
+ "dependencies": {
43
+ "@jspm/core": "^2.1.0",
44
+ "@tailwindcss/postcss": "~4.1.3",
45
+ "@typescript/native-preview": "^7.0.0-dev.20260310.1",
46
+ "dotenv": "~17.2.3",
47
+ "esbuild": "~0.27.2",
48
+ "esbuild-sass-plugin": "~3.6.0",
49
+ "express": "~5.2.1",
50
+ "json-schema": "^0.4.0",
51
+ "mime": "~4.1.0",
52
+ "postcss": "~8.5.6",
53
+ "sass": "~1.97.2",
54
+ "semver": "~7.7.3",
55
+ "sharp": "~0.34.5",
56
+ "toml": "^3.0.0",
57
+ "typescript": "~5.9.3",
58
+ "vscode-uri": "^3.1.0",
59
+ "yaml": "^2.8.2",
60
+ "yargs": "~18.0.0",
61
+ "zod": "^4.3.6"
62
+ },
63
+ "devDependencies": {
64
+ "@polycuber/script.cli": "~1.0.5",
65
+ "@types/chrome": "~0.1.33",
66
+ "@types/node": "~22.7.4",
67
+ "@types/semver": "~7.7.1",
68
+ "@types/web-app-manifest": "~1.0.9",
69
+ "@types/yargs": "~17.0.35"
70
+ },
71
+ "bundleDependencies": [
72
+ "@deno/esbuild-plugin",
73
+ "@jspm/core"
74
+ ]
74
75
  }