@by-association-only/cli 2.3.2 → 3.0.0
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/dist/index.d.ts +1 -0
- package/dist/index.js +453 -0
- package/dist/index.mjs +436 -0
- package/package.json +38 -21
- package/.idea/bao-cli.iml +0 -12
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -155
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.nvmrc +0 -1
- package/commands/create/git.js +0 -59
- package/commands/create/index.js +0 -123
- package/commands/create/local.js +0 -151
- package/commands/create/theme.js +0 -134
- package/commands/get-live-theme-id/index.js +0 -33
- package/config/index.js +0 -24
- package/index.js +0 -102
- package/utils.js +0 -14
package/config/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const os = require('os')
|
|
3
|
-
|
|
4
|
-
class Config {
|
|
5
|
-
get localProjectDirectory () {
|
|
6
|
-
if (process.env.BAO_CODE_DIRECTORY) {
|
|
7
|
-
if (fs.existsSync(process.env.BAO_CODE_DIRECTORY)) {
|
|
8
|
-
return process.env.BAO_CODE_DIRECTORY
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return `${os.homedir()}/Code`
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
get githubToken () {
|
|
16
|
-
return process.env.GITHUB_TOKEN
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
get organizationName () {
|
|
20
|
-
return 'baoagency'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = { Config }
|
package/index.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const os = require('os')
|
|
4
|
-
require('dotenv').config({ path: `${os.homedir()}/.env` })
|
|
5
|
-
|
|
6
|
-
const packageJson = require('./package.json')
|
|
7
|
-
const program = require('commander')
|
|
8
|
-
const { prompt } = require('inquirer')
|
|
9
|
-
|
|
10
|
-
const { Create } = require('./commands/create')
|
|
11
|
-
const { getLiveThemeId } = require('./commands/get-live-theme-id')
|
|
12
|
-
|
|
13
|
-
const questions = [
|
|
14
|
-
{
|
|
15
|
-
type: 'input',
|
|
16
|
-
name: 'projectName',
|
|
17
|
-
message: 'Project name',
|
|
18
|
-
validate (input) {
|
|
19
|
-
return new Promise(resolve => {
|
|
20
|
-
resolve(input.length > 0)
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
type: 'input',
|
|
26
|
-
name: 'themeName',
|
|
27
|
-
message: 'Theme name',
|
|
28
|
-
default (answers) {
|
|
29
|
-
return `${answers.projectName} by BAO`
|
|
30
|
-
},
|
|
31
|
-
validate (input) {
|
|
32
|
-
return new Promise(resolve => {
|
|
33
|
-
resolve(input.length > 0)
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
type: 'input',
|
|
39
|
-
name: 'shopName',
|
|
40
|
-
message: 'Shopify store name',
|
|
41
|
-
validate (input) {
|
|
42
|
-
return new Promise(resolve => {
|
|
43
|
-
resolve(input.length > 0)
|
|
44
|
-
})
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
type: 'input',
|
|
49
|
-
name: 'apiKey',
|
|
50
|
-
message: `The private app's API key`,
|
|
51
|
-
validate (input) {
|
|
52
|
-
return new Promise(resolve => {
|
|
53
|
-
resolve(input.length > 0)
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
type: 'password',
|
|
59
|
-
name: 'password',
|
|
60
|
-
message: `The private app's password`,
|
|
61
|
-
validate (input) {
|
|
62
|
-
return new Promise(resolve => {
|
|
63
|
-
resolve(input.length > 0)
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
type: 'input',
|
|
69
|
-
name: 'apiVersion',
|
|
70
|
-
message: `The private app's API version`,
|
|
71
|
-
default: '2020-10',
|
|
72
|
-
validate (input) {
|
|
73
|
-
return new Promise(resolve => {
|
|
74
|
-
resolve(input.length > 0)
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
]
|
|
79
|
-
|
|
80
|
-
program
|
|
81
|
-
.version(packageJson.version)
|
|
82
|
-
.description('BAO CLI tool')
|
|
83
|
-
|
|
84
|
-
program
|
|
85
|
-
.command('create')
|
|
86
|
-
.alias('c')
|
|
87
|
-
.description('Create a Shopify project')
|
|
88
|
-
.action(async () => {
|
|
89
|
-
const answers = await prompt(questions)
|
|
90
|
-
|
|
91
|
-
return new Create(answers)
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
program
|
|
95
|
-
.command('get-live-theme-id')
|
|
96
|
-
.description(`Update a .env file with the current stores live theme`, {
|
|
97
|
-
env: 'the environment file we want to update'
|
|
98
|
-
})
|
|
99
|
-
.arguments('<env> [environment]')
|
|
100
|
-
.action(env => getLiveThemeId(env))
|
|
101
|
-
|
|
102
|
-
program.parse(process.argv)
|
package/utils.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const { spawn } = require('child_process')
|
|
2
|
-
|
|
3
|
-
const spawnPromise = (command, ...args) => {
|
|
4
|
-
return new Promise((resolve, reject) => {
|
|
5
|
-
const child = spawn(command, ...args)
|
|
6
|
-
|
|
7
|
-
child.on('close', code => resolve(code))
|
|
8
|
-
child.on('error', err => reject(err))
|
|
9
|
-
})
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
spawnPromise,
|
|
14
|
-
}
|