@typed/vite-plugin 0.17.1 → 1.0.0-beta.2
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/README.md +97 -0
- package/dist/debugBuildPlugin.d.ts +7 -0
- package/dist/debugBuildPlugin.d.ts.map +1 -0
- package/dist/debugBuildPlugin.js +54 -0
- package/dist/index.d.ts +71 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -5
- package/package.json +27 -29
- package/src/index.test.ts +97 -0
- package/src/index.ts +224 -4
- package/dist/cjs/constants.d.ts +0 -2
- package/dist/cjs/constants.d.ts.map +0 -1
- package/dist/cjs/constants.js +0 -5
- package/dist/cjs/constants.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -5
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -26
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/resolveTypedConfig.d.ts +0 -20
- package/dist/cjs/resolveTypedConfig.d.ts.map +0 -1
- package/dist/cjs/resolveTypedConfig.js +0 -16
- package/dist/cjs/resolveTypedConfig.js.map +0 -1
- package/dist/cjs/vite-plugin.d.ts +0 -56
- package/dist/cjs/vite-plugin.d.ts.map +0 -1
- package/dist/cjs/vite-plugin.js +0 -212
- package/dist/cjs/vite-plugin.js.map +0 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/resolveTypedConfig.d.ts +0 -20
- package/dist/resolveTypedConfig.d.ts.map +0 -1
- package/dist/resolveTypedConfig.js +0 -12
- package/dist/resolveTypedConfig.js.map +0 -1
- package/dist/tsconfig.cjs.build.tsbuildinfo +0 -1
- package/dist/vite-plugin.d.ts +0 -56
- package/dist/vite-plugin.d.ts.map +0 -1
- package/dist/vite-plugin.js +0 -179
- package/dist/vite-plugin.js.map +0 -1
- package/eslintrc.json +0 -3
- package/project.json +0 -44
- package/readme.md +0 -3
- package/src/constants.ts +0 -1
- package/src/resolveTypedConfig.ts +0 -35
- package/src/vite-plugin.ts +0 -312
- package/tsconfig.build.json +0 -8
- package/tsconfig.build.tsbuildinfo +0 -1
- package/tsconfig.cjs.build.json +0 -13
- package/tsconfig.json +0 -18
- package/vite.config.js +0 -3
package/src/index.ts
CHANGED
|
@@ -1,7 +1,227 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typed/vite-plugin — One-stop Vite preset: tsconfig paths, bundle analyzer,
|
|
3
|
+
* Brotli compression, virtual-modules Vite plugin, and @typed/app VM plugins.
|
|
4
|
+
*/
|
|
5
|
+
import type { TypedConfig } from "@typed/app";
|
|
6
|
+
import {
|
|
7
|
+
createHttpApiVirtualModulePlugin,
|
|
8
|
+
createRouterVirtualModulePlugin,
|
|
9
|
+
HttpApiVirtualModulePluginOptions,
|
|
10
|
+
loadTypedConfig,
|
|
11
|
+
RouterVirtualModulePluginOptions,
|
|
12
|
+
} from "@typed/app";
|
|
13
|
+
import type { CreateTypeInfoApiSession, VirtualModuleResolver } from "@typed/virtual-modules";
|
|
14
|
+
import {
|
|
15
|
+
collectTypeTargetSpecsFromPlugins,
|
|
16
|
+
createLanguageServiceSessionFactory,
|
|
17
|
+
PluginManager,
|
|
18
|
+
} from "@typed/virtual-modules";
|
|
19
|
+
import { virtualModulesVitePlugin } from "@typed/virtual-modules-vite";
|
|
20
|
+
import { dirname, relative, resolve } from "node:path";
|
|
21
|
+
import process from "node:process";
|
|
22
|
+
import { visualizer } from "rollup-plugin-visualizer";
|
|
23
|
+
import ts from "typescript";
|
|
24
|
+
import type { Plugin } from "vite";
|
|
25
|
+
import viteCompression from "vite-plugin-compression";
|
|
26
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
2
27
|
|
|
3
|
-
|
|
28
|
+
/** Options for vite-plugin-compression when compression is enabled. */
|
|
29
|
+
export type TypedViteCompressionOptions =
|
|
30
|
+
| boolean
|
|
31
|
+
| {
|
|
32
|
+
readonly algorithm?: "gzip" | "brotliCompress" | "deflate" | "deflateRaw";
|
|
33
|
+
readonly ext?: string;
|
|
34
|
+
readonly threshold?: number;
|
|
35
|
+
readonly [key: string]: unknown;
|
|
36
|
+
};
|
|
4
37
|
|
|
5
|
-
export
|
|
38
|
+
export interface TypedVitePluginOptions {
|
|
39
|
+
/**
|
|
40
|
+
* Options for the router VM plugin from @typed/app.
|
|
41
|
+
*/
|
|
42
|
+
readonly routerVmOptions?: RouterVirtualModulePluginOptions;
|
|
6
43
|
|
|
7
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Options for the HttpApi VM plugin from @typed/app. HttpApi VM plugin is always
|
|
46
|
+
* registered (router first, then HttpApi). Use this to customize its behavior.
|
|
47
|
+
*/
|
|
48
|
+
readonly apiVmOptions?: HttpApiVirtualModulePluginOptions;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Session factory for TypeInfo API. When not provided, a Language Service-backed
|
|
52
|
+
* session is auto-created from the project's tsconfig (evolves as files change).
|
|
53
|
+
* Override for custom session setup.
|
|
54
|
+
*/
|
|
55
|
+
readonly createTypeInfoApiSession?: CreateTypeInfoApiSession;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Path to tsconfig.json (relative to cwd or absolute). When set, both the
|
|
59
|
+
* Language Service session and vite-tsconfig-paths use this tsconfig.
|
|
60
|
+
* Default: auto-discovered from project root.
|
|
61
|
+
*/
|
|
62
|
+
readonly tsconfig?: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Enable tsconfig path resolution. Default true.
|
|
66
|
+
*/
|
|
67
|
+
readonly tsconfigPaths?: boolean | Record<string, unknown>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Enable bundle analyzer. Default: process.env.ANALYZE === '1'.
|
|
71
|
+
*/
|
|
72
|
+
readonly analyze?: boolean | { filename?: string; open?: boolean; template?: string };
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* When true, virtual module resolution errors are logged. Default true.
|
|
76
|
+
*/
|
|
77
|
+
readonly warnOnError?: boolean;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Enable Brotli compression for build. Default true.
|
|
81
|
+
* Set false to disable, or pass options to customize (algorithm, ext, threshold).
|
|
82
|
+
*/
|
|
83
|
+
readonly compression?: TypedViteCompressionOptions;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Optional dependency injection for createTypedViteResolver (e.g. for tests). */
|
|
87
|
+
export interface TypedViteResolverDependencies {
|
|
88
|
+
createHttpApiVirtualModulePlugin?: (
|
|
89
|
+
opts: HttpApiVirtualModulePluginOptions,
|
|
90
|
+
) => import("@typed/virtual-modules").VirtualModulePlugin;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Invariant: ALL @typed/app VM plugins are always registered. There are no optional
|
|
95
|
+
* or conditional app plugins. When adding a new VM plugin to @typed/app, add it here.
|
|
96
|
+
*/
|
|
97
|
+
export function createTypedViteResolver(
|
|
98
|
+
options: TypedVitePluginOptions = {},
|
|
99
|
+
dependencies?: TypedViteResolverDependencies,
|
|
100
|
+
): VirtualModuleResolver {
|
|
101
|
+
const httpApiFactory =
|
|
102
|
+
dependencies?.createHttpApiVirtualModulePlugin ?? createHttpApiVirtualModulePlugin;
|
|
103
|
+
const plugins: import("@typed/virtual-modules").VirtualModulePlugin[] = [
|
|
104
|
+
createRouterVirtualModulePlugin(options.routerVmOptions ?? {}),
|
|
105
|
+
httpApiFactory(options.apiVmOptions ?? {}),
|
|
106
|
+
];
|
|
107
|
+
return new PluginManager(plugins);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function optionsFromTypedConfig(config: TypedConfig): TypedVitePluginOptions {
|
|
111
|
+
return {
|
|
112
|
+
routerVmOptions: config.router ? { prefix: config.router.prefix } : undefined,
|
|
113
|
+
apiVmOptions: config.api
|
|
114
|
+
? { prefix: config.api.prefix, pathPrefix: config.api.pathPrefix }
|
|
115
|
+
: undefined,
|
|
116
|
+
tsconfig: config.tsconfig,
|
|
117
|
+
tsconfigPaths: config.tsconfigPaths,
|
|
118
|
+
analyze: config.analyze,
|
|
119
|
+
warnOnError: config.warnOnError,
|
|
120
|
+
compression: config.compression,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Returns Vite plugins: tsconfig paths, virtual modules (@typed/app), and optional bundle analyzer.
|
|
126
|
+
* Use as: `defineConfig({ plugins: typedVitePlugin() })`.
|
|
127
|
+
*
|
|
128
|
+
* When called with no arguments, auto-discovers `typed.config.ts` in the project root.
|
|
129
|
+
* When called with explicit options, those take full precedence (config file is not loaded).
|
|
130
|
+
*/
|
|
131
|
+
export function typedVitePlugin(options?: TypedVitePluginOptions): Plugin[] {
|
|
132
|
+
const resolvedOptions: TypedVitePluginOptions = (() => {
|
|
133
|
+
if (options) return options;
|
|
134
|
+
const result = loadTypedConfig({ projectRoot: process.cwd(), ts });
|
|
135
|
+
if (result.status === "loaded") return optionsFromTypedConfig(result.config);
|
|
136
|
+
return {};
|
|
137
|
+
})();
|
|
138
|
+
|
|
139
|
+
const resolver = createTypedViteResolver(resolvedOptions);
|
|
140
|
+
const analyze = resolvedOptions.analyze ?? (process.env.ANALYZE === "1" ? true : false);
|
|
141
|
+
|
|
142
|
+
let createTypeInfoApiSession: CreateTypeInfoApiSession | undefined =
|
|
143
|
+
resolvedOptions.createTypeInfoApiSession;
|
|
144
|
+
|
|
145
|
+
if (createTypeInfoApiSession === undefined) {
|
|
146
|
+
try {
|
|
147
|
+
const manager = resolver as PluginManager;
|
|
148
|
+
const typeTargetSpecs = collectTypeTargetSpecsFromPlugins(manager.plugins);
|
|
149
|
+
const cwd = process.cwd();
|
|
150
|
+
const tsconfigPath = resolvedOptions.tsconfig
|
|
151
|
+
? resolve(cwd, resolvedOptions.tsconfig)
|
|
152
|
+
: undefined;
|
|
153
|
+
const projectRoot = tsconfigPath ? dirname(tsconfigPath) : cwd;
|
|
154
|
+
createTypeInfoApiSession = createLanguageServiceSessionFactory({
|
|
155
|
+
ts,
|
|
156
|
+
projectRoot,
|
|
157
|
+
typeTargetSpecs,
|
|
158
|
+
tsconfigPath,
|
|
159
|
+
});
|
|
160
|
+
} catch {
|
|
161
|
+
// Graceful degradation: no session, plugins get noop TypeInfoApi
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const plugins: Plugin[] = [];
|
|
166
|
+
|
|
167
|
+
if (resolvedOptions.tsconfigPaths !== false) {
|
|
168
|
+
const basePathsOpts =
|
|
169
|
+
typeof resolvedOptions.tsconfigPaths === "object" ? resolvedOptions.tsconfigPaths : {};
|
|
170
|
+
const cwd = process.cwd();
|
|
171
|
+
const resolvedTsconfig = resolvedOptions.tsconfig
|
|
172
|
+
? resolve(cwd, resolvedOptions.tsconfig)
|
|
173
|
+
: undefined;
|
|
174
|
+
const pathsOpts =
|
|
175
|
+
resolvedTsconfig !== undefined
|
|
176
|
+
? {
|
|
177
|
+
...basePathsOpts,
|
|
178
|
+
root: cwd,
|
|
179
|
+
projects: [relative(cwd, resolvedTsconfig)],
|
|
180
|
+
}
|
|
181
|
+
: basePathsOpts;
|
|
182
|
+
plugins.push(tsconfigPaths(pathsOpts) as Plugin);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
plugins.push(
|
|
186
|
+
virtualModulesVitePlugin({
|
|
187
|
+
resolver,
|
|
188
|
+
createTypeInfoApiSession,
|
|
189
|
+
warnOnError: resolvedOptions.warnOnError ?? true,
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
if (analyze) {
|
|
194
|
+
const vizOpts =
|
|
195
|
+
typeof analyze === "object"
|
|
196
|
+
? analyze
|
|
197
|
+
: { filename: "dist/stats.html", template: "treemap" as const };
|
|
198
|
+
plugins.push(
|
|
199
|
+
visualizer({
|
|
200
|
+
filename: vizOpts.filename ?? "dist/stats.html",
|
|
201
|
+
open: vizOpts.open ?? false,
|
|
202
|
+
template:
|
|
203
|
+
(vizOpts.template as "treemap" | "sunburst" | "flamegraph" | "network") ?? "treemap",
|
|
204
|
+
}) as Plugin,
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const compression = resolvedOptions.compression ?? true;
|
|
209
|
+
if (compression !== false) {
|
|
210
|
+
const compressionOpts =
|
|
211
|
+
typeof compression === "object"
|
|
212
|
+
? {
|
|
213
|
+
algorithm: "brotliCompress" as const,
|
|
214
|
+
ext: ".br",
|
|
215
|
+
threshold: 1024,
|
|
216
|
+
...compression,
|
|
217
|
+
}
|
|
218
|
+
: {
|
|
219
|
+
algorithm: "brotliCompress" as const,
|
|
220
|
+
ext: ".br",
|
|
221
|
+
threshold: 1024,
|
|
222
|
+
};
|
|
223
|
+
plugins.push(viteCompression(compressionOpts) as Plugin);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return plugins;
|
|
227
|
+
}
|
package/dist/cjs/constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,uBAAuB,CAAA"}
|
package/dist/cjs/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,oBAAoB,CAAA"}
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AAEpC,eAAe,KAAK,CAAA;AAEpB,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.resolveTypedConfig = void 0;
|
|
21
|
-
const vite_plugin_js_1 = __importDefault(require("./vite-plugin.js"));
|
|
22
|
-
exports.default = vite_plugin_js_1.default;
|
|
23
|
-
__exportStar(require("./vite-plugin.js"), exports);
|
|
24
|
-
var resolveTypedConfig_js_1 = require("./resolveTypedConfig.js");
|
|
25
|
-
Object.defineProperty(exports, "resolveTypedConfig", { enumerable: true, get: function () { return resolveTypedConfig_js_1.resolveTypedConfig; } });
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,sEAAoC;AAEpC,kBAAe,wBAAK,CAAA;AAEpB,mDAAgC;AAEhC,iEAA4D;AAAnD,2HAAA,kBAAkB,OAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Option } from '@effect/data/Option';
|
|
2
|
-
import { resolveConfig } from 'vite';
|
|
3
|
-
export declare function resolveTypedConfig(...args: ArgsOf<typeof resolveConfig>): Promise<Option<ResolvedOptions>>;
|
|
4
|
-
type ArgsOf<T> = T extends (...args: infer A) => any ? A : never;
|
|
5
|
-
export interface ResolvedOptions {
|
|
6
|
-
readonly assetDirectory: string;
|
|
7
|
-
readonly base: string;
|
|
8
|
-
readonly clientOutputDirectory: string;
|
|
9
|
-
readonly debug: boolean;
|
|
10
|
-
readonly exclusions: readonly string[];
|
|
11
|
-
readonly htmlFiles: readonly string[];
|
|
12
|
-
readonly isStaticBuild: boolean;
|
|
13
|
-
readonly saveGeneratedModules: boolean;
|
|
14
|
-
readonly serverFilePath: Option<string>;
|
|
15
|
-
readonly serverOutputDirectory: string;
|
|
16
|
-
readonly sourceDirectory: string;
|
|
17
|
-
readonly tsConfig: string;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=resolveTypedConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTypedConfig.d.ts","sourceRoot":"","sources":["../../src/resolveTypedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAKpC,wBAAsB,kBAAkB,CACtC,GAAG,IAAI,EAAE,MAAM,CAAC,OAAO,aAAa,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CASlC;AAED,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA;AAEhE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAA;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAA;IACtC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveTypedConfig = void 0;
|
|
4
|
-
const Option_1 = require("@effect/data/Option");
|
|
5
|
-
const vite_1 = require("vite");
|
|
6
|
-
const constants_js_1 = require("./constants.js");
|
|
7
|
-
async function resolveTypedConfig(...args) {
|
|
8
|
-
const config = await (0, vite_1.resolveConfig)(...args);
|
|
9
|
-
const typedPlugin = config.plugins.find((p) => p.name === constants_js_1.PLUGIN_NAME);
|
|
10
|
-
if (!typedPlugin) {
|
|
11
|
-
return (0, Option_1.none)();
|
|
12
|
-
}
|
|
13
|
-
return (0, Option_1.some)(typedPlugin.resolvedOptions);
|
|
14
|
-
}
|
|
15
|
-
exports.resolveTypedConfig = resolveTypedConfig;
|
|
16
|
-
//# sourceMappingURL=resolveTypedConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTypedConfig.js","sourceRoot":"","sources":["../../src/resolveTypedConfig.ts"],"names":[],"mappings":";;;AAAA,gDAA6D;AAC7D,+BAAoC;AAEpC,iDAA4C;AAGrC,KAAK,UAAU,kBAAkB,CACtC,GAAG,IAAkC;IAErC,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAa,EAAC,GAAG,IAAI,CAAC,CAAA;IAC3C,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAwB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,0BAAW,CAAC,CAAA;IAE5F,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAA,aAAI,GAAE,CAAA;KACd;IAED,OAAO,IAAA,aAAI,EAAC,WAAW,CAAC,eAAe,CAAC,CAAA;AAC1C,CAAC;AAXD,gDAWC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { Plugin, PluginOption } from 'vite';
|
|
2
|
-
import { PLUGIN_NAME } from './constants.js';
|
|
3
|
-
import { ResolvedOptions } from './resolveTypedConfig.js';
|
|
4
|
-
/**
|
|
5
|
-
* The Configuration for the Typed Plugin. All file paths can be relative to sourceDirectory or
|
|
6
|
-
* can be absolute, path.resolve is used to stitch things together.
|
|
7
|
-
*/
|
|
8
|
-
export interface PluginOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The directory in which you have your application.
|
|
11
|
-
* This can be relative to the current working directory or absolute.
|
|
12
|
-
*/
|
|
13
|
-
readonly sourceDirectory?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The file path to your tsconfig.json file.
|
|
16
|
-
*/
|
|
17
|
-
readonly tsConfig?: string;
|
|
18
|
-
/**
|
|
19
|
-
* The file path to your server entry file
|
|
20
|
-
*/
|
|
21
|
-
readonly serverFilePath?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The output directory for your client code
|
|
24
|
-
*/
|
|
25
|
-
readonly clientOutputDirectory?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The output directory for your server code
|
|
28
|
-
*/
|
|
29
|
-
readonly serverOutputDirectory?: string;
|
|
30
|
-
/**
|
|
31
|
-
* File globs to use to look for your HTML entry points.
|
|
32
|
-
*/
|
|
33
|
-
readonly htmlFileGlobs?: readonly string[];
|
|
34
|
-
/**
|
|
35
|
-
* If true, will configure the effect-ts plugin to include debugger statements. If
|
|
36
|
-
* effectTsOptions.debug is provided it will override this value.
|
|
37
|
-
*/
|
|
38
|
-
readonly debug?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* If true, will configure the plugin to save all the generated files to disk
|
|
41
|
-
*/
|
|
42
|
-
readonly saveGeneratedModules?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* If true, will configure the plugin to operate in a static build mode.
|
|
45
|
-
*/
|
|
46
|
-
readonly isStaticBuild?: boolean;
|
|
47
|
-
}
|
|
48
|
-
export interface TypedVitePlugin extends Plugin {
|
|
49
|
-
readonly name: typeof PLUGIN_NAME;
|
|
50
|
-
readonly resolvedOptions: ResolvedOptions;
|
|
51
|
-
}
|
|
52
|
-
export default function makePlugin(pluginOptions: PluginOptions): PluginOption[];
|
|
53
|
-
export declare function resolveOptions({ sourceDirectory: directory, tsConfig, serverFilePath, clientOutputDirectory, serverOutputDirectory, htmlFileGlobs, debug, saveGeneratedModules, isStaticBuild, }: PluginOptions): ResolvedOptions;
|
|
54
|
-
export declare function findHtmlFiles(directory: string, htmlFileGlobs: readonly string[] | undefined, exclusions: readonly string[]): readonly string[];
|
|
55
|
-
export declare function buildClientInput(htmlFilePaths: readonly string[]): {};
|
|
56
|
-
//# sourceMappingURL=vite-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugin.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAa,MAAM,EAAE,YAAY,EAAc,MAAM,MAAM,CAAA;AAcvE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,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GAC5B,SAAS,MAAM,EAAE,CAYnB;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,MAKhE"}
|
package/dist/cjs/vite-plugin.js
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.buildClientInput = exports.findHtmlFiles = exports.resolveOptions = void 0;
|
|
30
|
-
const fs_1 = require("fs");
|
|
31
|
-
const path_1 = require("path");
|
|
32
|
-
const Function_1 = require("@effect/data/Function");
|
|
33
|
-
const Option = __importStar(require("@effect/data/Option"));
|
|
34
|
-
const vite = __importStar(require("@typed/virtual-module/vite"));
|
|
35
|
-
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
36
|
-
const rollup_plugin_visualizer_1 = require("rollup-plugin-visualizer");
|
|
37
|
-
const vavite_1 = __importDefault(require("vavite"));
|
|
38
|
-
const vite_plugin_compression_1 = __importDefault(require("vite-plugin-compression"));
|
|
39
|
-
const vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
|
|
40
|
-
const tsconfigPaths = typeof vite_tsconfig_paths_1.default === 'function'
|
|
41
|
-
? vite_tsconfig_paths_1.default
|
|
42
|
-
: vite_tsconfig_paths_1.default.default;
|
|
43
|
-
const virtualModulePlugin = typeof vite.virtualModulePlugin === 'function'
|
|
44
|
-
? vite.virtualModulePlugin
|
|
45
|
-
: vite.default.virtualModulePlugin;
|
|
46
|
-
const constants_js_1 = require("./constants.js");
|
|
47
|
-
const cwd = process.cwd();
|
|
48
|
-
function makePlugin(pluginOptions) {
|
|
49
|
-
const options = resolveOptions(pluginOptions);
|
|
50
|
-
// let devServer: ViteDevServer
|
|
51
|
-
let isSsr = false;
|
|
52
|
-
const plugins = [
|
|
53
|
-
tsconfigPaths({
|
|
54
|
-
projects: [options.tsConfig],
|
|
55
|
-
}),
|
|
56
|
-
// @ts-expect-error -- Types don't seem to be correct
|
|
57
|
-
(0, rollup_plugin_visualizer_1.visualizer)({
|
|
58
|
-
emitFile: true,
|
|
59
|
-
filename: 'bundle-visualizer.html',
|
|
60
|
-
gzipSize: true,
|
|
61
|
-
brotliSize: true,
|
|
62
|
-
}),
|
|
63
|
-
...(0, Function_1.pipe)(options.serverFilePath, Option.filter(() => !options.isStaticBuild), Option.map((serverEntry) => (0, vavite_1.default)({
|
|
64
|
-
serverEntry,
|
|
65
|
-
serveClientAssetsInDev: true,
|
|
66
|
-
})), Option.toArray),
|
|
67
|
-
virtualModulePlugin({
|
|
68
|
-
...options,
|
|
69
|
-
environment: options.isStaticBuild ? 'static' : isSsr ? 'server' : 'browser',
|
|
70
|
-
}),
|
|
71
|
-
];
|
|
72
|
-
const typedPlugin = {
|
|
73
|
-
name: constants_js_1.PLUGIN_NAME,
|
|
74
|
-
get resolvedOptions() {
|
|
75
|
-
return options;
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Configures our production build using vavite
|
|
79
|
-
*/
|
|
80
|
-
config(config, env) {
|
|
81
|
-
isSsr = env.ssrBuild ?? false;
|
|
82
|
-
if (!config.root) {
|
|
83
|
-
config.root = options.sourceDirectory;
|
|
84
|
-
}
|
|
85
|
-
// Configure Build steps when running with vavite
|
|
86
|
-
if (env.mode === 'multibuild') {
|
|
87
|
-
const clientBuild = {
|
|
88
|
-
outDir: options.clientOutputDirectory,
|
|
89
|
-
rollupOptions: {
|
|
90
|
-
input: buildClientInput(options.htmlFiles),
|
|
91
|
-
external: ['happy-dom'],
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
const clientConfig = {
|
|
95
|
-
name: 'client',
|
|
96
|
-
// @ts-expect-error Unable to resolve types properly for compression
|
|
97
|
-
config: { build: clientBuild, plugins: [(0, vite_plugin_compression_1.default)()] },
|
|
98
|
-
};
|
|
99
|
-
const serverConfig = (0, Function_1.pipe)(options.serverFilePath, Option.map((index) => ({
|
|
100
|
-
ssr: true,
|
|
101
|
-
outDir: options.serverOutputDirectory,
|
|
102
|
-
rollupOptions: {
|
|
103
|
-
input: {
|
|
104
|
-
index,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
})), Option.map((build) => ({
|
|
108
|
-
name: 'server',
|
|
109
|
-
config: {
|
|
110
|
-
build,
|
|
111
|
-
optimizeDeps: {
|
|
112
|
-
// Allow @typed/framework to include virtual imports
|
|
113
|
-
exclude: ['@typed/framework', '@typed/framework/*'],
|
|
114
|
-
},
|
|
115
|
-
plugins: [],
|
|
116
|
-
},
|
|
117
|
-
})), Option.toArray);
|
|
118
|
-
// Hack to add support for build steps in vavite
|
|
119
|
-
const multiBuildConfig = config;
|
|
120
|
-
// Append our build steps to the end of the build steps
|
|
121
|
-
multiBuildConfig.buildSteps = (multiBuildConfig.buildSteps || []).concat([clientConfig].concat(serverConfig));
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* Updates our resolved options with the correct base path
|
|
126
|
-
* and parses our input files for our manifest
|
|
127
|
-
*/
|
|
128
|
-
configResolved(config) {
|
|
129
|
-
// Ensure final options has the correct base path
|
|
130
|
-
Object.assign(options, { base: config.base, assetDirectory: config.build.assetsDir });
|
|
131
|
-
},
|
|
132
|
-
/**
|
|
133
|
-
* Resolve and build our virtual modules
|
|
134
|
-
*/
|
|
135
|
-
async resolveId(id) {
|
|
136
|
-
if (id === 'typed:config') {
|
|
137
|
-
return id;
|
|
138
|
-
}
|
|
139
|
-
return null;
|
|
140
|
-
},
|
|
141
|
-
/**
|
|
142
|
-
* Load our virtual modules
|
|
143
|
-
*/
|
|
144
|
-
load(id) {
|
|
145
|
-
if (id === 'typed:config') {
|
|
146
|
-
return Object.entries(options).reduce((acc, [key, value]) => {
|
|
147
|
-
acc += `export const ${key} = ${JSON.stringify(value)}\n`;
|
|
148
|
-
return acc;
|
|
149
|
-
}, '');
|
|
150
|
-
}
|
|
151
|
-
return null;
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
plugins.push(typedPlugin);
|
|
155
|
-
return plugins;
|
|
156
|
-
}
|
|
157
|
-
exports.default = makePlugin;
|
|
158
|
-
function resolveOptions({ sourceDirectory: directory = cwd, tsConfig, serverFilePath, clientOutputDirectory, serverOutputDirectory, htmlFileGlobs, debug = false, saveGeneratedModules = false, isStaticBuild = process.env.STATIC_BUILD === 'true', }) {
|
|
159
|
-
// Resolved options
|
|
160
|
-
const sourceDirectory = (0, path_1.resolve)(cwd, directory);
|
|
161
|
-
const tsConfigFilePath = (0, path_1.resolve)(sourceDirectory, tsConfig ?? 'tsconfig.json');
|
|
162
|
-
const resolvedServerFilePath = (0, path_1.resolve)(sourceDirectory, serverFilePath ?? 'server.ts');
|
|
163
|
-
const serverExists = (0, fs_1.existsSync)(resolvedServerFilePath);
|
|
164
|
-
const resolvedServerOutputDirectory = (0, path_1.resolve)(sourceDirectory, serverOutputDirectory ?? 'dist/server');
|
|
165
|
-
const resolvedClientOutputDirectory = (0, path_1.resolve)(sourceDirectory, clientOutputDirectory ?? 'dist/client');
|
|
166
|
-
const exclusions = [
|
|
167
|
-
getRelativePath(sourceDirectory, (0, path_1.join)(resolvedServerOutputDirectory, '/**/*')),
|
|
168
|
-
getRelativePath(sourceDirectory, (0, path_1.join)(resolvedClientOutputDirectory, '/**/*')),
|
|
169
|
-
'**/node_modules/**',
|
|
170
|
-
];
|
|
171
|
-
const resolvedOptions = {
|
|
172
|
-
assetDirectory: 'assets',
|
|
173
|
-
base: '/',
|
|
174
|
-
clientOutputDirectory: resolvedClientOutputDirectory,
|
|
175
|
-
debug,
|
|
176
|
-
exclusions,
|
|
177
|
-
htmlFiles: findHtmlFiles(sourceDirectory, htmlFileGlobs, exclusions).map((p) => (0, path_1.resolve)(sourceDirectory, p)),
|
|
178
|
-
isStaticBuild,
|
|
179
|
-
saveGeneratedModules,
|
|
180
|
-
serverFilePath: serverExists ? Option.some(resolvedServerFilePath) : Option.none(),
|
|
181
|
-
serverOutputDirectory: resolvedServerOutputDirectory,
|
|
182
|
-
sourceDirectory,
|
|
183
|
-
tsConfig: tsConfigFilePath,
|
|
184
|
-
};
|
|
185
|
-
return resolvedOptions;
|
|
186
|
-
}
|
|
187
|
-
exports.resolveOptions = resolveOptions;
|
|
188
|
-
function findHtmlFiles(directory, htmlFileGlobs, exclusions) {
|
|
189
|
-
if (htmlFileGlobs) {
|
|
190
|
-
// eslint-disable-next-line import/no-named-as-default-member
|
|
191
|
-
return fast_glob_1.default.sync([...htmlFileGlobs, ...exclusions.map((x) => '!' + x)], {
|
|
192
|
-
cwd: directory,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
// eslint-disable-next-line import/no-named-as-default-member
|
|
196
|
-
return fast_glob_1.default.sync(['**/*.html', ...exclusions.map((x) => '!' + x)], {
|
|
197
|
-
cwd: directory,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
exports.findHtmlFiles = findHtmlFiles;
|
|
201
|
-
function buildClientInput(htmlFilePaths) {
|
|
202
|
-
return htmlFilePaths.reduce((acc, htmlFilePath) => ({ ...acc, [(0, path_1.basename)(htmlFilePath, '.html')]: htmlFilePath }), {});
|
|
203
|
-
}
|
|
204
|
-
exports.buildClientInput = buildClientInput;
|
|
205
|
-
function getRelativePath(from, to) {
|
|
206
|
-
const path = (0, path_1.relative)(from, to);
|
|
207
|
-
if (path.startsWith('.')) {
|
|
208
|
-
return path;
|
|
209
|
-
}
|
|
210
|
-
return './' + path;
|
|
211
|
-
}
|
|
212
|
-
//# sourceMappingURL=vite-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.js","sourceRoot":"","sources":["../../src/vite-plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA+B;AAC/B,+BAAwD;AAExD,oDAA4C;AAC5C,4DAA6C;AAC7C,iEAAkD;AAClD,0DAAgC;AAChC,uEAAqD;AACrD,oDAA2B;AAE3B,sFAAiD;AACjD,8EAAgD;AAEhD,MAAM,aAAa,GACjB,OAAO,6BAAc,KAAK,UAAU;IAClC,CAAC,CAAC,6BAAc;IAChB,CAAC,CAAG,6BAAsB,CAAC,OAAiC,CAAA;AAEhE,MAAM,mBAAmB,GACvB,OAAO,IAAI,CAAC,mBAAmB,KAAK,UAAU;IAC5C,CAAC,CAAC,IAAI,CAAC,mBAAmB;IAC1B,CAAC,CAAG,IAAY,CAAC,OAAO,CAAC,mBAAuD,CAAA;AAEpF,iDAA4C;AAwD5C,MAAM,GAAG,GAAG,OAAO,CAA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QACjB,6DAA6D;QAC7D,OAAO,mBAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,aAAa,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE;YAC1E,GAAG,EAAE,SAAS;SACf,CAAC,CAAA;KACH;IAED,6DAA6D;IAC7D,OAAO,mBAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE;QACrE,GAAG,EAAE,SAAS;KACf,CAAC,CAAA;AACJ,CAAC;AAhBD,sCAgBC;AAED,SAAgB,gBAAgB,CAAC,aAAgC;IAC/D,OAAO,aAAa,CAAC,MAAM,CACzB,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,IAAA,eAAQ,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EACpF,EAAE,CACH,CAAA;AACH,CAAC;AALD,4CAKC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,EAAU;IAC/C,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAE/B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACxB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,IAAI,GAAG,IAAI,CAAA;AACpB,CAAC"}
|
package/dist/constants.d.ts
DELETED
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,uBAAuB,CAAA"}
|
package/dist/constants.js
DELETED
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAA"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AAEpC,eAAe,KAAK,CAAA;AAEpB,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA"}
|