create-noalph-app 0.2.0 → 0.2.2
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/bin/create.js +0 -0
- package/package.json +14 -9
- package/{src/templates → templates}/default/package.json +3 -3
- package/{src/templates → templates}/default/src/main.ts +1 -1
- package/{src/templates → templates}/default/vite.config.ts +1 -1
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-test.log +0 -12
- package/CHANGELOG.md +0 -7
- package/LICENSE +0 -21
- package/src/bin/create.ts +0 -99
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -11
- package/vitest.config.ts +0 -14
- /package/{src/templates → templates}/default/_gitignore +0 -0
- /package/{src/templates → templates}/default/index.html +0 -0
- /package/{src/templates → templates}/default/src/App.eno +0 -0
- /package/{src/templates → templates}/default/tsconfig.json +0 -0
package/dist/bin/create.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-noalph-app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Scaffolding CLI untuk membuat proyek noalphjs baru",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"templates"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc -p tsconfig.build.json",
|
|
17
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
18
|
+
"test": "vitest run",
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
21
|
+
"prepublishOnly": "pnpm build"
|
|
22
|
+
},
|
|
11
23
|
"dependencies": {
|
|
12
24
|
"picocolors": "^1.0.0",
|
|
13
25
|
"prompts": "^2.4.2"
|
|
@@ -22,12 +34,5 @@
|
|
|
22
34
|
},
|
|
23
35
|
"publishConfig": {
|
|
24
36
|
"access": "public"
|
|
25
|
-
},
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "tsc -p tsconfig.build.json",
|
|
28
|
-
"dev": "tsc -p tsconfig.build.json --watch",
|
|
29
|
-
"test": "vitest run",
|
|
30
|
-
"typecheck": "tsc --noEmit",
|
|
31
|
-
"clean": "rm -rf dist *.tsbuildinfo"
|
|
32
37
|
}
|
|
33
|
-
}
|
|
38
|
+
}
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"noalph:preview": "noalph preview"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@
|
|
15
|
+
"@alphaisyour/renderer-dom": "^0.2.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
18
|
+
"@alphaisyour/cli": "^0.2.0",
|
|
19
|
+
"@alphaisyour/vite-plugin": "^0.2.0",
|
|
20
20
|
"typescript": "^5.3.3",
|
|
21
21
|
"vite": "^5.1.0"
|
|
22
22
|
}
|
package/.turbo/turbo-build.log
DELETED
package/.turbo/turbo-test.log
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> create-noalph-app@0.1.0 test C:\laragon\www\workspace-noalph\noalphjs\packages\create-noalphjs
|
|
3
|
-
> vitest run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[7m[1m[36m RUN [39m[22m[27m [36mv1.6.1[39m [90mC:/laragon/www/workspace-noalph/noalphjs/packages/create-noalphjs[39m
|
|
7
|
-
|
|
8
|
-
[2minclude: [22m[33m**/*.{test,spec}.?(c|m)[jt]s?(x)[39m
|
|
9
|
-
No test files found, exiting with code 0
|
|
10
|
-
|
|
11
|
-
[2mexclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[2m, [22m**/cypress/**[2m, [22m**/.{idea,git,cache,output,temp}/**[2m, [22m**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*[39m
|
|
12
|
-
[2mwatch exclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[39m
|
package/CHANGELOG.md
DELETED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 noalphjs contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/src/bin/create.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { createRequire } from 'module'
|
|
4
|
-
import path from 'path'
|
|
5
|
-
import fs from 'fs'
|
|
6
|
-
import { fileURLToPath } from 'url'
|
|
7
|
-
|
|
8
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
9
|
-
|
|
10
|
-
// Lazy-load dengan fallback
|
|
11
|
-
async function loadColorAndPrompts() {
|
|
12
|
-
try {
|
|
13
|
-
const pc = (await import('picocolors')).default
|
|
14
|
-
const prompts = (await import('prompts')).default
|
|
15
|
-
return { pc, prompts }
|
|
16
|
-
} catch {
|
|
17
|
-
return { pc: { green: (s: string) => s, bold: (s: string) => s, cyan: (s: string) => s, yellow: (s: string) => s, red: (s: string) => s }, prompts: null }
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async function main() {
|
|
22
|
-
const { pc, prompts } = await loadColorAndPrompts()
|
|
23
|
-
|
|
24
|
-
console.log()
|
|
25
|
-
console.log(pc.bold(pc.cyan(' ● noalphjs')))
|
|
26
|
-
console.log(pc.cyan(' Framework JavaScript Indonesia dengan ekstensi .eno'))
|
|
27
|
-
console.log()
|
|
28
|
-
|
|
29
|
-
let projectName = process.argv[2]
|
|
30
|
-
|
|
31
|
-
if (!projectName && prompts) {
|
|
32
|
-
const response = await prompts({
|
|
33
|
-
type: 'text',
|
|
34
|
-
name: 'projectName',
|
|
35
|
-
message: 'Nama proyek kamu:',
|
|
36
|
-
initial: 'my-noalph-app',
|
|
37
|
-
validate: (value: string) =>
|
|
38
|
-
/^[a-z0-9-_]+$/.test(value) ? true : 'Gunakan huruf kecil, angka, - atau _',
|
|
39
|
-
})
|
|
40
|
-
projectName = response.projectName
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!projectName) {
|
|
44
|
-
projectName = 'my-noalph-app'
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const targetDir = path.resolve(process.cwd(), projectName)
|
|
48
|
-
|
|
49
|
-
if (fs.existsSync(targetDir)) {
|
|
50
|
-
console.log(pc.red(`\n Error: Folder "${projectName}" sudah ada.`))
|
|
51
|
-
process.exit(1)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
console.log()
|
|
55
|
-
console.log(` Membuat proyek ${pc.bold(pc.green(projectName))}...`)
|
|
56
|
-
console.log()
|
|
57
|
-
|
|
58
|
-
// Copy template
|
|
59
|
-
const templateDir = path.join(__dirname, '../../templates/default')
|
|
60
|
-
copyDir(templateDir, targetDir)
|
|
61
|
-
|
|
62
|
-
// Update package.json nama
|
|
63
|
-
const pkgPath = path.join(targetDir, 'package.json')
|
|
64
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
|
65
|
-
pkg.name = projectName
|
|
66
|
-
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n')
|
|
67
|
-
|
|
68
|
-
console.log(pc.green(' ✓ Proyek berhasil dibuat!'))
|
|
69
|
-
console.log()
|
|
70
|
-
console.log(' Langkah selanjutnya:')
|
|
71
|
-
console.log()
|
|
72
|
-
console.log(pc.cyan(` cd ${projectName}`))
|
|
73
|
-
console.log(pc.cyan(' npm install'))
|
|
74
|
-
console.log(pc.cyan(' npm run dev'))
|
|
75
|
-
console.log()
|
|
76
|
-
console.log(` Kemudian buka ${pc.bold('http://localhost:3000')} di browser kamu.`)
|
|
77
|
-
console.log()
|
|
78
|
-
console.log(pc.yellow(' Selamat ngoding! 🇮🇩'))
|
|
79
|
-
console.log()
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function copyDir(src: string, dest: string) {
|
|
83
|
-
fs.mkdirSync(dest, { recursive: true })
|
|
84
|
-
const entries = fs.readdirSync(src, { withFileTypes: true })
|
|
85
|
-
for (const entry of entries) {
|
|
86
|
-
const srcPath = path.join(src, entry.name)
|
|
87
|
-
const destPath = path.join(dest, entry.name === '_gitignore' ? '.gitignore' : entry.name)
|
|
88
|
-
if (entry.isDirectory()) {
|
|
89
|
-
copyDir(srcPath, destPath)
|
|
90
|
-
} else {
|
|
91
|
-
fs.copyFileSync(srcPath, destPath)
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
main().catch((e) => {
|
|
97
|
-
console.error(e)
|
|
98
|
-
process.exit(1)
|
|
99
|
-
})
|
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
package/vitest.config.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
passWithNoTests: true,
|
|
8
|
-
coverage: {
|
|
9
|
-
provider: 'v8',
|
|
10
|
-
reporter: ['text', 'json', 'html'],
|
|
11
|
-
exclude: ['**/node_modules/**', '**/dist/**', '**/*.config.*'],
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|