@platformatic/vite 2.21.0-alpha.1 → 2.21.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.
Files changed (3) hide show
  1. package/index.js +49 -37
  2. package/package.json +7 -7
  3. package/schema.json +1 -1
package/index.js CHANGED
@@ -79,25 +79,31 @@ export class ViteStackable extends BaseStackable {
79
79
  await this.init()
80
80
  const { build } = await importFile(resolve(this.#vite, 'dist/node/index.js'))
81
81
 
82
- await build({
83
- root: this.root,
84
- base: basePath,
85
- mode: 'production',
86
- configFile,
87
- logLevel: this.logger.level,
88
- build: {
89
- outDir: config.application.outputDirectory
90
- },
91
- plugins: [
92
- {
93
- name: 'platformatic-build',
94
- configResolved: config => {
95
- basePath = ensureTrailingSlash(cleanBasePath(config.base))
96
- outDir = resolve(this.root, config.build.outDir)
82
+ try {
83
+ globalThis.platformatic.isBuilding = true
84
+
85
+ await build({
86
+ root: this.root,
87
+ base: basePath,
88
+ mode: 'production',
89
+ configFile,
90
+ logLevel: this.logger.level,
91
+ build: {
92
+ outDir: config.application.outputDirectory
93
+ },
94
+ plugins: [
95
+ {
96
+ name: 'platformatic-build',
97
+ configResolved: config => {
98
+ basePath = ensureTrailingSlash(cleanBasePath(config.base))
99
+ outDir = resolve(this.root, config.build.outDir)
100
+ }
97
101
  }
98
- }
99
- ]
100
- })
102
+ ]
103
+ })
104
+ } finally {
105
+ globalThis.platformatic.isBuilding = false
106
+ }
101
107
 
102
108
  await writeFile(resolve(outDir, '.platformatic-build.json'), JSON.stringify({ basePath }), 'utf-8')
103
109
  }
@@ -322,26 +328,32 @@ export class ViteSSRStackable extends NodeStackable {
322
328
  const { build } = await importFile(resolve(vite, 'dist/node/index.js'))
323
329
 
324
330
  // Build the client
325
- await build({
326
- root: resolve(this.root, clientDirectory),
327
- base: basePath,
328
- mode: 'production',
329
- configFile,
330
- logLevel: this.logger.level,
331
- build: {
332
- outDir: clientOutDir,
333
- ssrManifest: true
334
- },
335
- plugins: [
336
- {
337
- name: 'platformatic-build',
338
- configResolved: config => {
339
- basePath = ensureTrailingSlash(cleanBasePath(config.base))
340
- clientOutDir = resolve(this.root, clientDirectory, config.build.outDir)
331
+ try {
332
+ globalThis.platformatic.isBuilding = true
333
+
334
+ await build({
335
+ root: resolve(this.root, clientDirectory),
336
+ base: basePath,
337
+ mode: 'production',
338
+ configFile,
339
+ logLevel: this.logger.level,
340
+ build: {
341
+ outDir: clientOutDir,
342
+ ssrManifest: true
343
+ },
344
+ plugins: [
345
+ {
346
+ name: 'platformatic-build',
347
+ configResolved: config => {
348
+ basePath = ensureTrailingSlash(cleanBasePath(config.base))
349
+ clientOutDir = resolve(this.root, clientDirectory, config.build.outDir)
350
+ }
341
351
  }
342
- }
343
- ]
344
- })
352
+ ]
353
+ })
354
+ } finally {
355
+ globalThis.platformatic.isBuilding = false
356
+ }
345
357
 
346
358
  await writeFile(resolve(clientOutDir, '.platformatic-build.json'), JSON.stringify({ basePath }), 'utf-8')
347
359
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/vite",
3
- "version": "2.21.0-alpha.1",
3
+ "version": "2.21.0",
4
4
  "description": "Platformatic Vite Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,10 +18,10 @@
18
18
  "@fastify/static": "^8.0.0",
19
19
  "fastify": "^5.0.0",
20
20
  "semver": "^7.6.3",
21
- "@platformatic/basic": "2.21.0-alpha.1",
22
- "@platformatic/config": "2.21.0-alpha.1",
23
- "@platformatic/node": "2.21.0-alpha.1",
24
- "@platformatic/utils": "2.21.0-alpha.1"
21
+ "@platformatic/basic": "2.21.0",
22
+ "@platformatic/node": "2.21.0",
23
+ "@platformatic/config": "2.21.0",
24
+ "@platformatic/utils": "2.21.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@fastify/vite": "^7.0.1",
@@ -34,8 +34,8 @@
34
34
  "typescript": "^5.5.4",
35
35
  "vite": "^5.4.0",
36
36
  "ws": "^8.18.0",
37
- "@platformatic/composer": "2.21.0-alpha.1",
38
- "@platformatic/service": "2.21.0-alpha.1"
37
+ "@platformatic/service": "2.21.0",
38
+ "@platformatic/composer": "2.21.0"
39
39
  },
40
40
  "scripts": {
41
41
  "test": "npm run lint && borp --concurrency=1 --no-timeout",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/vite/2.21.0-alpha.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/vite/2.21.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Vite Stackable",
5
5
  "type": "object",