@ecopages/core 0.2.0-beta.34 → 0.2.0-beta.35
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/core",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.35",
|
|
4
4
|
"description": "Core package for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"directory": "packages/core"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ecopages/file-system": "0.2.0-beta.
|
|
20
|
+
"@ecopages/file-system": "0.2.0-beta.35",
|
|
21
21
|
"@ecopages/logger": "^0.2.3",
|
|
22
22
|
"@ecopages/scripts-injector": "^0.1.5",
|
|
23
23
|
"@oxc-project/runtime": "0.134.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@standard-schema/utils": "^0.3.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@ecopages/dev-toolbar": "0.2.0-beta.
|
|
35
|
+
"@ecopages/dev-toolbar": "0.2.0-beta.35"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@ecopages/dev-toolbar": {
|
|
@@ -14,15 +14,15 @@ Extend the toolbar by setting `devToolbar.package` to your own client package (o
|
|
|
14
14
|
|
|
15
15
|
## Module map
|
|
16
16
|
|
|
17
|
-
| File | Role
|
|
18
|
-
| ------------------------------ |
|
|
19
|
-
| `dev-toolbar-host.ts` | Enablement, manifest contribution, runtime bundling, HTML injection
|
|
20
|
-
| `dev-toolbar-manifest.ts` | Builds and serializes the per-page dev manifest
|
|
21
|
-
| `dev-toolbar-package.ts` | Resolves `devToolbar.package` bootstrap entry
|
|
22
|
-
| `dev-toolbar-config.ts` | `isDevToolbarEnabled` — watch mode, env var, package required
|
|
23
|
-
| `dev-toolbar-html-response.ts` | Adapter helpers for injecting `import '/_dev_toolbar.js'`
|
|
24
|
-
| `dev-toolbar-runtime-paths.ts` | `/_dev_toolbar.js` URL and work-dir paths
|
|
25
|
-
| `define-dev-tool.ts` | Config helper for bring-your-own client packages
|
|
17
|
+
| File | Role |
|
|
18
|
+
| ------------------------------ | -------------------------------------------------------------------------- |
|
|
19
|
+
| `dev-toolbar-host.ts` | Enablement, manifest contribution, runtime bundling, HTML injection |
|
|
20
|
+
| `dev-toolbar-manifest.ts` | Builds and serializes the per-page dev manifest |
|
|
21
|
+
| `dev-toolbar-package.ts` | Resolves `devToolbar.package` bootstrap entry (`bootstrap.js`, then `.ts`) |
|
|
22
|
+
| `dev-toolbar-config.ts` | `isDevToolbarEnabled` — watch mode, env var, package required |
|
|
23
|
+
| `dev-toolbar-html-response.ts` | Adapter helpers for injecting `import '/_dev_toolbar.js'` |
|
|
24
|
+
| `dev-toolbar-runtime-paths.ts` | `/_dev_toolbar.js` URL and work-dir paths |
|
|
25
|
+
| `define-dev-tool.ts` | Config helper for bring-your-own client packages |
|
|
26
26
|
|
|
27
27
|
## Injection order
|
|
28
28
|
|
|
@@ -15,6 +15,9 @@ export declare function getDevToolbarPackageSpec(appConfig: Pick<EcoPagesAppConf
|
|
|
15
15
|
export declare function resolveDevToolbarPackageRoot(rootDir: string, packageSpec: string): string;
|
|
16
16
|
/**
|
|
17
17
|
* Resolves the browser entrypoint core bundles into `/_dev_toolbar.js`.
|
|
18
|
+
*
|
|
19
|
+
* @remarks Prefers `src/bootstrap.js` when present (published npm or `file:` to
|
|
20
|
+
* `dist`), then `bootstrap.ts` for workspace source checkouts.
|
|
18
21
|
*/
|
|
19
22
|
export declare function resolveDevToolbarClient(rootDir: string, packageSpec: string): DevToolbarClientResolution | undefined;
|
|
20
23
|
/**
|
|
@@ -2,6 +2,7 @@ import { createRequire } from 'node:module';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileSystem } from '@ecopages/file-system';
|
|
4
4
|
const SOURCE_CLIENT_FILE = 'src/bootstrap.ts';
|
|
5
|
+
const COMPILED_CLIENT_FILE = 'src/bootstrap.js';
|
|
5
6
|
/**
|
|
6
7
|
* Returns the configured dev-toolbar client package specifier, if any.
|
|
7
8
|
*/
|
|
@@ -28,14 +29,19 @@ export function resolveDevToolbarPackageRoot(rootDir, packageSpec) {
|
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
31
|
* Resolves the browser entrypoint core bundles into `/_dev_toolbar.js`.
|
|
32
|
+
*
|
|
33
|
+
* @remarks Prefers `src/bootstrap.js` when present (published npm or `file:` to
|
|
34
|
+
* `dist`), then `bootstrap.ts` for workspace source checkouts.
|
|
31
35
|
*/
|
|
32
36
|
export function resolveDevToolbarClient(rootDir, packageSpec) {
|
|
37
|
+
const require = createRequire(path.join(rootDir, 'package.json'));
|
|
33
38
|
const packageRoot = resolveDevToolbarPackageRoot(rootDir, packageSpec);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
const entryCandidates = [path.join(packageRoot, COMPILED_CLIENT_FILE), path.join(packageRoot, SOURCE_CLIENT_FILE)];
|
|
40
|
+
for (const entryPath of entryCandidates) {
|
|
41
|
+
if (fileSystem.exists(entryPath)) {
|
|
42
|
+
return { entryPath };
|
|
43
|
+
}
|
|
37
44
|
}
|
|
38
|
-
const require = createRequire(path.join(rootDir, 'package.json'));
|
|
39
45
|
try {
|
|
40
46
|
return { entryPath: require.resolve(packageSpec) };
|
|
41
47
|
}
|