create-appraisejs 0.2.0-alpha.2 → 0.2.0-alpha.3
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/package.json +10 -5
- package/templates/default/.appraise-template-meta.json +2 -2
- package/templates/default/prisma/dev.db +0 -0
- package/templates/default/scripts/sync-environments.ts +7 -3
- package/templates/default/src/app/layout.tsx +2 -1
- package/templates/default/src/lib/environment-file-utils.ts +39 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-appraisejs",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.3",
|
|
4
4
|
"description": "Scaffold a new AppraiseJS app in your directory",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Hasnat Jamil",
|
|
@@ -44,10 +44,15 @@
|
|
|
44
44
|
"sync-templates": "tsx scripts/sync-templates.ts",
|
|
45
45
|
"test": "vitest run",
|
|
46
46
|
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
47
|
-
"publish": "npm
|
|
48
|
-
"publish:alpha": "npm
|
|
49
|
-
"publish:beta": "npm
|
|
50
|
-
"bump:alpha": "npm version prerelease --preid alpha"
|
|
47
|
+
"publish": "npm publish",
|
|
48
|
+
"publish:alpha": "npm publish --tag alpha",
|
|
49
|
+
"publish:beta": "npm publish --tag beta",
|
|
50
|
+
"bump:alpha": "npm version prerelease --preid alpha",
|
|
51
|
+
"bump:beta": "npm version prerelease --preid beta",
|
|
52
|
+
"bump:release": "npm version patch",
|
|
53
|
+
"bump:major": "npm version major",
|
|
54
|
+
"bump:minor": "npm version minor",
|
|
55
|
+
"bump:patch": "npm version patch"
|
|
51
56
|
},
|
|
52
57
|
"dependencies": {
|
|
53
58
|
"@inquirer/prompts": "^7.2.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"preparedAt": "2026-03-
|
|
3
|
-
"inputHash": "
|
|
2
|
+
"preparedAt": "2026-03-23T20:15:15.041Z",
|
|
3
|
+
"inputHash": "596a28d2c5dc408d39926068711127354f3752a92c086cd0df27e8cf85eb5990",
|
|
4
4
|
"databasePath": "prisma/dev.db"
|
|
5
5
|
}
|
|
Binary file
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { promises as fs } from 'fs'
|
|
12
|
+
import path from 'path'
|
|
12
13
|
import prisma from '../src/config/db-config'
|
|
13
14
|
import { ensureAutomationWorkspaceReady, getAutomationEnvironmentsDir } from '../src/lib/automation/paths'
|
|
14
15
|
|
|
@@ -40,16 +41,20 @@ interface SyncResult {
|
|
|
40
41
|
skippedEnvironments: string[]
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
const EMPTY_ENVIRONMENTS_FILE_CONTENT = '{}\n'
|
|
45
|
+
|
|
43
46
|
/**
|
|
44
47
|
* Reads and parses the environments.json file
|
|
45
48
|
*/
|
|
46
49
|
async function readEnvironmentsFromFile(): Promise<Record<string, EnvironmentConfig>> {
|
|
47
|
-
const filePath =
|
|
50
|
+
const filePath = path.join(getAutomationEnvironmentsDir(), 'environments.json')
|
|
48
51
|
|
|
49
52
|
try {
|
|
50
53
|
await fs.access(filePath)
|
|
51
54
|
} catch {
|
|
52
|
-
|
|
55
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true })
|
|
56
|
+
await fs.writeFile(filePath, EMPTY_ENVIRONMENTS_FILE_CONTENT, 'utf-8')
|
|
57
|
+
return {}
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
try {
|
|
@@ -342,4 +347,3 @@ async function main() {
|
|
|
342
347
|
main()
|
|
343
348
|
|
|
344
349
|
|
|
345
|
-
|
|
@@ -156,9 +156,10 @@ export default function RootLayout({
|
|
|
156
156
|
},
|
|
157
157
|
]}
|
|
158
158
|
/>
|
|
159
|
-
<NavLink href="/settings" icon={<Settings2 className="h-5 w-5 text-primary" />}>
|
|
159
|
+
{/* <NavLink href="/settings" icon={<Settings2 className="h-5 w-5 text-primary" />}>
|
|
160
160
|
Settings
|
|
161
161
|
</NavLink>
|
|
162
|
+
*/}
|
|
162
163
|
<NavCommand className="ml-auto" />
|
|
163
164
|
</div>
|
|
164
165
|
</nav>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { promises as fs } from 'fs'
|
|
2
|
-
import * as path from 'path'
|
|
3
|
-
import prisma from '@/config/db-config'
|
|
4
|
-
import { ensureAutomationWorkspaceReady, getAutomationEnvironmentsDir } from '@/lib/automation/paths'
|
|
5
|
-
|
|
6
|
-
interface EnvironmentConfig {
|
|
7
|
-
baseUrl: string
|
|
8
|
-
apiBaseUrl: string
|
|
9
|
-
email: string
|
|
10
|
-
password: string
|
|
11
|
-
}
|
|
1
|
+
import { promises as fs } from 'fs'
|
|
2
|
+
import * as path from 'path'
|
|
3
|
+
import prisma from '@/config/db-config'
|
|
4
|
+
import { ensureAutomationWorkspaceReady, getAutomationEnvironmentsDir } from '@/lib/automation/paths'
|
|
5
|
+
|
|
6
|
+
interface EnvironmentConfig {
|
|
7
|
+
baseUrl: string
|
|
8
|
+
apiBaseUrl: string
|
|
9
|
+
email: string
|
|
10
|
+
password: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const EMPTY_ENVIRONMENTS_FILE_CONTENT = '{}\n'
|
|
12
14
|
|
|
13
15
|
export function getEnvironmentsFilePath(): string {
|
|
14
16
|
return path.join(getAutomationEnvironmentsDir(), 'environments.json')
|
|
@@ -44,44 +46,38 @@ export async function generateEnvironmentsContent(): Promise<Record<string, Envi
|
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
export async function createOrUpdateEnvironmentsFile(): Promise<boolean> {
|
|
48
|
-
try {
|
|
49
|
-
await ensureAutomationWorkspaceReady()
|
|
50
|
-
const filePath = getEnvironmentsFilePath()
|
|
51
|
-
await ensureConfigDirectoryExists()
|
|
52
|
-
|
|
53
|
-
const content = await generateEnvironmentsContent()
|
|
54
|
-
|
|
55
|
-
if (Object.keys(content).length === 0) {
|
|
56
|
-
await
|
|
57
|
-
return true
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
await fs.writeFile(filePath, JSON.stringify(content, null, 2))
|
|
61
|
-
return true
|
|
49
|
+
export async function createOrUpdateEnvironmentsFile(): Promise<boolean> {
|
|
50
|
+
try {
|
|
51
|
+
await ensureAutomationWorkspaceReady()
|
|
52
|
+
const filePath = getEnvironmentsFilePath()
|
|
53
|
+
await ensureConfigDirectoryExists()
|
|
54
|
+
|
|
55
|
+
const content = await generateEnvironmentsContent()
|
|
56
|
+
|
|
57
|
+
if (Object.keys(content).length === 0) {
|
|
58
|
+
await fs.writeFile(filePath, EMPTY_ENVIRONMENTS_FILE_CONTENT)
|
|
59
|
+
return true
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
await fs.writeFile(filePath, JSON.stringify(content, null, 2))
|
|
63
|
+
return true
|
|
62
64
|
} catch (error) {
|
|
63
65
|
console.error('Error creating/updating environments file:', error)
|
|
64
66
|
return false
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
|
|
68
|
-
export async function deleteEnvironmentsFile(): Promise<boolean> {
|
|
69
|
-
try {
|
|
70
|
-
await ensureAutomationWorkspaceReady()
|
|
71
|
-
const filePath = getEnvironmentsFilePath()
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
await fs.unlink(filePath)
|
|
80
|
-
return true
|
|
81
|
-
} catch (error) {
|
|
82
|
-
console.error('Error deleting environments file:', error)
|
|
83
|
-
return false
|
|
84
|
-
}
|
|
70
|
+
export async function deleteEnvironmentsFile(): Promise<boolean> {
|
|
71
|
+
try {
|
|
72
|
+
await ensureAutomationWorkspaceReady()
|
|
73
|
+
const filePath = getEnvironmentsFilePath()
|
|
74
|
+
await ensureConfigDirectoryExists()
|
|
75
|
+
await fs.writeFile(filePath, EMPTY_ENVIRONMENTS_FILE_CONTENT)
|
|
76
|
+
return true
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error('Error deleting environments file:', error)
|
|
79
|
+
return false
|
|
80
|
+
}
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
export async function readEnvironmentsFile(): Promise<{
|