jskelet 0.2.3 → 0.2.5

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 (91) hide show
  1. package/AGENTS.md +132 -132
  2. package/CHANGELOG.md +15 -0
  3. package/LICENSE +21 -21
  4. package/bin/jskelet.mjs +103 -103
  5. package/docs/01-baslangic.md +285 -285
  6. package/docs/02-mimari.md +287 -287
  7. package/docs/03-routing.md +480 -480
  8. package/docs/04-render-ve-sablonlar.md +490 -490
  9. package/docs/05-islands.md +482 -482
  10. package/docs/06-cache.md +1209 -1202
  11. package/docs/08-build.md +366 -366
  12. package/docs/09-dev-araclari.md +335 -335
  13. package/docs/10-dagitim.md +329 -329
  14. package/docs/12-panel-ve-oturum.md +384 -384
  15. package/docs/README.md +105 -105
  16. package/docs/en/01-getting-started.md +292 -292
  17. package/docs/en/02-architecture.md +305 -305
  18. package/docs/en/03-routing.md +497 -497
  19. package/docs/en/04-rendering.md +504 -504
  20. package/docs/en/05-islands.md +492 -492
  21. package/docs/en/06-caching.md +1239 -1232
  22. package/docs/en/07-configuration.md +986 -986
  23. package/docs/en/08-build.md +383 -383
  24. package/docs/en/09-dev-tools.md +342 -342
  25. package/docs/en/10-deployment.md +332 -332
  26. package/docs/en/11-migration.md +359 -359
  27. package/docs/en/12-dashboards-and-sessions.md +392 -392
  28. package/docs/en/README.md +112 -112
  29. package/package.json +102 -102
  30. package/src/build/ensure-build.mjs +15 -15
  31. package/src/build/paths.mjs +143 -143
  32. package/src/build/resolve-peer.mjs +36 -36
  33. package/src/build/tasks/client.mjs +268 -268
  34. package/src/build/tasks/css.mjs +124 -124
  35. package/src/build/tasks/fonts.mjs +146 -146
  36. package/src/build/tasks/icons.mjs +224 -224
  37. package/src/build/tasks/images.mjs +244 -244
  38. package/src/build/tasks/precompress.mjs +78 -78
  39. package/src/client/cache-panel/i18n.js +670 -0
  40. package/src/client/cache-panel/login.html +74 -71
  41. package/src/client/cache-panel/panel.css +756 -740
  42. package/src/client/cache-panel/panel.html +308 -307
  43. package/src/client/cache-panel/panel.js +915 -808
  44. package/src/client/devtools/report.html +185 -185
  45. package/src/client/devtools/report.js +725 -725
  46. package/src/client/dom.js +95 -95
  47. package/src/client/form.js +192 -192
  48. package/src/client/index.js +35 -35
  49. package/src/client/registry.js +297 -297
  50. package/src/client/safe-image.js +91 -91
  51. package/src/client/store.js +36 -36
  52. package/src/client/swap.js +188 -188
  53. package/src/config/pattern.js +107 -107
  54. package/src/http/control-flow.js +71 -71
  55. package/src/http/cookies.js +257 -257
  56. package/src/http/request-cache.js +46 -46
  57. package/src/http/request-context.js +162 -162
  58. package/src/index.js +83 -83
  59. package/src/init.mjs +221 -221
  60. package/src/runtime/alias-hooks.mjs +119 -119
  61. package/src/runtime/register.mjs +4 -4
  62. package/src/server/assets.js +147 -147
  63. package/src/server/cache-deps.js +42 -42
  64. package/src/server/cache-panel.js +759 -738
  65. package/src/server/cloudflare.js +607 -595
  66. package/src/server/create-app.js +291 -291
  67. package/src/server/data-cache.js +462 -462
  68. package/src/server/dev/report.js +369 -369
  69. package/src/server/dev/socket.js +170 -170
  70. package/src/server/dev/version-check.mjs +139 -139
  71. package/src/server/html-cache.js +817 -817
  72. package/src/server/metadata.js +102 -102
  73. package/src/server/middleware/compression.js +205 -205
  74. package/src/server/middleware/csrf.js +134 -134
  75. package/src/server/middleware/dev-gate.js +62 -62
  76. package/src/server/middleware/headers.js +37 -37
  77. package/src/server/middleware/redirects.js +32 -32
  78. package/src/server/middleware/static-precompressed.js +100 -100
  79. package/src/server/middleware/upstream-proxy.js +141 -141
  80. package/src/server/prewarm.js +601 -601
  81. package/src/server/redis.js +569 -569
  82. package/src/server/router.js +128 -128
  83. package/src/server/status-page.js +164 -164
  84. package/src/server/upstream-limiter.js +376 -376
  85. package/src/server/upstream-tracking.js +166 -166
  86. package/src/start.mjs +7 -7
  87. package/src/templates/layout.ejs +44 -44
  88. package/src/version.mjs +31 -31
  89. package/src/views/components/loader.js +85 -85
  90. package/src/views/helpers/html.js +102 -102
  91. package/src/views/helpers/tags.js +245 -245
@@ -1,268 +1,268 @@
1
- /**
2
- * Island bundle'ı: esbuild, ESM, code splitting.
3
- *
4
- * `client/entries/*.js` içindeki her dosya bir entry'dir. `main.js` her sayfada
5
- * yüklenen ortak island bootstrap'ıdır; ek entry'ler yalnızca onları isteyen
6
- * sayfalarda (`controller` → `entries: ["chart.js"]`) yüklenir.
7
- *
8
- * Hedef tarayıcılar `package.json` → `browserslist` yerine burada sabit: ESM +
9
- * dinamik import + `IntersectionObserver` island modelinin zaten alt sınırı,
10
- * daha eskisine transpile etmek çıktıyı büyütüp hiçbir ziyaretçi kazandırmıyor.
11
- */
12
- import fs from "node:fs";
13
- import path from "node:path";
14
- import process from "node:process";
15
- import * as esbuild from "esbuild";
16
- import { paths, patchManifest, pruneAssets } from "../paths.mjs";
17
- import * as log from "../../log.mjs";
18
-
19
- /**
20
- * `@/` alias'ını proje köküne çözer — Node tarafındaki `alias-hooks.mjs` ile
21
- * aynı davranış, böylece `lib/` altındaki modüller hem sunucuda hem
22
- * tarayıcıda aynı import stilini kullanabilir.
23
- *
24
- * @param {string} root
25
- * @returns {esbuild.Plugin}
26
- */
27
- function aliasPlugin(root) {
28
- return {
29
- name: "jskelet-alias",
30
- setup(build) {
31
- build.onResolve({ filter: /^@\// }, (args) => ({
32
- path: resolveWithExtension(path.join(root, args.path.slice(2))),
33
- }));
34
- },
35
- };
36
- }
37
-
38
- /**
39
- * Tarayıcıda `process` yoktur; sunucuyla paylaşılan modüller yine de
40
- * `process.env` okur. `clientEnv` ile bildirilen anahtarlar build zamanında
41
- * gömülür — Next'teki `NEXT_PUBLIC_*` ile aynı sözleşme, ama hangi anahtarın
42
- * herkese açık olduğu isimden değil config'ten belli.
43
- *
44
- * `process.env`in tamamı tek nesne olarak define edilir: listede olmayan bir
45
- * anahtar okunduğunda çökme yerine `undefined` döner.
46
- *
47
- * @param {string[]} keys
48
- * @returns {Record<string, string>}
49
- */
50
- function publicEnv(keys) {
51
- /** @type {Record<string, string>} */
52
- const env = { NODE_ENV: process.env.NODE_ENV ?? "production" };
53
- for (const key of keys) {
54
- const value = process.env[key];
55
- if (value != null) env[key] = value;
56
- }
57
- return env;
58
- }
59
-
60
- /**
61
- * @param {string} base
62
- * @returns {string}
63
- */
64
- function resolveWithExtension(base) {
65
- const candidates = [
66
- base,
67
- `${base}.js`,
68
- `${base}.mjs`,
69
- `${base}.json`,
70
- path.join(base, "index.js"),
71
- ];
72
- for (const candidate of candidates) {
73
- if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate;
74
- }
75
- return base;
76
- }
77
-
78
- /**
79
- * @param {import('../../config/index.js').ResolvedConfig} config
80
- * @param {{ watch?: boolean }} [options]
81
- * @returns {Promise<Record<string, string>>}
82
- */
83
- export async function buildClient(config, { watch = false } = {}) {
84
- const entryDir = path.join(config.dirs.client, "entries");
85
- const outDir = path.join(paths.assets, "js");
86
-
87
- if (!fs.existsSync(entryDir)) {
88
- log.detail("no entries, skipped");
89
- return {};
90
- }
91
-
92
- const entryPoints = fs
93
- .readdirSync(entryDir)
94
- .filter((file) => file.endsWith(".js"))
95
- .map((file) => path.join(entryDir, file));
96
-
97
- if (!entryPoints.length) {
98
- log.detail("no entries, skipped");
99
- return {};
100
- }
101
-
102
- fs.rmSync(outDir, { recursive: true, force: true });
103
- pruneAssets(["js/"]);
104
-
105
- const entryRoot = path
106
- .relative(config.root, entryDir)
107
- .split(path.sep)
108
- .join("/");
109
-
110
- /** @type {esbuild.BuildOptions} */
111
- const options = {
112
- entryPoints,
113
- outdir: outDir,
114
- absWorkingDir: config.root,
115
- bundle: true,
116
- splitting: true,
117
- format: "esm",
118
- target: ["chrome111", "edge111", "firefox111", "safari16.4"],
119
- minify: true,
120
- sourcemap: true,
121
- metafile: true,
122
- entryNames: "[name].[hash]",
123
- chunkNames: "chunks/[name].[hash]",
124
- legalComments: "none",
125
- plugins: [aliasPlugin(config.root)],
126
- define: {
127
- "process.env": JSON.stringify(publicEnv(config.clientEnv)),
128
- },
129
- };
130
-
131
- if (watch) {
132
- const context = await esbuild.context({
133
- ...options,
134
- plugins: [...options.plugins, rebuildReporter(config, entryRoot)],
135
- });
136
- const result = await context.rebuild();
137
- await context.watch();
138
- writeMetafile(result.metafile);
139
- const manifest = toManifest(result.metafile, config, entryRoot);
140
- const entries = Object.keys(manifest).length;
141
- log.detail(`${entries} ${entries === 1 ? "entry" : "entries"}`);
142
- return manifest;
143
- }
144
-
145
- const result = await esbuild.build(options);
146
- writeMetafile(result.metafile);
147
- const manifest = toManifest(result.metafile, config, entryRoot);
148
- const bytes = Object.values(result.metafile.outputs).reduce(
149
- (sum, output) => sum + output.bytes,
150
- 0,
151
- );
152
- const entries = Object.keys(manifest).length;
153
- log.detail(`${entries} ${entries === 1 ? "entry" : "entries"}, ${log.size(bytes)}`);
154
- return manifest;
155
- }
156
-
157
- /**
158
- * Metafile diske yazılır: dev panelindeki chunk analizi giriş/çıkış
159
- * kırılımını buradan okur. Çalışma zamanı bu dosyaya bağımlı değildir.
160
- *
161
- * @param {esbuild.Metafile} [metafile]
162
- */
163
- function writeMetafile(metafile) {
164
- if (!metafile) return;
165
- try {
166
- fs.mkdirSync(paths.generated, { recursive: true });
167
- fs.writeFileSync(
168
- path.join(paths.generated, "metafile.json"),
169
- JSON.stringify(metafile),
170
- );
171
- } catch {
172
- // Analiz verisi en iyi çaba; build'i düşürmez.
173
- }
174
- }
175
-
176
- /**
177
- * Watch turlarını canlı olarak bildirir; ilk build zaten adım satırında görünür.
178
- *
179
- * @param {import('../../config/index.js').ResolvedConfig} config
180
- * @param {string} entryRoot
181
- * @returns {esbuild.Plugin}
182
- */
183
- function rebuildReporter(config, entryRoot) {
184
- // İlk `rebuild()` ve `watch()`'un kendi açılış turu adım satırında zaten
185
- // görünüyor; canlı bildirim gerçek değişikliklerle başlar.
186
- let skip = 2;
187
- let started = 0;
188
-
189
- return {
190
- name: "jskelet-rebuild-log",
191
- setup(build) {
192
- build.onStart(() => {
193
- started = Date.now();
194
- });
195
-
196
- build.onEnd((result) => {
197
- if (result.metafile) {
198
- writeMetafile(result.metafile);
199
- // Entry adları hash'li: yeni hash manifest'e yazılmazsa HTML eski
200
- // (artık var olmayan) bundle'ı ister ve island'ların hiçbiri açılmaz.
201
- for (const [key, url] of Object.entries(
202
- toManifest(result.metafile, config, entryRoot),
203
- )) {
204
- patchManifest(key, url);
205
- }
206
- }
207
-
208
- if (skip > 0) {
209
- skip -= 1;
210
- return;
211
- }
212
-
213
- if (result.errors.length) {
214
- const [first] = result.errors;
215
- log.errorBox({
216
- title: "Client Build Error",
217
- name: "BuildError",
218
- message: first.text,
219
- lines: [
220
- first.location
221
- ? `${first.location.file}:${first.location.line}:${first.location.column}`
222
- : "",
223
- result.errors.length > 1
224
- ? `+${result.errors.length - 1} more errors`
225
- : "",
226
- ].filter(Boolean),
227
- });
228
- return;
229
- }
230
-
231
- log.event({
232
- scope: "client",
233
- message: "rebuilt",
234
- time: Date.now() - started,
235
- });
236
- });
237
- },
238
- };
239
- }
240
-
241
- /**
242
- * esbuild metafile → { "main.js": "/assets/js/main.abc.js" }
243
- *
244
- * Dinamik import'lar da `entryPoint` taşır; yalnızca gerçek entry'ler
245
- * manifest'e girer, yoksa her island ayrı bir manifest anahtarı olurdu.
246
- *
247
- * @param {esbuild.Metafile} metafile
248
- * @param {import('../../config/index.js').ResolvedConfig} config
249
- * @param {string} entryRoot
250
- * @returns {Record<string, string>}
251
- */
252
- function toManifest(metafile, config, entryRoot) {
253
- /** @type {Record<string, string>} */
254
- const manifest = {};
255
-
256
- for (const [outputPath, output] of Object.entries(metafile.outputs)) {
257
- if (!output.entryPoint?.startsWith(entryRoot)) continue;
258
-
259
- const name = `${path.basename(output.entryPoint, ".js")}.js`;
260
- const absolute = path.resolve(config.root, outputPath);
261
- manifest[name] = `/${path
262
- .relative(config.dirs.public, absolute)
263
- .split(path.sep)
264
- .join("/")}`;
265
- }
266
-
267
- return manifest;
268
- }
1
+ /**
2
+ * Island bundle'ı: esbuild, ESM, code splitting.
3
+ *
4
+ * `client/entries/*.js` içindeki her dosya bir entry'dir. `main.js` her sayfada
5
+ * yüklenen ortak island bootstrap'ıdır; ek entry'ler yalnızca onları isteyen
6
+ * sayfalarda (`controller` → `entries: ["chart.js"]`) yüklenir.
7
+ *
8
+ * Hedef tarayıcılar `package.json` → `browserslist` yerine burada sabit: ESM +
9
+ * dinamik import + `IntersectionObserver` island modelinin zaten alt sınırı,
10
+ * daha eskisine transpile etmek çıktıyı büyütüp hiçbir ziyaretçi kazandırmıyor.
11
+ */
12
+ import fs from "node:fs";
13
+ import path from "node:path";
14
+ import process from "node:process";
15
+ import * as esbuild from "esbuild";
16
+ import { paths, patchManifest, pruneAssets } from "../paths.mjs";
17
+ import * as log from "../../log.mjs";
18
+
19
+ /**
20
+ * `@/` alias'ını proje köküne çözer — Node tarafındaki `alias-hooks.mjs` ile
21
+ * aynı davranış, böylece `lib/` altındaki modüller hem sunucuda hem
22
+ * tarayıcıda aynı import stilini kullanabilir.
23
+ *
24
+ * @param {string} root
25
+ * @returns {esbuild.Plugin}
26
+ */
27
+ function aliasPlugin(root) {
28
+ return {
29
+ name: "jskelet-alias",
30
+ setup(build) {
31
+ build.onResolve({ filter: /^@\// }, (args) => ({
32
+ path: resolveWithExtension(path.join(root, args.path.slice(2))),
33
+ }));
34
+ },
35
+ };
36
+ }
37
+
38
+ /**
39
+ * Tarayıcıda `process` yoktur; sunucuyla paylaşılan modüller yine de
40
+ * `process.env` okur. `clientEnv` ile bildirilen anahtarlar build zamanında
41
+ * gömülür — Next'teki `NEXT_PUBLIC_*` ile aynı sözleşme, ama hangi anahtarın
42
+ * herkese açık olduğu isimden değil config'ten belli.
43
+ *
44
+ * `process.env`in tamamı tek nesne olarak define edilir: listede olmayan bir
45
+ * anahtar okunduğunda çökme yerine `undefined` döner.
46
+ *
47
+ * @param {string[]} keys
48
+ * @returns {Record<string, string>}
49
+ */
50
+ function publicEnv(keys) {
51
+ /** @type {Record<string, string>} */
52
+ const env = { NODE_ENV: process.env.NODE_ENV ?? "production" };
53
+ for (const key of keys) {
54
+ const value = process.env[key];
55
+ if (value != null) env[key] = value;
56
+ }
57
+ return env;
58
+ }
59
+
60
+ /**
61
+ * @param {string} base
62
+ * @returns {string}
63
+ */
64
+ function resolveWithExtension(base) {
65
+ const candidates = [
66
+ base,
67
+ `${base}.js`,
68
+ `${base}.mjs`,
69
+ `${base}.json`,
70
+ path.join(base, "index.js"),
71
+ ];
72
+ for (const candidate of candidates) {
73
+ if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate;
74
+ }
75
+ return base;
76
+ }
77
+
78
+ /**
79
+ * @param {import('../../config/index.js').ResolvedConfig} config
80
+ * @param {{ watch?: boolean }} [options]
81
+ * @returns {Promise<Record<string, string>>}
82
+ */
83
+ export async function buildClient(config, { watch = false } = {}) {
84
+ const entryDir = path.join(config.dirs.client, "entries");
85
+ const outDir = path.join(paths.assets, "js");
86
+
87
+ if (!fs.existsSync(entryDir)) {
88
+ log.detail("no entries, skipped");
89
+ return {};
90
+ }
91
+
92
+ const entryPoints = fs
93
+ .readdirSync(entryDir)
94
+ .filter((file) => file.endsWith(".js"))
95
+ .map((file) => path.join(entryDir, file));
96
+
97
+ if (!entryPoints.length) {
98
+ log.detail("no entries, skipped");
99
+ return {};
100
+ }
101
+
102
+ fs.rmSync(outDir, { recursive: true, force: true });
103
+ pruneAssets(["js/"]);
104
+
105
+ const entryRoot = path
106
+ .relative(config.root, entryDir)
107
+ .split(path.sep)
108
+ .join("/");
109
+
110
+ /** @type {esbuild.BuildOptions} */
111
+ const options = {
112
+ entryPoints,
113
+ outdir: outDir,
114
+ absWorkingDir: config.root,
115
+ bundle: true,
116
+ splitting: true,
117
+ format: "esm",
118
+ target: ["chrome111", "edge111", "firefox111", "safari16.4"],
119
+ minify: true,
120
+ sourcemap: true,
121
+ metafile: true,
122
+ entryNames: "[name].[hash]",
123
+ chunkNames: "chunks/[name].[hash]",
124
+ legalComments: "none",
125
+ plugins: [aliasPlugin(config.root)],
126
+ define: {
127
+ "process.env": JSON.stringify(publicEnv(config.clientEnv)),
128
+ },
129
+ };
130
+
131
+ if (watch) {
132
+ const context = await esbuild.context({
133
+ ...options,
134
+ plugins: [...options.plugins, rebuildReporter(config, entryRoot)],
135
+ });
136
+ const result = await context.rebuild();
137
+ await context.watch();
138
+ writeMetafile(result.metafile);
139
+ const manifest = toManifest(result.metafile, config, entryRoot);
140
+ const entries = Object.keys(manifest).length;
141
+ log.detail(`${entries} ${entries === 1 ? "entry" : "entries"}`);
142
+ return manifest;
143
+ }
144
+
145
+ const result = await esbuild.build(options);
146
+ writeMetafile(result.metafile);
147
+ const manifest = toManifest(result.metafile, config, entryRoot);
148
+ const bytes = Object.values(result.metafile.outputs).reduce(
149
+ (sum, output) => sum + output.bytes,
150
+ 0,
151
+ );
152
+ const entries = Object.keys(manifest).length;
153
+ log.detail(`${entries} ${entries === 1 ? "entry" : "entries"}, ${log.size(bytes)}`);
154
+ return manifest;
155
+ }
156
+
157
+ /**
158
+ * Metafile diske yazılır: dev panelindeki chunk analizi giriş/çıkış
159
+ * kırılımını buradan okur. Çalışma zamanı bu dosyaya bağımlı değildir.
160
+ *
161
+ * @param {esbuild.Metafile} [metafile]
162
+ */
163
+ function writeMetafile(metafile) {
164
+ if (!metafile) return;
165
+ try {
166
+ fs.mkdirSync(paths.generated, { recursive: true });
167
+ fs.writeFileSync(
168
+ path.join(paths.generated, "metafile.json"),
169
+ JSON.stringify(metafile),
170
+ );
171
+ } catch {
172
+ // Analiz verisi en iyi çaba; build'i düşürmez.
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Watch turlarını canlı olarak bildirir; ilk build zaten adım satırında görünür.
178
+ *
179
+ * @param {import('../../config/index.js').ResolvedConfig} config
180
+ * @param {string} entryRoot
181
+ * @returns {esbuild.Plugin}
182
+ */
183
+ function rebuildReporter(config, entryRoot) {
184
+ // İlk `rebuild()` ve `watch()`'un kendi açılış turu adım satırında zaten
185
+ // görünüyor; canlı bildirim gerçek değişikliklerle başlar.
186
+ let skip = 2;
187
+ let started = 0;
188
+
189
+ return {
190
+ name: "jskelet-rebuild-log",
191
+ setup(build) {
192
+ build.onStart(() => {
193
+ started = Date.now();
194
+ });
195
+
196
+ build.onEnd((result) => {
197
+ if (result.metafile) {
198
+ writeMetafile(result.metafile);
199
+ // Entry adları hash'li: yeni hash manifest'e yazılmazsa HTML eski
200
+ // (artık var olmayan) bundle'ı ister ve island'ların hiçbiri açılmaz.
201
+ for (const [key, url] of Object.entries(
202
+ toManifest(result.metafile, config, entryRoot),
203
+ )) {
204
+ patchManifest(key, url);
205
+ }
206
+ }
207
+
208
+ if (skip > 0) {
209
+ skip -= 1;
210
+ return;
211
+ }
212
+
213
+ if (result.errors.length) {
214
+ const [first] = result.errors;
215
+ log.errorBox({
216
+ title: "Client Build Error",
217
+ name: "BuildError",
218
+ message: first.text,
219
+ lines: [
220
+ first.location
221
+ ? `${first.location.file}:${first.location.line}:${first.location.column}`
222
+ : "",
223
+ result.errors.length > 1
224
+ ? `+${result.errors.length - 1} more errors`
225
+ : "",
226
+ ].filter(Boolean),
227
+ });
228
+ return;
229
+ }
230
+
231
+ log.event({
232
+ scope: "client",
233
+ message: "rebuilt",
234
+ time: Date.now() - started,
235
+ });
236
+ });
237
+ },
238
+ };
239
+ }
240
+
241
+ /**
242
+ * esbuild metafile → { "main.js": "/assets/js/main.abc.js" }
243
+ *
244
+ * Dinamik import'lar da `entryPoint` taşır; yalnızca gerçek entry'ler
245
+ * manifest'e girer, yoksa her island ayrı bir manifest anahtarı olurdu.
246
+ *
247
+ * @param {esbuild.Metafile} metafile
248
+ * @param {import('../../config/index.js').ResolvedConfig} config
249
+ * @param {string} entryRoot
250
+ * @returns {Record<string, string>}
251
+ */
252
+ function toManifest(metafile, config, entryRoot) {
253
+ /** @type {Record<string, string>} */
254
+ const manifest = {};
255
+
256
+ for (const [outputPath, output] of Object.entries(metafile.outputs)) {
257
+ if (!output.entryPoint?.startsWith(entryRoot)) continue;
258
+
259
+ const name = `${path.basename(output.entryPoint, ".js")}.js`;
260
+ const absolute = path.resolve(config.root, outputPath);
261
+ manifest[name] = `/${path
262
+ .relative(config.dirs.public, absolute)
263
+ .split(path.sep)
264
+ .join("/")}`;
265
+ }
266
+
267
+ return manifest;
268
+ }