create-surf-app 1.0.0-alpha.7 → 1.0.0-alpha.9
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/dist/templates/default/backend/package.json +1 -2
- package/dist/templates/default/frontend/.env.example +1 -1
- package/dist/templates/default/frontend/scripts/check-env.cjs +2 -2
- package/dist/templates/default/frontend/vite.config.ts +1 -1
- package/dist/templates/nextjs/.env.example +1 -1
- package/dist/templates/nextjs/package.json +1 -2
- package/dist/templates/nextjs/scripts/check-env.js +1 -6
- package/package.json +1 -1
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
"name": "backend",
|
|
3
3
|
"private": true,
|
|
4
4
|
"scripts": {
|
|
5
|
-
"start": "node scripts/check-env.js node server.js",
|
|
6
5
|
"dev": "node scripts/check-env.js node --watch server.js"
|
|
7
6
|
},
|
|
8
7
|
"dependencies": {
|
|
9
|
-
"@surf-ai/sdk": "1.0.0-alpha.
|
|
8
|
+
"@surf-ai/sdk": "1.0.0-alpha.9",
|
|
10
9
|
"express": "4.22.1"
|
|
11
10
|
}
|
|
12
11
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Loads .env manually, checks vars, then execs the actual command.
|
|
4
4
|
*
|
|
5
5
|
* Build: BASE_PATH (defined, can be empty), BACKEND_PORT
|
|
6
|
-
* Dev:
|
|
6
|
+
* Dev: PORT, BACKEND_PORT, BASE_PATH
|
|
7
7
|
*/
|
|
8
8
|
const fs = require('node:fs')
|
|
9
9
|
const path = require('node:path')
|
|
@@ -29,7 +29,7 @@ const isBuild = args.some(a => a.includes('build'))
|
|
|
29
29
|
// Vars that must be non-empty
|
|
30
30
|
const requiredNonEmpty = isBuild
|
|
31
31
|
? ['BACKEND_PORT']
|
|
32
|
-
: ['
|
|
32
|
+
: ['PORT', 'BACKEND_PORT']
|
|
33
33
|
|
|
34
34
|
// Vars that must be defined (empty is ok — BASE_PATH="" means root)
|
|
35
35
|
const requiredDefined = ['BASE_PATH']
|
|
@@ -4,7 +4,7 @@ import react from '@vitejs/plugin-react'
|
|
|
4
4
|
import tailwindcss from '@tailwindcss/vite'
|
|
5
5
|
|
|
6
6
|
export default defineConfig(() => {
|
|
7
|
-
const frontendPort = Number.parseInt(process.env.
|
|
7
|
+
const frontendPort = Number.parseInt(process.env.PORT || '', 10)
|
|
8
8
|
const backendPort = Number.parseInt(process.env.BACKEND_PORT || '', 10)
|
|
9
9
|
const base = process.env.BASE_PATH || './'
|
|
10
10
|
const hasAbsBase = base.startsWith('/')
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "node scripts/check-env.js next dev",
|
|
6
6
|
"build": "node scripts/check-env.js next build",
|
|
7
|
-
"start": "node scripts/check-env.js next start",
|
|
8
7
|
"lint": "eslint .",
|
|
9
8
|
"type-check": "tsc --noEmit --incremental"
|
|
10
9
|
},
|
|
11
10
|
"dependencies": {
|
|
12
|
-
"@surf-ai/sdk": "1.0.0-alpha.
|
|
11
|
+
"@surf-ai/sdk": "1.0.0-alpha.9",
|
|
13
12
|
"@surf-ai/theme": "latest",
|
|
14
13
|
"next": "15.5.14",
|
|
15
14
|
"react": "19.2.4",
|
|
@@ -29,7 +29,7 @@ const isBuild = args.includes('build')
|
|
|
29
29
|
// Vars that must be non-empty
|
|
30
30
|
const requiredNonEmpty = isBuild
|
|
31
31
|
? []
|
|
32
|
-
: ['
|
|
32
|
+
: ['PORT', 'SURF_API_KEY']
|
|
33
33
|
|
|
34
34
|
// Vars that must be defined (empty is ok — e.g. BASE_PATH="" means root)
|
|
35
35
|
const requiredDefined = ['BASE_PATH']
|
|
@@ -44,11 +44,6 @@ if (missing.length > 0) {
|
|
|
44
44
|
process.exit(1)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
// Pass FRONTEND_PORT as PORT so Next.js uses it
|
|
48
|
-
if (process.env.FRONTEND_PORT) {
|
|
49
|
-
process.env.PORT = process.env.FRONTEND_PORT
|
|
50
|
-
}
|
|
51
|
-
|
|
52
47
|
// Run the actual command
|
|
53
48
|
try {
|
|
54
49
|
execSync(args.join(' '), { stdio: 'inherit', env: process.env })
|