@stoker-platform/web-app 0.5.72 → 0.5.73
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/CHANGELOG.md +6 -0
- package/bin/build.js +11 -5
- package/package.json +1 -1
- package/vite.config.ts +6 -4
package/CHANGELOG.md
CHANGED
package/bin/build.js
CHANGED
|
@@ -4,7 +4,7 @@ import { runChildProcess, tryPromise } from "@stoker-platform/node-client"
|
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from "url"
|
|
5
5
|
import { dirname, join } from "path"
|
|
6
6
|
import { cpSync, existsSync, rmSync, readFileSync, writeFileSync, readdirSync, statSync } from "fs"
|
|
7
|
-
import { readFile, writeFile } from "fs/promises"
|
|
7
|
+
import { appendFile, readFile, writeFile } from "fs/promises"
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
10
|
const __filename = fileURLToPath(import.meta.url)
|
|
@@ -394,6 +394,9 @@ try {
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
cpSync(join(process.cwd(), ".env", `.env.${process.env.GCP_PROJECT}`), join(__dirname, "..", ".env"))
|
|
397
|
+
if (process.env.SKIP_ESLINT_DISABLE) {
|
|
398
|
+
await appendFile(join(__dirname, "..", ".env"), "\nSKIP_ESLINT_DISABLE=true")
|
|
399
|
+
}
|
|
397
400
|
|
|
398
401
|
cpSync(join(process.cwd(), "icons", "logo-small.png"), join(__dirname, "..", "public", "logo-small.png"))
|
|
399
402
|
cpSync(join(process.cwd(), "icons", "logo-large.png"), join(__dirname, "..", "public", "logo-large.png"))
|
|
@@ -416,10 +419,13 @@ try {
|
|
|
416
419
|
)
|
|
417
420
|
writeFileSync(join(__dirname, "..", "index.html"), indexHtml)
|
|
418
421
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
422
|
+
if (!process.env.SKIP_ESLINT_DISABLE) {
|
|
423
|
+
;``
|
|
424
|
+
let viteConfigPath = join(__dirname, "..", "vite.config.ts")
|
|
425
|
+
let viteConfig = readFileSync(viteConfigPath, "utf8")
|
|
426
|
+
viteConfig = viteConfig.replace(/eslint\(\),/, "// eslint(),")
|
|
427
|
+
writeFileSync(viteConfigPath, viteConfig)
|
|
428
|
+
}
|
|
423
429
|
|
|
424
430
|
const updateDependencies = async (packageJsonPath, externalDeps) => {
|
|
425
431
|
const packageJsonRaw = await readFile(packageJsonPath, "utf8")
|
package/package.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineConfig } from "vite"
|
|
1
|
+
import { defineConfig, loadEnv } from "vite"
|
|
2
2
|
import react from "@vitejs/plugin-react"
|
|
3
3
|
import eslint from "vite-plugin-eslint"
|
|
4
4
|
import { join, resolve } from "node:path"
|
|
@@ -7,7 +7,9 @@ import { VitePWA } from "vite-plugin-pwa"
|
|
|
7
7
|
import { tryPromise } from "@stoker-platform/node-client"
|
|
8
8
|
import { watch } from "fs"
|
|
9
9
|
|
|
10
|
-
export default defineConfig(async () => {
|
|
10
|
+
export default defineConfig(async ({ mode }) => {
|
|
11
|
+
const env = loadEnv(mode, __dirname, "")
|
|
12
|
+
const skipEslintDisable = (env.SKIP_ESLINT_DISABLE || process.env.SKIP_ESLINT_DISABLE) === "true"
|
|
11
13
|
const path = join(process.cwd(), "src", "assets", "system-custom", "main.js")
|
|
12
14
|
const url = pathToFileURL(path).href
|
|
13
15
|
const globalConfigModule = await import(url)
|
|
@@ -77,8 +79,8 @@ export default defineConfig(async () => {
|
|
|
77
79
|
resolve: {
|
|
78
80
|
alias: {
|
|
79
81
|
"@": resolve(__dirname, "./src"),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
react: skipEslintDisable ? resolve(__dirname, "./node_modules/react") : "react",
|
|
83
|
+
"react-dom": skipEslintDisable ? resolve(__dirname, "./node_modules/react-dom") : "react-dom",
|
|
82
84
|
},
|
|
83
85
|
},
|
|
84
86
|
optimizeDeps: {
|