Skip to content

Commit c2705be

Browse files
committed
refactor(bundler): streamline module and chunk manifest generation
- Removed unused utility exports and consolidated manifest-related functions into a single module. - Updated bundler configuration to eliminate deprecated options and improve clarity. - Enhanced test coverage for module map and chunk manifest functionalities.
1 parent df1229e commit c2705be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+90
-112
lines changed

.claude/skills/architecture-guidelines/references/rules.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ Example structure:
4242
project/
4343
├── src/
4444
│ ├── app/ # Application code
45-
│ ├── components/ # Reusable components
46-
│ └── utils/ # Utility functions
45+
│ └── components/ # Reusable components
4746
├── tests/ # Test files
4847
├── docs/ # Documentation
4948
├── public/ # Static assets

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eser/stack",
3-
"version": "4.0.18",
3+
"version": "4.0.19",
44
"private": true,
55
"type": "module",
66
"workspaces": [

pkg/@cool/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cool/cli",
3-
"version": "4.0.18",
3+
"version": "4.0.19",
44
"type": "module",
55
"exports": {
66
".": "./mod.ts"

pkg/@cool/lime/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cool/lime",
3-
"version": "4.0.18",
3+
"version": "4.0.19",
44
"exports": {
55
".": "./mod.ts"
66
}

pkg/@cool/lime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cool/lime",
3-
"version": "4.0.18",
3+
"version": "4.0.19",
44
"type": "module",
55
"exports": {
66
".": "./mod.ts"

pkg/@eser/app-runtime/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eser/app-runtime",
3-
"version": "4.0.18",
3+
"version": "4.0.19",
44
"exports": {
55
".": "./mod.ts"
66
},

pkg/@eser/app-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eser/app-runtime",
3-
"version": "4.0.18",
3+
"version": "4.0.19",
44
"type": "module",
55
"exports": {
66
".": "./mod.ts"

pkg/@eser/bundler/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@ interface BundlerConfig {
340340

341341
// Optional: Base path for URL rewriting
342342
basePath?: string;
343-
344-
// Optional: Development mode
345-
dev?: boolean;
346343
}
347344
```
348345

@@ -443,7 +440,6 @@ const watcher = await bundler.watch(
443440
codeSplitting: false,
444441
minify: false,
445442
sourcemap: "inline",
446-
dev: true,
447443
},
448444
(result) => {
449445
if (result.success) {

pkg/@eser/bundler/backends/deno-bundler.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,26 @@ export class DenoBundlerBackend implements Bundler {
7777
? undefined
7878
: config.sourcemap;
7979

80-
const result = await Deno.bundle({
80+
const options: Deno.bundle.Options = {
8181
entrypoints: allEntrypoints,
8282
outputDir: tempDir,
8383
format: "esm",
8484
codeSplitting: config.codeSplitting,
8585
minify: config.minify,
8686
platform,
8787
sourcemap: sourcemapValue,
88-
...(config.external !== undefined && config.external.length > 0
89-
? { external: [...config.external] }
90-
: {}),
91-
});
88+
};
89+
90+
// TODO(@eser) needs implementation
91+
// if (config.define !== undefined) {
92+
// options.define = config.define;
93+
// }
94+
95+
if (config.external !== undefined) {
96+
options.external = config.external as string[];
97+
}
98+
99+
const result = await Deno.bundle(options);
92100

93101
if (!result.success) {
94102
const diagnostics = (result as unknown as { diagnostics?: unknown[] })
@@ -136,7 +144,9 @@ export class DenoBundlerBackend implements Bundler {
136144
}
137145
};
138146

139-
watchLoop().catch(() => {});
147+
watchLoop().catch((error) => {
148+
console.error("Watch loop error:", error);
149+
});
140150

141151
return Promise.resolve({
142152
stop: () => {
@@ -176,7 +186,7 @@ export class DenoBundlerBackend implements Bundler {
176186
scanDir = nestedDistDir;
177187
}
178188
} catch {
179-
// No nested dir, use outputDir
189+
// FIXME(@eser) expected: directory doesn't exist, use outputDir
180190
}
181191

182192
// Collect all output files (both .js and .map files)

pkg/@eser/bundler/backends/rolldown.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class RolldownBundlerBackend implements Bundler {
123123
input: config.entrypoints as Record<string, string>,
124124
external: config.external as string[] | undefined,
125125
plugins: this.adaptPlugins(config.plugins),
126+
define: config.define as Record<string, string> | undefined,
126127
});
127128

128129
const sourcemapValue: boolean | "inline" | undefined =
@@ -643,6 +644,7 @@ interface RolldownInputOptions {
643644
input: Record<string, string>;
644645
external?: string[];
645646
plugins?: RollupPlugin[];
647+
define?: Record<string, string>;
646648
}
647649

648650
interface RolldownOutputOptions {

0 commit comments

Comments
 (0)