@ampt/cli 1.0.37-beta.9 → 1.0.37
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/cli.js +265 -202
- package/dist/cli.js.map +3 -3
- package/package.json +6 -4
- package/test-utils/withCli.ts +0 -47
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampt/cli",
|
|
3
|
-
"version": "1.0.37
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "Ampt command line interface",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=16.0.0
|
|
8
|
+
"node": ">=16.0.0"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
"dayjs": "^1.10.4",
|
|
50
50
|
"debounce": "^1.2.1",
|
|
51
51
|
"del": "^6.0.0",
|
|
52
|
+
"download": "^8.0.0",
|
|
53
|
+
"download-git-repo": "^3.0.2",
|
|
52
54
|
"figures": "^3.2.0",
|
|
53
55
|
"fs-extra": "^9.0.1",
|
|
54
56
|
"get-port": "^5.0.0",
|
|
@@ -81,8 +83,8 @@
|
|
|
81
83
|
"dependencies": {
|
|
82
84
|
"esbuild": "^0.19.5",
|
|
83
85
|
"joycon": "^3.1.1",
|
|
84
|
-
"pirates": "^4.0.
|
|
86
|
+
"pirates": "^4.0.5",
|
|
85
87
|
"source-map-support": "^0.5.21",
|
|
86
|
-
"tsconfig-paths": "^4.2
|
|
88
|
+
"tsconfig-paths": "^4.1.2"
|
|
87
89
|
}
|
|
88
90
|
}
|
package/test-utils/withCli.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { styles, CLI, Project, Tutorial } from '../src/context'
|
|
2
|
-
import { FS } from '../src/models/FS'
|
|
3
|
-
import session from '../src/models/Session'
|
|
4
|
-
|
|
5
|
-
// **
|
|
6
|
-
// * Initial mock setup for a singleton CLI instance that is used in every command unit test
|
|
7
|
-
// **
|
|
8
|
-
export function withCli(fn: (cli: CLI) => void) {
|
|
9
|
-
describe('', () => {
|
|
10
|
-
jest.mock('../src/models/FS')
|
|
11
|
-
jest.mock('../src/context/CLI')
|
|
12
|
-
jest.mock('../src/context/Project')
|
|
13
|
-
jest.mock('../src/context/Tutorial')
|
|
14
|
-
|
|
15
|
-
const cli = new CLI(session)
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
session.captureException = jest.fn().mockReturnValue(null)
|
|
19
|
-
|
|
20
|
-
cli.fs = new FS({ session })
|
|
21
|
-
cli.fs.serviceFile = {
|
|
22
|
-
ampt: {
|
|
23
|
-
org: 'test-org',
|
|
24
|
-
app: 'test-app'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
cli.fs.read = jest.fn().mockResolvedValue({
|
|
28
|
-
serviceFile: cli.fs.serviceFile,
|
|
29
|
-
devDependencies: {},
|
|
30
|
-
dependencies: {},
|
|
31
|
-
hasDevScript: false
|
|
32
|
-
})
|
|
33
|
-
cli.fs.writeDataFile = jest.fn().mockResolvedValue(null)
|
|
34
|
-
cli.fs.writeServiceFile = jest.fn().mockResolvedValue(null)
|
|
35
|
-
|
|
36
|
-
cli.tutorial = new Tutorial(cli)
|
|
37
|
-
cli.project = new Project(cli)
|
|
38
|
-
cli.styles = styles
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
fn(cli)
|
|
42
|
-
|
|
43
|
-
afterEach(() => {
|
|
44
|
-
jest.clearAllMocks()
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
}
|