@startupjs/cli 0.56.0-alpha.4 → 0.56.0-alpha.42
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 +20 -12
- package/commands/build.js +10 -0
- package/commands/index.js +7 -0
- package/commands/pm/init-pm.js +30 -0
- package/commands/pm/pr.js +12 -0
- package/commands/pm/task.js +12 -0
- package/commands/pm/utils.js +8 -0
- package/commands/postinstall.js +17 -0
- package/commands/start-production.js +21 -0
- package/index.js +23 -679
- package/package.json +9 -17
- package/corepack.sh +0 -52
- package/link/index.js +0 -9
- package/link/log.js +0 -33
- package/link/path.js +0 -61
- package/link/postLinkAndroid.js +0 -15
- package/link/postLinkIOS.js +0 -8
- package/link/pushNotificationsLinker/AndroidLinker.js +0 -144
- package/link/pushNotificationsLinker/IosLinker.js +0 -137
- package/link/pushNotificationsLinker/constants.js +0 -114
- package/link/pushNotificationsLinker/index.js +0 -37
- package/link/stylesLinker.js +0 -47
package/README.md
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
# startupjs cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
3
|
+
## Usage
|
|
6
4
|
|
|
7
|
-
```
|
|
8
|
-
|
|
5
|
+
```
|
|
6
|
+
npx startupjs <command> [options]
|
|
9
7
|
```
|
|
10
8
|
|
|
11
|
-
##
|
|
9
|
+
## Commands
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
### `install`
|
|
12
|
+
|
|
13
|
+
Run `npx startupjs install --help` for a full manual
|
|
14
|
+
|
|
15
|
+
### `build`
|
|
16
|
+
|
|
17
|
+
Build web bundle for production usage
|
|
18
|
+
|
|
19
|
+
### `start-production`
|
|
20
|
+
|
|
21
|
+
Start production node server with production web build
|
|
22
|
+
|
|
23
|
+
(run this after `npx startupjs build`)
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
### `init-pm`, `pr`, `task <github_issue_number>`
|
|
18
26
|
|
|
19
|
-
|
|
27
|
+
Project management helper commands.
|
|
20
28
|
|
|
21
|
-
(
|
|
29
|
+
See [`@startupjs/pm` readme](../pm) for documentation on them.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * as initPm from './pm/init-pm.js'
|
|
2
|
+
export * as pr from './pm/pr.js'
|
|
3
|
+
export * as task from './pm/task.js'
|
|
4
|
+
export * as postinstall from './postinstall.js'
|
|
5
|
+
export * as startProduction from './start-production.js'
|
|
6
|
+
export * as build from './build.js'
|
|
7
|
+
export * as install from 'create-startupjs/install'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
import { $ } from 'execa'
|
|
4
|
+
import { getScriptsPath } from './utils.js'
|
|
5
|
+
|
|
6
|
+
export const name = 'init-pm'
|
|
7
|
+
export const description = 'Create a new project on github from template'
|
|
8
|
+
|
|
9
|
+
export async function action () {
|
|
10
|
+
const scriptsPath = getScriptsPath()
|
|
11
|
+
|
|
12
|
+
// TODO: maybe change this to use 'sh' binary directly and remove `shell: true`
|
|
13
|
+
await $({ shell: true, stdio: 'inherit' })`\
|
|
14
|
+
${scriptsPath} init-pm \
|
|
15
|
+
`
|
|
16
|
+
|
|
17
|
+
const packageJSONPath = path.join(process.cwd(), 'package.json')
|
|
18
|
+
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath).toString())
|
|
19
|
+
|
|
20
|
+
packageJSON.scripts = {
|
|
21
|
+
...packageJSON.scripts,
|
|
22
|
+
task: 'npx startupjs task',
|
|
23
|
+
pr: 'npx startupjs pr'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fs.writeFileSync(
|
|
27
|
+
packageJSONPath,
|
|
28
|
+
`${JSON.stringify(packageJSON, null, 2)}\n`
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { $ } from 'execa'
|
|
2
|
+
import { getScriptsPath } from './utils.js'
|
|
3
|
+
|
|
4
|
+
export const name = 'pr [issueNumber]'
|
|
5
|
+
export const description = 'Make PR for this task (or re-request review if it already exists)'
|
|
6
|
+
|
|
7
|
+
export async function action (issueNumber) {
|
|
8
|
+
const scriptsPath = getScriptsPath()
|
|
9
|
+
await $({ shell: true, stdio: 'inherit' })`\
|
|
10
|
+
${scriptsPath} pr ${issueNumber} \
|
|
11
|
+
`
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { $ } from 'execa'
|
|
2
|
+
import { getScriptsPath } from './utils.js'
|
|
3
|
+
|
|
4
|
+
export const name = 'task <issueNumber>'
|
|
5
|
+
export const description = 'Create a task branch (or just switch to it if it already exists)'
|
|
6
|
+
|
|
7
|
+
export async function action (issueNumber) {
|
|
8
|
+
const scriptsPath = getScriptsPath()
|
|
9
|
+
await $({ shell: true, stdio: 'inherit' })`\
|
|
10
|
+
${scriptsPath} task ${issueNumber} \
|
|
11
|
+
`
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { $ } from 'execa'
|
|
2
|
+
import { join, dirname, relative } from 'path'
|
|
3
|
+
import { createRequire } from 'module'
|
|
4
|
+
|
|
5
|
+
const require = createRequire(import.meta.url)
|
|
6
|
+
|
|
7
|
+
export const name = 'postinstall'
|
|
8
|
+
export const description = 'Run startupjs postinstall scripts'
|
|
9
|
+
|
|
10
|
+
export async function action () {
|
|
11
|
+
let patchesPath = join(dirname(require.resolve('@startupjs/patches')), 'patches')
|
|
12
|
+
// patch-package requires the path to be relative
|
|
13
|
+
patchesPath = relative(process.cwd(), patchesPath)
|
|
14
|
+
await $({ stdio: 'inherit' })`\
|
|
15
|
+
npx patch-package --patch-dir ${patchesPath} \
|
|
16
|
+
`
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { $ } from 'execa'
|
|
2
|
+
|
|
3
|
+
export const name = 'start-production'
|
|
4
|
+
export const description = 'Start production node server with production web build'
|
|
5
|
+
export const options = [{
|
|
6
|
+
name: '-i, --inspect',
|
|
7
|
+
description: 'Enable NodeJS inspector agent'
|
|
8
|
+
}]
|
|
9
|
+
|
|
10
|
+
export async function action ({ inspect } = {}) {
|
|
11
|
+
await $({
|
|
12
|
+
stdio: 'inherit',
|
|
13
|
+
env: { NODE_ENV: 'production' }
|
|
14
|
+
})`\
|
|
15
|
+
node \
|
|
16
|
+
--experimental-detect-module \
|
|
17
|
+
${inspect ? '--inspect' : []} \
|
|
18
|
+
--import=startupjs/nodeRegister \
|
|
19
|
+
-e import('startupjs/startServer') \
|
|
20
|
+
`
|
|
21
|
+
}
|