@mono-labs/cli 0.0.5
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 +86 -0
- package/bin/haste.js +2 -0
- package/index.js +3 -0
- package/lib/app.js +28 -0
- package/lib/commands/build/index.js +71 -0
- package/lib/commands/build-process/index.js +412 -0
- package/lib/commands/deploy/index.js +44 -0
- package/lib/commands/destroy.js +27 -0
- package/lib/commands/dev/dev-editor.js +265 -0
- package/lib/commands/dev/index.js +22 -0
- package/lib/commands/dev/ngrok.js +88 -0
- package/lib/commands/generate/generateSeed.js +224 -0
- package/lib/commands/generate/index.js +30 -0
- package/lib/commands/init/index.js +37 -0
- package/lib/commands/loadFromRoot.js +38 -0
- package/lib/commands/prune/index.js +12 -0
- package/lib/commands/prune/prune.js +48 -0
- package/lib/commands/reset.js +31 -0
- package/lib/commands/seed/import.js +31 -0
- package/lib/commands/seed/index.js +12 -0
- package/lib/commands/squash/index.js +8 -0
- package/lib/commands/squash/squash.js +150 -0
- package/lib/commands/submit/index.js +38 -0
- package/lib/commands/test/index.js +251 -0
- package/lib/commands/update/eas.js +39 -0
- package/lib/commands/update/index.js +92 -0
- package/lib/config.js +4 -0
- package/lib/index.js +19 -0
- package/lib/migrations/index.js +2 -0
- package/lib/migrations/v0.js +3 -0
- package/lib/migrations/v1.js +4 -0
- package/package.json +43 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { spawn } from 'child_process'
|
|
2
|
+
import inquirer from 'inquirer'
|
|
3
|
+
|
|
4
|
+
import { program } from '../../app.js'
|
|
5
|
+
import { STAGING_URL } from '../../config.js'
|
|
6
|
+
import { getEASBranches } from './eas.js'
|
|
7
|
+
|
|
8
|
+
const EXPO_PUBLIC_API_URL = STAGING_URL
|
|
9
|
+
const EXPO_FORCE_PROD = true
|
|
10
|
+
const EXPO_BUILD_PROFILE = 'production'
|
|
11
|
+
|
|
12
|
+
program
|
|
13
|
+
.command('update')
|
|
14
|
+
.description('Prune local branches that are not on origin')
|
|
15
|
+
.option('--auto', 'Auto run')
|
|
16
|
+
.action(async (str) => {
|
|
17
|
+
//console.log(raw.toString());
|
|
18
|
+
|
|
19
|
+
const { auto } = str
|
|
20
|
+
|
|
21
|
+
if (auto) {
|
|
22
|
+
const fastChild = spawn(`yarn eas update --auto`, {
|
|
23
|
+
stdio: ['inherit', 'pipe', 'pipe'], // Read from terminal, but capture output
|
|
24
|
+
shell: true,
|
|
25
|
+
env: {
|
|
26
|
+
...process.env,
|
|
27
|
+
EXPO_FORCE_PROD,
|
|
28
|
+
EXPO_PUBLIC_API_URL,
|
|
29
|
+
EXPO_BUILD_PROFILE,
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
fastChild.stdout.on('data', (data) => {
|
|
33
|
+
process.stdout.write(data) // pipe to main stdout
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
fastChild.stderr.on('data', (data) => {
|
|
37
|
+
process.stderr.write(data) // pipe errors
|
|
38
|
+
})
|
|
39
|
+
fastChild.on('message', (data) => {
|
|
40
|
+
console.log(`Message from child process: ${data}`)
|
|
41
|
+
})
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const branches = getEASBranches().map((branch) => branch.name)
|
|
46
|
+
console.log('branches', branches)
|
|
47
|
+
|
|
48
|
+
const { branch } = await inquirer.prompt([
|
|
49
|
+
{
|
|
50
|
+
type: 'list',
|
|
51
|
+
name: 'branch',
|
|
52
|
+
message: 'Select branch to update',
|
|
53
|
+
choices: Object.keys(branches).map((key) => ({
|
|
54
|
+
name: branches[key],
|
|
55
|
+
value: branches[key],
|
|
56
|
+
})),
|
|
57
|
+
default: Object.keys(branches).map((key) => branches[key]),
|
|
58
|
+
},
|
|
59
|
+
])
|
|
60
|
+
|
|
61
|
+
const { message } = await inquirer.prompt([
|
|
62
|
+
{
|
|
63
|
+
type: 'input',
|
|
64
|
+
name: 'message',
|
|
65
|
+
message: 'Enter a message for the update:',
|
|
66
|
+
default: 'No message provided', // Optional default
|
|
67
|
+
validate: (input) => input.trim() !== '' || 'Message cannot be empty.',
|
|
68
|
+
},
|
|
69
|
+
])
|
|
70
|
+
const command = `yarn eas update --branch ${branch} --message "${message}"`
|
|
71
|
+
const child = spawn(`${command} --non-interactive`, {
|
|
72
|
+
stdio: ['inherit', 'pipe', 'pipe'], // Read from terminal, but capture output
|
|
73
|
+
shell: true,
|
|
74
|
+
env: {
|
|
75
|
+
...process.env,
|
|
76
|
+
EXPO_FORCE_PROD,
|
|
77
|
+
EXPO_PUBLIC_API_URL,
|
|
78
|
+
EXPO_BUILD_PROFILE,
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
child.stdout.on('data', (data) => {
|
|
83
|
+
process.stdout.write(data) // pipe to main stdout
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
child.stderr.on('data', (data) => {
|
|
87
|
+
process.stderr.write(data) // pipe errors
|
|
88
|
+
})
|
|
89
|
+
child.on('message', (data) => {
|
|
90
|
+
console.log(`Message from child process: ${data}`)
|
|
91
|
+
})
|
|
92
|
+
})
|
package/lib/config.js
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import 'dotenv/config'
|
|
2
|
+
|
|
3
|
+
import { program } from './app.js'
|
|
4
|
+
import './commands/build/index.js'
|
|
5
|
+
import './commands/deploy/index.js'
|
|
6
|
+
import './commands/destroy.js'
|
|
7
|
+
import './commands/dev/index.js'
|
|
8
|
+
import './commands/generate/index.js'
|
|
9
|
+
import './commands/init/index.js'
|
|
10
|
+
import './commands/prune/index.js'
|
|
11
|
+
import './commands/reset.js'
|
|
12
|
+
import './commands/seed/index.js'
|
|
13
|
+
import './commands/squash/index.js'
|
|
14
|
+
import './commands/submit/index.js'
|
|
15
|
+
import './commands/update/index.js'
|
|
16
|
+
//import './commands/test/index.js'
|
|
17
|
+
import './commands/build-process/index.js'
|
|
18
|
+
|
|
19
|
+
program.parse()
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mono-labs/cli",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "A CLI tool for building and deploying projects",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"haste-cli": "./bin/haste.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node bin/haste.js",
|
|
12
|
+
"dev": "node bin/haste.js",
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"cli",
|
|
17
|
+
"build",
|
|
18
|
+
"deploy",
|
|
19
|
+
"tool"
|
|
20
|
+
],
|
|
21
|
+
"author": "Your Name",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=14.0.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@aws-sdk/client-dynamodb": "^3.848.0",
|
|
28
|
+
"@aws-sdk/util-dynamodb": "^3.848.0",
|
|
29
|
+
"chalk": "^4.1.2",
|
|
30
|
+
"commander": "^11.1.0",
|
|
31
|
+
"dotenv": "^17.2.0",
|
|
32
|
+
"inquirer": "^12.8.2",
|
|
33
|
+
"tree-kill": "^1.2.2"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"eslint": "^8.57.0"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"bin/",
|
|
40
|
+
"lib/",
|
|
41
|
+
"README.md"
|
|
42
|
+
]
|
|
43
|
+
}
|