@xrystal/core 3.6.2 → 3.6.5
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/bin/constants/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import path from 'path'
|
|
|
2
2
|
|
|
3
3
|
import { __filename, __dirname } from '../helpers/index.mjs'
|
|
4
4
|
|
|
5
|
-
export const packageName = '
|
|
5
|
+
export const packageName = '@xrystal/core'
|
|
6
6
|
|
|
7
7
|
export const tmpFileDefaultMainFolderName = 'x'
|
|
8
8
|
export const tmpFileDefaultName = 'tmp'
|
package/bin/main-cli.js
CHANGED
|
@@ -25,12 +25,21 @@ const packageManager = isBun ? "bun" : "npm"
|
|
|
25
25
|
const setupCLI = async () => {
|
|
26
26
|
const cli = new Command()
|
|
27
27
|
|
|
28
|
-
let ownerTmpFilePath = findFileRecursively(".", tmpFileDefaultName, tmpFileDefaultExt)
|
|
29
|
-
|
|
30
28
|
try {
|
|
29
|
+
let ownerTmpFilePath = findFileRecursively(".", tmpFileDefaultName, tmpFileDefaultExt)
|
|
30
|
+
|
|
31
31
|
if (!ownerTmpFilePath) {
|
|
32
|
+
if (!defaultTmpFilePath || !fs.existsSync(defaultTmpFilePath)) {
|
|
33
|
+
throw new Error("Default template configuration file not found in package")
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
const tmpFilePathBuffer = fs.readFileSync(defaultTmpFilePath)
|
|
33
|
-
|
|
37
|
+
const folderPath = path.resolve(tmpFileDefaultMainFolderName || ".xrystal")
|
|
38
|
+
|
|
39
|
+
if (!fs.existsSync(folderPath)) {
|
|
40
|
+
fs.mkdirSync(folderPath, { recursive: true })
|
|
41
|
+
}
|
|
42
|
+
|
|
34
43
|
fs.writeFileSync(defaultOwnerTmpFilePath, tmpFilePathBuffer)
|
|
35
44
|
ownerTmpFilePath = defaultOwnerTmpFilePath
|
|
36
45
|
}
|
|
@@ -38,7 +47,9 @@ const setupCLI = async () => {
|
|
|
38
47
|
const ownerTmpFile = fs.readFileSync(ownerTmpFilePath, "utf8")
|
|
39
48
|
const parsedTmpObject = yaml.parse(ownerTmpFile)
|
|
40
49
|
const resolvedTmpObject = resolveObjWithHandlebars(parsedTmpObject, parsedTmpObject)
|
|
41
|
-
|
|
50
|
+
|
|
51
|
+
const mainPath = resolvedTmpObject?.configs?.mainFolderPath || "./source"
|
|
52
|
+
const projectMainFolderPath = path.resolve(mainPath)
|
|
42
53
|
|
|
43
54
|
if (!fs.existsSync(projectMainFolderPath)) {
|
|
44
55
|
fs.mkdirSync(projectMainFolderPath, { recursive: true })
|
|
@@ -48,6 +59,11 @@ const setupCLI = async () => {
|
|
|
48
59
|
.command("create <project-name>")
|
|
49
60
|
.description("Clone template from GitHub (Private/Public)")
|
|
50
61
|
.action(async (projectName) => {
|
|
62
|
+
if (!projectName) {
|
|
63
|
+
console.log(chalk.red("❌ Error: Project name is required"))
|
|
64
|
+
process.exit(1)
|
|
65
|
+
}
|
|
66
|
+
|
|
51
67
|
const targetPath = path.join(process.cwd(), projectName)
|
|
52
68
|
|
|
53
69
|
if (fs.existsSync(targetPath)) {
|
|
@@ -86,7 +102,7 @@ const setupCLI = async () => {
|
|
|
86
102
|
cli.parse(process.argv)
|
|
87
103
|
|
|
88
104
|
} catch (error) {
|
|
89
|
-
console.error(`${packageName} Initialization Error:`, error?.message)
|
|
105
|
+
console.error(`${packageName || "CLI"} Initialization Error:`, error?.message)
|
|
90
106
|
}
|
|
91
107
|
}
|
|
92
108
|
|
package/package.json
CHANGED
package/x/docker/Dockerfile
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
FROM oven/bun:1.1-alpine AS builder
|
|
2
|
-
|
|
3
|
-
WORKDIR /app
|
|
4
|
-
|
|
5
|
-
COPY package.json bun.lockb* ./
|
|
6
|
-
RUN bun install --frozen-lockfile
|
|
7
|
-
|
|
8
|
-
COPY . .
|
|
9
|
-
|
|
10
|
-
RUN bun run build:prod
|
|
11
|
-
|
|
12
|
-
FROM oven/bun:1.1-alpine
|
|
13
|
-
|
|
14
|
-
ENV NODE_ENV=production
|
|
15
|
-
|
|
16
|
-
WORKDIR /lib/xrystal-core
|
|
17
|
-
|
|
18
|
-
COPY --from=builder /app/source ./source
|
|
19
|
-
COPY --from=builder /app/bin ./bin
|
|
20
|
-
COPY --from=builder /app/x ./x
|
|
21
|
-
RUN rm -rf ./x/dist && ls -la ./x
|
|
22
|
-
COPY --from=builder /app/package.json ./package.json
|
|
23
|
-
COPY --from=builder /app/bun.lockb* ./
|
|
24
|
-
|
|
25
|
-
RUN bun install --production
|
|
File without changes
|
|
File without changes
|