@startupjs/cli 0.61.10 → 0.61.11

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/README.md CHANGED
@@ -16,6 +16,12 @@ Run `npx startupjs install --help` for a full manual
16
16
 
17
17
  Build web bundle for production usage
18
18
 
19
+ ### `check`
20
+
21
+ Type-check the current project with React-Pug support.
22
+
23
+ You can pass specific files, for example `npx startupjs check src/App.tsx`.
24
+
19
25
  ### `start-production`
20
26
 
21
27
  Start production node server with production web build
@@ -0,0 +1,40 @@
1
+ import { runCli } from '@react-pug/check-types'
2
+
3
+ export const name = 'check [files...]'
4
+ export const description = 'Type-check the current project with React-Pug support'
5
+ export const helpText = [
6
+ 'Examples:',
7
+ ' npx startupjs check',
8
+ ' Check the current working directory as a full TypeScript project.',
9
+ '',
10
+ ' npx startupjs check src/App.tsx src/Button.tsx',
11
+ ' Check only the selected files while still using the full project context.',
12
+ '',
13
+ ' npx startupjs check --project packages/web src/App.tsx',
14
+ ' Resolve tsconfig.json from a specific project path and then check selected files.'
15
+ ].join('\n')
16
+
17
+ export const options = [
18
+ {
19
+ name: '-p, --project <path>',
20
+ description: 'Path to tsconfig.json or a directory containing it'
21
+ },
22
+ {
23
+ name: '--tagFunction <name>',
24
+ description: 'Tagged template function name to recognize (default: pug)'
25
+ },
26
+ {
27
+ name: '--injectCssxjsTypes <mode>',
28
+ description: 'cssxjs/startupjs React prop injection mode: never, auto, or force'
29
+ }
30
+ ]
31
+
32
+ export async function action (files = [], options) {
33
+ const args = [...files]
34
+ if (options.project) args.push('--project', options.project)
35
+ if (options.tagFunction) args.push('--tagFunction', options.tagFunction)
36
+ if (options.injectCssxjsTypes) args.push('--injectCssxjsTypes', options.injectCssxjsTypes)
37
+
38
+ const exitCode = await runCli(args)
39
+ if (exitCode !== 0) process.exit(exitCode)
40
+ }
package/commands/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * as check from './check.js'
1
2
  export * as initPm from './pm/init-pm.js'
2
3
  export * as pr from './pm/pr.js'
3
4
  export * as task from './pm/task.js'
package/index.js CHANGED
@@ -13,7 +13,7 @@ const program = new Command()
13
13
 
14
14
  async function run () {
15
15
  for (const command of Object.values(commands)) {
16
- const { name, description, options = [], action } = command
16
+ const { name, description, options = [], helpText, action } = command
17
17
 
18
18
  if (program.commands.find(cmd => cmd.name() === name)) {
19
19
  throw new Error(`Attempted to override an already registered command: ${name}`)
@@ -27,6 +27,8 @@ async function run () {
27
27
  cmd.option(name, description)
28
28
  }
29
29
 
30
+ if (helpText) cmd.addHelpText('after', `\n${helpText}`)
31
+
30
32
  cmd.action(action)
31
33
  }
32
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs/cli",
3
- "version": "0.61.10",
3
+ "version": "0.61.11",
4
4
  "description": "The command-line tool for StartupJS apps.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -9,6 +9,7 @@
9
9
  "access": "public"
10
10
  },
11
11
  "dependencies": {
12
+ "@react-pug/check-types": "^0.1.4",
12
13
  "@startupjs/patches": "^0.61.10",
13
14
  "@startupjs/pm": "^0.61.0",
14
15
  "chalk": "^5.3.0",
@@ -16,5 +17,5 @@
16
17
  "create-startupjs": "^0.61.6",
17
18
  "execa": "^8.0.1"
18
19
  },
19
- "gitHead": "7d2fe3104f2ebbc6934e269513c40b91c2616b05"
20
+ "gitHead": "4a7aa134309762aa15702a10d5706ce588bb40c5"
20
21
  }