Skip to content

Commit 7c4f540

Browse files
authored
Merge pull request #20 from PureStackStudio/improve-purestack-cli
Improve purestack cli
2 parents 259fdfb + 19a9751 commit 7c4f540

22 files changed

Lines changed: 69 additions & 33 deletions

File tree

‎frontend/purestack.studio/guides/getting-started/purestack-cli.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ Every build command requires `--content <dir>`. The path is resolved from the wo
102102

103103
Use `yarn purestack --help` or `yarn purestack help` to print the CLI's own usage summary. Options can be written as `--content ./content` or `--content=./content`.
104104

105+
Use `yarn purestack --version` or `yarn purestack -v` to print the installed PureStack version.
106+
105107
### `build`: generate static files
106108

107109
```sh

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "purestack-repo",
4-
"version": "1.1.6",
4+
"version": "1.1.7",
55
"packageManager": "yarn@4.18.1",
66
"type": "module",
77
"sideEffects": false,

‎packages/purestack/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "purestack",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"packageManager": "yarn@4.9.2",
55
"module": "./dist/purestack.mjs",
66
"types": "./dist/purestack.d.mts",

‎packages/purestack/src/cli.ts‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
#!/usr/bin/env node
2-
import { runCli } from '@purestack/ts-ssg'
2+
import { readFileSync } from 'node:fs'
33

4-
runCli(process.argv.slice(2)).catch((error) => {
4+
async function main() {
5+
const args = process.argv.slice(2)
6+
if (args[0] === '--version' || args[0] === '-v') {
7+
const { version } = JSON.parse(
8+
readFileSync(new URL('../package.json', import.meta.url), 'utf8'),
9+
)
10+
console.log(version)
11+
return
12+
}
13+
14+
const { runCli } = await import('@purestack/ts-ssg')
15+
await runCli(args)
16+
}
17+
18+
main().catch((error) => {
519
console.error(error)
620
process.exitCode = 1
721
})

‎packages/purestack/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export const version: string = '1.1.6'
1+
export const version: string = '1.1.7'
22

33
export * from '@purestack/ts-ssg'

‎packages/ts-common/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@purestack/ts-common",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"packageManager": "yarn@4.9.2",
55
"module": "./dist/ts-common.mjs",
66
"types": "./dist/ts-common.d.mts",

‎packages/ts-components/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@purestack/ts-components",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"packageManager": "yarn@4.9.2",
55
"module": "./dist/ts-components.mjs",
66
"types": "./dist/ts-components.d.mts",

‎packages/ts-css/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@purestack/ts-css",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"packageManager": "yarn@4.9.2",
55
"module": "./dist/ts-css.mjs",
66
"types": "./dist/ts-css.d.mts",

‎packages/ts-html/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@purestack/ts-html",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"packageManager": "yarn@4.9.2",
55
"module": "./dist/ts-html.mjs",
66
"types": "./dist/ts-html.d.mts",

‎packages/ts-minidom/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@purestack/ts-minidom",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"packageManager": "yarn@4.9.2",
55
"module": "./dist/ts-minidom.mjs",
66
"types": "./dist/ts-minidom.d.mts",

0 commit comments

Comments
 (0)