zuby 1.0.35 → 1.0.37
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/commands/build.js +0 -11
- package/config.js +11 -0
- package/constants.d.ts +0 -3
- package/constants.js +0 -3
- package/package.json +2 -2
- package/server/zubyDevServer.js +0 -10
- package/tsconfigs/default.json +20 -0
package/commands/build.js
CHANGED
|
@@ -36,7 +36,6 @@ export default async function build(options) {
|
|
|
36
36
|
build: {
|
|
37
37
|
...viteConfig?.build,
|
|
38
38
|
outDir: normalizePath(join(outDir, 'client')),
|
|
39
|
-
ssrManifest: 'chunks-manifest.json',
|
|
40
39
|
rollupOptions: {
|
|
41
40
|
...viteConfig?.build?.rollupOptions,
|
|
42
41
|
input: {
|
|
@@ -46,7 +45,6 @@ export default async function build(options) {
|
|
|
46
45
|
},
|
|
47
46
|
cacheDir: normalizePath(join(cacheDir, 'client')),
|
|
48
47
|
mode: MODES.production,
|
|
49
|
-
appType: 'custom',
|
|
50
48
|
});
|
|
51
49
|
// Server build
|
|
52
50
|
logger?.info(`${chalk.bgYellow.bold.whiteBright(` Step 2/4 `)} ${chalk.gray(`building server...`)}`);
|
|
@@ -58,19 +56,10 @@ export default async function build(options) {
|
|
|
58
56
|
...viteConfig?.build,
|
|
59
57
|
outDir: normalizePath(join(outDir, 'server')),
|
|
60
58
|
ssr: normalizePath(entryFile),
|
|
61
|
-
ssrManifest: 'chunks-manifest.json',
|
|
62
59
|
target: 'node18',
|
|
63
60
|
},
|
|
64
|
-
optimizeDeps: {
|
|
65
|
-
...viteConfig?.optimizeDeps,
|
|
66
|
-
entries: ['**/*'],
|
|
67
|
-
include: ['**/*'],
|
|
68
|
-
force: true,
|
|
69
|
-
disabled: false,
|
|
70
|
-
},
|
|
71
61
|
cacheDir: normalizePath(join(cacheDir, 'server')),
|
|
72
62
|
mode: MODES.production,
|
|
73
|
-
appType: 'custom',
|
|
74
63
|
});
|
|
75
64
|
// Add serialized zuby config to build directory
|
|
76
65
|
writeFileSync(normalizePath(join(outDir, 'zuby.config.json')), JSON.stringify(zubyInternalConfig, null, 2));
|
package/config.js
CHANGED
|
@@ -99,6 +99,7 @@ export const mergeDefaultConfig = async (config) => {
|
|
|
99
99
|
config.logLevel = config.logLevel ?? 'info';
|
|
100
100
|
// Transform to vite config
|
|
101
101
|
config.vite = config.vite ?? {};
|
|
102
|
+
config.vite.appType = config.vite.appType ?? 'custom';
|
|
102
103
|
config.vite.build = config.vite?.build ?? {};
|
|
103
104
|
config.vite.build.cssMinify = config.vite.build.cssMinify ?? config.minifyCSS;
|
|
104
105
|
config.vite.build.minify = config.vite.build.minify ?? config.minifyJS;
|
|
@@ -109,6 +110,16 @@ export const mergeDefaultConfig = async (config) => {
|
|
|
109
110
|
config.vite.logLevel = config.vite.logLevel ?? config.logLevel;
|
|
110
111
|
config.vite.customLogger = config.vite.customLogger ?? config.customLogger;
|
|
111
112
|
config.vite.server = config.vite.server ?? config.server;
|
|
113
|
+
config.vite.publicDir = config.vite.publicDir ?? config.publicDir;
|
|
114
|
+
config.vite.build.ssrManifest = config.vite.build.ssrManifest ?? 'chunks-manifest.json';
|
|
115
|
+
config.vite.build.ssrEmitAssets = config.vite.build.ssrEmitAssets ?? true;
|
|
116
|
+
config.vite.optimizeDeps = config.vite.optimizeDeps ?? {};
|
|
117
|
+
config.vite.optimizeDeps = {
|
|
118
|
+
...config.vite.optimizeDeps,
|
|
119
|
+
entries: ['**/*', ...(config.vite.optimizeDeps?.entries ?? [])],
|
|
120
|
+
include: ['**/*', ...(config.vite.optimizeDeps?.include ?? [])],
|
|
121
|
+
disabled: false,
|
|
122
|
+
};
|
|
112
123
|
// Merge built-in plugins with user plugins
|
|
113
124
|
config.vite.plugins = [
|
|
114
125
|
...getBuiltInPlugins(),
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zuby",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "Zuby.js is framework for building SPA apps using Vite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"release": "cd ./dist && npm publish --access public && cd ..",
|
|
9
|
-
"build": "rm -rf dist/ && tsc && cp -rf package.json README.md src/examples dist/ && npm run bundle-server",
|
|
9
|
+
"build": "rm -rf dist/ && tsc && cp -rf package.json README.md src/examples src/tsconfigs dist/ && npm run bundle-server",
|
|
10
10
|
"bundle-server": "esbuild src/server/index.ts --bundle --minify=false --platform=node --format=esm --outfile=dist/server/index.js",
|
|
11
11
|
"watch-build": "npm run build && tsc --watch",
|
|
12
12
|
"push-build": "npm run build && cd dist && yalc push --force && cd ..",
|
package/server/zubyDevServer.js
CHANGED
|
@@ -60,7 +60,6 @@ export default class ZubyDevServer extends ZubyServer {
|
|
|
60
60
|
},
|
|
61
61
|
cacheDir: normalizePath(join(this.zubyInternalConfig.cacheDir, 'client')),
|
|
62
62
|
mode: MODES.development,
|
|
63
|
-
appType: 'custom',
|
|
64
63
|
});
|
|
65
64
|
this.viteServerDevServer = await createServer({
|
|
66
65
|
...this.zubyInternalConfig.vite,
|
|
@@ -82,22 +81,13 @@ export default class ZubyDevServer extends ZubyServer {
|
|
|
82
81
|
outDir: normalizePath(join(this.zubyInternalConfig.outDir, 'server')),
|
|
83
82
|
ssr: normalizePath(entryFile),
|
|
84
83
|
ssrManifest: 'chunks-manifest.json',
|
|
85
|
-
ssrEmitAssets: true,
|
|
86
84
|
target: 'node18',
|
|
87
85
|
watch: {
|
|
88
86
|
include: `${this.zubyInternalConfig.srcDir}/**/*`,
|
|
89
87
|
},
|
|
90
88
|
},
|
|
91
|
-
optimizeDeps: {
|
|
92
|
-
...this.zubyInternalConfig.vite.optimizeDeps,
|
|
93
|
-
entries: ['**/*'],
|
|
94
|
-
include: ['**/*'],
|
|
95
|
-
force: true,
|
|
96
|
-
disabled: false,
|
|
97
|
-
},
|
|
98
89
|
cacheDir: normalizePath(join(this.zubyInternalConfig.cacheDir, 'server')),
|
|
99
90
|
mode: MODES.development,
|
|
100
|
-
appType: 'custom',
|
|
101
91
|
});
|
|
102
92
|
this.useBefore(this.viteClientDevServer.middlewares);
|
|
103
93
|
this.useBefore(this.viteServerDevServer.middlewares);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "Bundler",
|
|
7
|
+
"allowImportingTsExtensions": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"verbatimModuleSyntax": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"composite": true,
|
|
17
|
+
"useDefineForClassFields": true,
|
|
18
|
+
"lib": ["ESNext", "DOM", "DOM.Iterable"]
|
|
19
|
+
}
|
|
20
|
+
}
|