spine-framework 0.1.17 → 0.1.19
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/.framework/cli/commands/init.ts +12 -7
- package/.framework/index.html +16 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/netlify.toml +36 -0
- package/package.json +4 -1
- package/vitest.config.ts +45 -0
|
@@ -25,8 +25,8 @@ import { fileURLToPath } from 'url'
|
|
|
25
25
|
const __filename = fileURLToPath(import.meta.url)
|
|
26
26
|
const __dirname = dirname(__filename)
|
|
27
27
|
const PROJECT_ROOT = process.cwd()
|
|
28
|
-
//
|
|
29
|
-
const PACKAGE_ROOT = resolve(__dirname, '
|
|
28
|
+
// Package root: node_modules/spine-framework/ — 3 levels up from .framework/cli/commands/
|
|
29
|
+
const PACKAGE_ROOT = resolve(__dirname, '../../..')
|
|
30
30
|
|
|
31
31
|
interface InitOptions {
|
|
32
32
|
dryRun: boolean
|
|
@@ -88,13 +88,18 @@ function writeEnvFile(url: string, anonKey: string, serviceRoleKey: string, dryR
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
function copyFrameworkFiles(dryRun: boolean): void {
|
|
91
|
+
console.log(` package: ${PACKAGE_ROOT}`)
|
|
92
|
+
console.log(` project: ${PROJECT_ROOT}`)
|
|
91
93
|
// Directories and files to copy from the package root into the consumer project root
|
|
92
94
|
const items = [
|
|
93
|
-
{ src: '.framework',
|
|
94
|
-
{ src: 'bin',
|
|
95
|
-
{ src: 'config',
|
|
96
|
-
{ src: 'scripts',
|
|
97
|
-
{ src: '
|
|
95
|
+
{ src: '.framework', dest: '.framework' },
|
|
96
|
+
{ src: 'bin', dest: 'bin' },
|
|
97
|
+
{ src: 'config', dest: 'config' },
|
|
98
|
+
{ src: 'scripts', dest: 'scripts' },
|
|
99
|
+
{ src: 'netlify.toml', dest: 'netlify.toml' },
|
|
100
|
+
{ src: 'vitest.config.ts', dest: 'vitest.config.ts' },
|
|
101
|
+
{ src: 'index.html', dest: 'index.html' },
|
|
102
|
+
{ src: 'STRUCTURE.md', dest: 'STRUCTURE.md' },
|
|
98
103
|
]
|
|
99
104
|
|
|
100
105
|
for (const item of items) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/spine-logo.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
10
|
+
<title>Spine Framework</title>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../.framework/cli/commands/init.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../.framework/cli/commands/init.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA2IxC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAiBpD"}
|
package/netlify.toml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build]
|
|
2
|
+
command = "npm run build"
|
|
3
|
+
publish = "dist"
|
|
4
|
+
functions = ".assembled/netlify/functions"
|
|
5
|
+
|
|
6
|
+
[build.environment]
|
|
7
|
+
# Supabase VITE variables are meant to be public in the browser
|
|
8
|
+
SECRETS_SCAN_OMIT_KEYS = "VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY,VITE_DB_SCHEMA,VITE_APP_NAME,SUPABASE_URL,DB_SCHEMA"
|
|
9
|
+
SECRETS_SCAN_OMIT_PATHS = ".framework/.xenv,.framework/.xenv.test"
|
|
10
|
+
|
|
11
|
+
# Spine functions configuration - assembled from .framework + custom
|
|
12
|
+
[functions]
|
|
13
|
+
directory = ".assembled/netlify/functions"
|
|
14
|
+
included_files = [".assembled/netlify/functions/**"]
|
|
15
|
+
node_bundler = "esbuild"
|
|
16
|
+
|
|
17
|
+
[dev]
|
|
18
|
+
command = "bash scripts/netlify-dev-wrapper.sh"
|
|
19
|
+
framework = "#custom"
|
|
20
|
+
port = 8888
|
|
21
|
+
targetPort = 3001
|
|
22
|
+
autoLaunch = false
|
|
23
|
+
startTimeout = 60
|
|
24
|
+
|
|
25
|
+
[functions."trigger-scheduler"]
|
|
26
|
+
schedule = "* * * * *"
|
|
27
|
+
|
|
28
|
+
[[headers]]
|
|
29
|
+
for = "/*"
|
|
30
|
+
[headers.values]
|
|
31
|
+
X-Frame-Options = "DENY"
|
|
32
|
+
X-Content-Type-Options = "nosniff"
|
|
33
|
+
Strict-Transport-Security = "max-age=31536000; includeSubDomains"
|
|
34
|
+
Referrer-Policy = "strict-origin-when-cross-origin"
|
|
35
|
+
Permissions-Policy = "camera=(), microphone=(), geolocation=()"
|
|
36
|
+
X-XSS-Protection = "1; mode=block"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spine-framework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Spine — enterprise application framework built on Supabase + Netlify + React",
|
|
6
6
|
"type": "module",
|
|
@@ -56,6 +56,9 @@
|
|
|
56
56
|
".framework/src/",
|
|
57
57
|
"scripts/",
|
|
58
58
|
"config/",
|
|
59
|
+
"netlify.toml",
|
|
60
|
+
"vitest.config.ts",
|
|
61
|
+
"index.html",
|
|
59
62
|
"STRUCTURE.md",
|
|
60
63
|
"README.md"
|
|
61
64
|
],
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
import { readFileSync, existsSync } from 'fs'
|
|
3
|
+
import { resolve } from 'path'
|
|
4
|
+
|
|
5
|
+
// Load .xenv.test so integration tests get real DB credentials before any
|
|
6
|
+
// worker module graph (db.ts, principal.ts) evaluates createClient() calls.
|
|
7
|
+
const xenvTest = resolve(__dirname, '.framework/.xenv.test')
|
|
8
|
+
if (existsSync(xenvTest)) {
|
|
9
|
+
for (const line of readFileSync(xenvTest, 'utf8').split('\n')) {
|
|
10
|
+
const t = line.trim()
|
|
11
|
+
if (!t || t.startsWith('#')) continue
|
|
12
|
+
const eq = t.indexOf('=')
|
|
13
|
+
if (eq === -1) continue
|
|
14
|
+
const k = t.slice(0, eq).trim()
|
|
15
|
+
const v = t.slice(eq + 1).trim().replace(/^["']|["']$/g, '')
|
|
16
|
+
if (!process.env[k]) process.env[k] = v
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
test: {
|
|
22
|
+
// Stub SUPABASE_URL etc. before any module is imported
|
|
23
|
+
setupFiles: ['.framework/tests/setup.ts'],
|
|
24
|
+
// Each test file gets its own module instance (important for vi.mock isolation)
|
|
25
|
+
isolate: true,
|
|
26
|
+
// Allow .ts extension imports (tsx-style)
|
|
27
|
+
environment: 'node',
|
|
28
|
+
// Resolve .ts imports as themselves (no .js→.ts rewriting needed in tests)
|
|
29
|
+
include: [
|
|
30
|
+
'.framework/tests/unit/**/*.test.ts',
|
|
31
|
+
'.framework/tests/integration/**/*.test.ts',
|
|
32
|
+
'.framework/tests/api/**/*.test.ts'
|
|
33
|
+
],
|
|
34
|
+
// Global test timeout — integration + API tests may hit Supabase / local server
|
|
35
|
+
testTimeout: 20000,
|
|
36
|
+
// Don't fail the suite on integration tests if env isn't configured
|
|
37
|
+
passWithNoTests: true,
|
|
38
|
+
// Persist results to public.test_runs after every run
|
|
39
|
+
reporters: ['default', './.framework/tests/reporter.ts']
|
|
40
|
+
},
|
|
41
|
+
resolve: {
|
|
42
|
+
// Allow bare .ts imports (the CLI + shared code uses these)
|
|
43
|
+
extensions: ['.ts', '.js', '.json']
|
|
44
|
+
}
|
|
45
|
+
})
|