@genesislcap/vite-builder 14.313.1 → 14.314.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAe3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;yBAEmB,KAAK,YAAY;AAAvC,wBAqJE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAc3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;yBAEmB,KAAK,YAAY;AAAvC,wBAsJE"}
package/dist/index.js CHANGED
@@ -5,8 +5,7 @@ const node_fs_1 = require("node:fs");
5
5
  const node_path_1 = require("node:path");
6
6
  const build_kit_1 = require("@genesislcap/build-kit");
7
7
  const consola_1 = tslib_1.__importDefault(require("consola"));
8
- const vite_1 = require("vite");
9
- const handlebars_1 = require("./handlebars");
8
+ const vite_js_1 = require("./vite.js");
10
9
  /**
11
10
  * There seems to be various documented issues using Vite in a monorepo setup that are impacted by various factors.
12
11
  *
@@ -34,7 +33,8 @@ const handlebars_1 = require("./handlebars");
34
33
  exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
34
  const { config: { app: { rootElement }, env, http, }, dirs: { cwd }, cli: { isDev, isBuild, isAnalyze, options: { open, https }, }, pkg: { description }, resolve: { alias }, } = ctx;
36
35
  const define = (0, build_kit_1.resolveDefineConfig)(env, http, 'vite');
37
- const handlebars = yield (0, handlebars_1.getHandlebarsModule)();
36
+ const handlebars = yield (0, vite_js_1.getHandlebarsModule)();
37
+ const vite = yield (0, vite_js_1.getViteModule)();
38
38
  const config = {
39
39
  plugins: [
40
40
  handlebars({
@@ -119,7 +119,7 @@ exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* (
119
119
  *
120
120
  * Note: Globs don't seem to work here, but the docs seem to suggest they do.
121
121
  */
122
- exclude: ['@genesislcap/pbc-auth', '@genesislcap/pbc-notify', '@genesislcap/pbc-reporting'],
122
+ exclude: ['@genesislcap/pbc-auth', '@genesislcap/pbc-reporting'],
123
123
  /**
124
124
  * The @genesis-community/golden-layout repo does not depend on the @genesislcap or @microsoft packages,
125
125
  * so it is safe to include here, which is the default behaviour. Leaving this explicit 'include' here for future
@@ -136,7 +136,7 @@ exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* (
136
136
  (0, build_kit_1.run)(cwd, `${copyfiles} --flat ${index} .`);
137
137
  }
138
138
  if (isDev) {
139
- const server = yield (0, vite_1.createServer)(Object.assign(Object.assign({}, config), { configFile: false, server: {
139
+ const server = yield vite.createServer(Object.assign(Object.assign({}, config), { configFile: false, server: {
140
140
  open,
141
141
  host: '0.0.0.0',
142
142
  port: (0, build_kit_1.getPort)(ctx.pkg),
@@ -147,7 +147,7 @@ exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* (
147
147
  server.printUrls();
148
148
  }
149
149
  else if (isBuild) {
150
- yield (0, vite_1.build)(config);
150
+ yield vite.build(config);
151
151
  }
152
152
  else if (isAnalyze) {
153
153
  throw new Error(`vite builder - analyze support not implemented yet`);
package/dist/vite.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { Plugin } from 'vite';
2
+ export declare const getHandlebarsModule: () => Promise<(...args: any) => Promise<Plugin>>;
3
+ export declare const getViteModule: () => Promise<{
4
+ build: any;
5
+ createServer: any;
6
+ }>;
7
+ //# sourceMappingURL=vite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAW9B,eAAO,MAAM,mBAAmB,0BACuC,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA,CAAC;AAE/F,eAAO,MAAM,aAAa;;;EAMzB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHandlebarsModule = void 0;
3
+ exports.getViteModule = exports.getHandlebarsModule = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /**
6
6
  * This is a glue layer to import the ESM modules into the commonjs plugin.
@@ -12,3 +12,11 @@ const tslib_1 = require("tslib");
12
12
  const dynamicImport = new Function('specifier', 'return import(specifier)');
13
13
  const getHandlebarsModule = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return (yield dynamicImport('vite-plugin-handlebars')).default; });
14
14
  exports.getHandlebarsModule = getHandlebarsModule;
15
+ const getViteModule = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
16
+ const vite = yield dynamicImport('vite');
17
+ return {
18
+ build: vite.build,
19
+ createServer: vite.createServer,
20
+ };
21
+ });
22
+ exports.getViteModule = getViteModule;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/vite-builder",
3
3
  "description": "Vite builder",
4
- "version": "14.313.1",
4
+ "version": "14.314.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -14,10 +14,10 @@
14
14
  "dev": "tsc -b ./tsconfig.json -w"
15
15
  },
16
16
  "dependencies": {
17
- "@genesislcap/build-kit": "14.313.1",
17
+ "@genesislcap/build-kit": "14.314.0",
18
18
  "consola": "^3.0.2",
19
19
  "copyfiles": "^2.4.1",
20
- "vite": "5.3.0",
20
+ "vite": "7.1.4",
21
21
  "vite-plugin-handlebars": "2.0.0"
22
22
  },
23
23
  "repository": {
@@ -28,5 +28,5 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "gitHead": "1c8bb7cc79894cf233ce6e1f2f985ef547015d72"
31
+ "gitHead": "d856629cb04122fb6fef47b1fb33fd9412728fef"
32
32
  }
package/src/index.ts CHANGED
@@ -11,9 +11,8 @@ import {
11
11
  run,
12
12
  } from '@genesislcap/build-kit';
13
13
  import consola from 'consola';
14
- import type { Plugin, UserConfig } from 'vite';
15
- import { build, createServer } from 'vite';
16
- import { getHandlebarsModule } from './handlebars';
14
+ import type { Plugin, UserConfig, ProxyOptions } from 'vite';
15
+ import { getHandlebarsModule, getViteModule } from './vite.js';
17
16
 
18
17
  /**
19
18
  * There seems to be various documented issues using Vite in a monorepo setup that are impacted by various factors.
@@ -61,6 +60,7 @@ export default async (ctx: BuildContext) => {
61
60
  const define = resolveDefineConfig(env, http, 'vite');
62
61
 
63
62
  const handlebars = await getHandlebarsModule();
63
+ const vite = await getViteModule();
64
64
 
65
65
  const config: UserConfig = {
66
66
  plugins: [
@@ -150,7 +150,7 @@ export default async (ctx: BuildContext) => {
150
150
  *
151
151
  * Note: Globs don't seem to work here, but the docs seem to suggest they do.
152
152
  */
153
- exclude: ['@genesislcap/pbc-auth', '@genesislcap/pbc-notify', '@genesislcap/pbc-reporting'],
153
+ exclude: ['@genesislcap/pbc-auth', '@genesislcap/pbc-reporting'],
154
154
  /**
155
155
  * The @genesis-community/golden-layout repo does not depend on the @genesislcap or @microsoft packages,
156
156
  * so it is safe to include here, which is the default behaviour. Leaving this explicit 'include' here for future
@@ -169,21 +169,21 @@ export default async (ctx: BuildContext) => {
169
169
  }
170
170
 
171
171
  if (isDev) {
172
- const server = await createServer({
172
+ const server = await vite.createServer({
173
173
  ...config,
174
174
  configFile: false,
175
175
  server: {
176
176
  open,
177
177
  host: '0.0.0.0',
178
178
  port: getPort(ctx.pkg),
179
- proxy: createDevProxies(),
179
+ proxy: createDevProxies() as Record<string, ProxyOptions>,
180
180
  https: https ? getDevCertOptions() : undefined,
181
181
  },
182
182
  });
183
183
  await server.listen();
184
184
  server.printUrls();
185
185
  } else if (isBuild) {
186
- await build(config);
186
+ await vite.build(config);
187
187
  } else if (isAnalyze) {
188
188
  throw new Error(`vite builder - analyze support not implemented yet`);
189
189
  } else {
@@ -11,3 +11,11 @@ const dynamicImport = new Function('specifier', 'return import(specifier)');
11
11
 
12
12
  export const getHandlebarsModule = async () =>
13
13
  (await dynamicImport('vite-plugin-handlebars')).default as (...args: any) => Promise<Plugin>;
14
+
15
+ export const getViteModule = async () => {
16
+ const vite = await dynamicImport('vite');
17
+ return {
18
+ build: vite.build,
19
+ createServer: vite.createServer,
20
+ };
21
+ };
@@ -1 +1 @@
1
- {"root":["./src/handlebars.ts","./src/index.ts"],"version":"5.9.2"}
1
+ {"root":["./src/index.ts","./src/vite.ts"],"version":"5.9.2"}
@@ -1,3 +0,0 @@
1
- import { Plugin } from 'vite';
2
- export declare const getHandlebarsModule: () => Promise<(...args: any) => Promise<Plugin>>;
3
- //# sourceMappingURL=handlebars.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlebars.d.ts","sourceRoot":"","sources":["../src/handlebars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAW9B,eAAO,MAAM,mBAAmB,0BACuC,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA,CAAC"}