mirror: fieldlens d38e0922441a (2/2)
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
Admin 2026-09-23 01:14:37 +00:00
parent da34221539
commit 921d7b63eb
5 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,27 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "es2023",
"lib": ["ES2023", "DOM"],
"module": "esnext",
"types": ["vite/client", "vite-plugin-pwa/react"],
"allowArbitraryExtensions": true,
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}

View File

@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "es2023",
"lib": ["ES2023"],
"types": ["node"],
"skipLibCheck": true,
/* Bundler mode */
"module": "nodenext",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
},
"include": ["vite.config.ts"]
}

View File

@ -0,0 +1,47 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: 'prompt',
includeAssets: ['fieldlens-mark.svg', 'apple-touch-icon.png', 'pwa-192.png', 'pwa-512.png'],
manifest: {
name: 'FieldLens Capture',
short_name: 'FieldLens',
description: 'Offline barcode capture and duplicate detection.',
theme_color: '#17211f',
background_color: '#f7f7f2',
display: 'standalone',
start_url: '/',
icons: [
{
src: '/pwa-192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any',
},
{
src: '/pwa-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
{
src: '/pwa-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
},
workbox: {
cleanupOutdatedCaches: true,
navigateFallback: '/index.html',
globPatterns: ['**/*.{js,css,html,svg,wasm}'],
},
}),
],
})

View File

@ -0,0 +1,17 @@
import { readdir, readFile } from 'node:fs/promises'
const files = (await readdir(new URL('../migrations/', import.meta.url)))
.filter((name) => /^\d{3}_.+\.sql$/.test(name))
.sort()
if (files.length === 0) throw new Error('No migrations found')
for (const file of files) {
const sql = await readFile(new URL(`../migrations/${file}`, import.meta.url), 'utf8')
if (!sql.trim()) throw new Error(`${file} is empty`)
if (/\bDROP\s+(DATABASE|SCHEMA)\b/i.test(sql)) {
throw new Error(`${file} contains destructive database/schema DDL`)
}
}
console.log(JSON.stringify({ ok: true, migrations: files }))