-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d48b453
commit 995a5f4
Showing
9 changed files
with
120 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
|
||
export default defineBuildConfig({ | ||
entries: [ | ||
'src/cli', | ||
], | ||
declaration: true, | ||
clean: true, | ||
rollup: { | ||
inlineDependencies: true, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env node | ||
import './dist/cli.mjs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "artisan-init", | ||
"version": "0.31.18", | ||
"description": "Artisan framework init.", | ||
"author": "Chris Breuer", | ||
"license": "MIT", | ||
"homepage": "https://github.com/ow3org/stacks/tree/main/.stacks/artisan-init#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ow3org/stacks.git", | ||
"directory": ".stacks/artisan-init" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ow3org/stacks/issues" | ||
}, | ||
"keywords": [ | ||
"artisan", | ||
"init", | ||
"cli", | ||
"starter-kit", | ||
"stacks", | ||
"typescript" | ||
], | ||
"sideEffects": false, | ||
"contributors": [ | ||
"Chris Breuer <chris@ow3.org>" | ||
], | ||
"files": [ | ||
"dist", | ||
"*.mjs" | ||
], | ||
"scripts": { | ||
"artisan-init": "pnpm run dev && node cli.mjs", | ||
"build": "unbuild", | ||
"dev": "unbuild --stub", | ||
"prepublishOnly": "pnpm run build", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
"dependencies": { | ||
"cac": "^6.7.14", | ||
"kolorist": "^1.6.0" | ||
}, | ||
"devDependencies": { | ||
"unbuild": "^0.8.11" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env node | ||
import { bold, cyan, dim, red, yellow } from 'kolorist' | ||
import cac from 'cac' | ||
import { version } from '../package.json' | ||
|
||
const cli = cac('artisan-init') | ||
|
||
cli | ||
.version(version) | ||
.option('--name <name>', 'Name of the stack') | ||
.help() | ||
|
||
cli | ||
.command('') | ||
.action(async (args: any) => { | ||
const path = args | ||
|
||
// eslint-disable-next-line no-console | ||
console.log('path is', path) | ||
|
||
try { | ||
// eslint-disable-next-line no-console | ||
console.log() | ||
// eslint-disable-next-line no-console | ||
console.log(cyan(bold('Artisan CLI')) + dim(` v${version}`)) | ||
// eslint-disable-next-line no-console | ||
console.log() | ||
|
||
if (args.name) { | ||
// eslint-disable-next-line no-console | ||
console.log(yellow('Name option is set.')) | ||
return | ||
} | ||
} | ||
catch (e: any) { | ||
console.error(red(String(e))) | ||
if (e?.stack) | ||
console.error(dim(e.stack?.split('\n').slice(1).join('\n'))) | ||
process.exit(1) | ||
} | ||
}) | ||
|
||
cli.parse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.