@vercube/devkit 0.0.43 → 0.0.45
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/dist/index.mjs +12 -13
- package/package.json +10 -9
package/dist/index.mjs
CHANGED
|
@@ -5,11 +5,11 @@ import { join, resolve } from "node:path";
|
|
|
5
5
|
import consola, { consola as consola$1 } from "consola";
|
|
6
6
|
import { colors } from "consola/utils";
|
|
7
7
|
import { rolldown, watch as watch$1 } from "rolldown";
|
|
8
|
+
import { defu } from "defu";
|
|
8
9
|
import { resolve as resolve$1 } from "pathe";
|
|
9
10
|
import UnpluginIsolatedDecl from "unplugin-isolated-decl/rolldown";
|
|
10
11
|
import { watch as watch$2 } from "chokidar";
|
|
11
12
|
import { fork } from "node:child_process";
|
|
12
|
-
|
|
13
13
|
//#region src/Common/App.ts
|
|
14
14
|
/**
|
|
15
15
|
* Creates a development server application.
|
|
@@ -25,14 +25,19 @@ async function createVercube(cfg) {
|
|
|
25
25
|
})
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
//#endregion
|
|
30
29
|
//#region src/Bundlers/Rolldown/Config.ts
|
|
31
30
|
/**
|
|
32
31
|
* Generates a Rolldown configuration based on the provided build options.
|
|
33
32
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* Builds a base config from `ctx` (entry, output, tsconfig, plugins, defines, etc.) and then
|
|
34
|
+
* deep-merges it with `ctx.rolldownConfig` using `defu`, so user-supplied options take precedence
|
|
35
|
+
* over the defaults. The `input`, `output`, and `onwarn` fields are always controlled internally
|
|
36
|
+
* and cannot be overridden via `rolldownConfig`.
|
|
37
|
+
*
|
|
38
|
+
* @param ctx - Build configuration options. When omitted, sensible defaults are used
|
|
39
|
+
* (entry: `src/index.ts`, output: `dist`, tsconfig: `tsconfig.json`, dts: `true`).
|
|
40
|
+
* @returns A promise that resolves to the merged Rolldown configuration.
|
|
36
41
|
*/
|
|
37
42
|
async function getRolldownConfig(ctx) {
|
|
38
43
|
const root = ctx?.root ?? process.cwd();
|
|
@@ -47,7 +52,7 @@ async function getRolldownConfig(ctx) {
|
|
|
47
52
|
transformer: "oxc",
|
|
48
53
|
patchCjsDefaultExport: true
|
|
49
54
|
}));
|
|
50
|
-
|
|
55
|
+
const baseOptions = {
|
|
51
56
|
input: typeof input === "string" ? { index: input } : input,
|
|
52
57
|
tsconfig: resolve$1(root, tsconfig),
|
|
53
58
|
external: [
|
|
@@ -70,8 +75,8 @@ async function getRolldownConfig(ctx) {
|
|
|
70
75
|
},
|
|
71
76
|
plugins: [...defaultPlugins, ...customPlugins]
|
|
72
77
|
};
|
|
78
|
+
return defu(ctx?.rolldownConfig ?? {}, baseOptions);
|
|
73
79
|
}
|
|
74
|
-
|
|
75
80
|
//#endregion
|
|
76
81
|
//#region src/Bundlers/Rolldown/Build.ts
|
|
77
82
|
/**
|
|
@@ -99,7 +104,6 @@ async function build$1(ctx) {
|
|
|
99
104
|
message: colors.gray(`Built ${colors.cyan(join(ctx?.output?.dir ?? "", result?.fileName ?? ""))} - ${(Buffer.byteLength(result?.code ?? "") / 1024).toFixed(2)}kb`)
|
|
100
105
|
});
|
|
101
106
|
}
|
|
102
|
-
|
|
103
107
|
//#endregion
|
|
104
108
|
//#region src/Bundlers/Rolldown/Watch.ts
|
|
105
109
|
/**
|
|
@@ -141,7 +145,6 @@ async function watch$3(app) {
|
|
|
141
145
|
}
|
|
142
146
|
});
|
|
143
147
|
}
|
|
144
|
-
|
|
145
148
|
//#endregion
|
|
146
149
|
//#region src/Utils/Utils.ts
|
|
147
150
|
/**
|
|
@@ -160,7 +163,6 @@ function getBuildFunc(bundler) {
|
|
|
160
163
|
function getWatchFunc(bundler) {
|
|
161
164
|
return watch$3;
|
|
162
165
|
}
|
|
163
|
-
|
|
164
166
|
//#endregion
|
|
165
167
|
//#region src/Build/Build.ts
|
|
166
168
|
/**
|
|
@@ -171,7 +173,6 @@ function getWatchFunc(bundler) {
|
|
|
171
173
|
async function build(app) {
|
|
172
174
|
await getBuildFunc(app?.config?.build?.bundler ?? "rolldown")(app?.config?.build);
|
|
173
175
|
}
|
|
174
|
-
|
|
175
176
|
//#endregion
|
|
176
177
|
//#region src/Build/Watch.ts
|
|
177
178
|
/**
|
|
@@ -211,7 +212,6 @@ async function watch(app) {
|
|
|
211
212
|
});
|
|
212
213
|
await watcher(app);
|
|
213
214
|
}
|
|
214
|
-
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region src/Server/DevServer.ts
|
|
217
217
|
/**
|
|
@@ -263,6 +263,5 @@ function createDevServer(app) {
|
|
|
263
263
|
reload
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
|
|
267
266
|
//#endregion
|
|
268
|
-
export { build, createDevServer, createVercube, watch };
|
|
267
|
+
export { build, createDevServer, createVercube, watch };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/devkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.45",
|
|
4
4
|
"description": "Devkit module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,18 +22,19 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@oxc-project/runtime": "0.
|
|
26
|
-
"c12": "
|
|
25
|
+
"@oxc-project/runtime": "0.120.0",
|
|
26
|
+
"c12": "4.0.0-beta.4",
|
|
27
27
|
"chokidar": "5.0.0",
|
|
28
28
|
"consola": "3.4.2",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"oxc-
|
|
29
|
+
"defu": "6.1.4",
|
|
30
|
+
"dotenv": "17.3.1",
|
|
31
|
+
"hookable": "6.1.0",
|
|
32
|
+
"oxc-parser": "0.120.0",
|
|
33
|
+
"oxc-transform": "0.120.0",
|
|
33
34
|
"pathe": "2.0.3",
|
|
34
|
-
"rolldown": "1.0.0-rc.
|
|
35
|
+
"rolldown": "1.0.0-rc.9",
|
|
35
36
|
"unplugin-isolated-decl": "0.15.7",
|
|
36
|
-
"@vercube/core": "0.0.
|
|
37
|
+
"@vercube/core": "0.0.45"
|
|
37
38
|
},
|
|
38
39
|
"publishConfig": {
|
|
39
40
|
"access": "public"
|