@stoker-platform/web-app 0.5.72 → 0.5.74

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.74
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: improve soft delete authorisation
8
+ - Updated dependencies
9
+ - @stoker-platform/utils@0.5.36
10
+ - @stoker-platform/node-client@0.5.42
11
+ - @stoker-platform/web-client@0.5.42
12
+
13
+ ## 0.5.73
14
+
15
+ ### Patch Changes
16
+
17
+ - chore: skip eslint comment
18
+
3
19
  ## 0.5.72
4
20
 
5
21
  ### Patch Changes
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
- let viteConfigPath = join(__dirname, "..", "vite.config.ts")
420
- let viteConfig = readFileSync(viteConfigPath, "utf8")
421
- viteConfig = viteConfig.replace(/eslint\(\),/, "// eslint(),")
422
- writeFileSync(viteConfigPath, viteConfig)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.72",
3
+ "version": "0.5.74",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
@@ -51,9 +51,9 @@
51
51
  "@radix-ui/react-tooltip": "^1.2.8",
52
52
  "@react-google-maps/api": "^2.20.8",
53
53
  "@sentry/react": "^10.47.0",
54
- "@stoker-platform/node-client": "0.5.41",
55
- "@stoker-platform/utils": "0.5.35",
56
- "@stoker-platform/web-client": "0.5.41",
54
+ "@stoker-platform/node-client": "0.5.42",
55
+ "@stoker-platform/utils": "0.5.36",
56
+ "@stoker-platform/web-client": "0.5.42",
57
57
  "@tanstack/react-table": "^8.21.3",
58
58
  "@types/react": "18.3.13",
59
59
  "@types/react-dom": "18.3.1",
package/src/Form.tsx CHANGED
@@ -2408,10 +2408,7 @@ function RecordForm({
2408
2408
  return collectionAccess("Update", collectionPermissions)
2409
2409
  }, [collection, permissions])
2410
2410
  const hasDeleteAccess = useMemo(() => {
2411
- return (
2412
- (!softDelete && collectionAccess("Delete", collectionPermissions)) ||
2413
- (softDelete && collectionAccess("Update", collectionPermissions))
2414
- )
2411
+ return collectionAccess("Delete", collectionPermissions)
2415
2412
  }, [collection, permissions])
2416
2413
 
2417
2414
  const isPending = !!(id && isGlobalLoading.has(id))
package/src/List.tsx CHANGED
@@ -1678,8 +1678,7 @@ export function List({
1678
1678
  </div>,
1679
1679
  document.body,
1680
1680
  )}
1681
- {((!softDelete && collectionAccess("Delete", collectionPermissions)) ||
1682
- (softDelete && collectionAccess("Update", collectionPermissions))) && (
1681
+ {collectionAccess("Delete", collectionPermissions) && (
1683
1682
  <AlertDialog>
1684
1683
  <AlertDialogTrigger asChild>
1685
1684
  <Button
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
- // react: resolve(__dirname, "./node_modules/react"),
81
- // "react-dom": resolve(__dirname, "./node_modules/react-dom"),
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: {