@ampt/cli 0.0.1-beta.64 → 0.0.1-beta.65
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/bin/bin +1 -1
- package/bin/sandbox +39 -0
- package/dist/cli.js +93 -91
- package/dist/cli.js.map +2 -2
- package/dist/sandbox.js +572 -0
- package/dist/sandbox.js.map +6 -0
- package/package.json +3 -2
package/bin/bin
CHANGED
|
@@ -8,7 +8,7 @@ if (process.version.slice(1).split('.')[0] < 16) {
|
|
|
8
8
|
|
|
9
9
|
if (!process.env.AMPT_STAGE && process.env.AMPT_ENDPOINT) {
|
|
10
10
|
if (process.env.AMPT_ENDPOINT.includes('.amptlabs.dev')) {
|
|
11
|
-
const subdomain = process.env.AMPT_ENDPOINT.replace(/https:\/\//, '').split('.')
|
|
11
|
+
const subdomain = process.env.AMPT_ENDPOINT.replace(/https:\/\//, '').split('.')[0]
|
|
12
12
|
process.env.AMPT_STAGE = subdomain === 'api' ? 'dev' : subdomain
|
|
13
13
|
}
|
|
14
14
|
}
|
package/bin/sandbox
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
if (process.version.slice(1).split('.')[0] < 16) {
|
|
5
|
+
console.log('@ampt/cli requires Node.js 16+')
|
|
6
|
+
process.exit(-1)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (!process.env.AMPT_STAGE && process.env.AMPT_ENDPOINT) {
|
|
10
|
+
if (process.env.AMPT_ENDPOINT.includes('.amptlabs.dev')) {
|
|
11
|
+
const subdomain = process.env.AMPT_ENDPOINT.replace(/https:\/\//, '').split('.')[0]
|
|
12
|
+
process.env.AMPT_STAGE = subdomain === 'api' ? 'dev' : subdomain
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
process.env.AMPT_STAGE = process.env.AMPT_STAGE || 'prod'
|
|
17
|
+
const stage = process.env.AMPT_STAGE
|
|
18
|
+
|
|
19
|
+
if (!process.env.AMPT_ENDPOINT) {
|
|
20
|
+
process.env.AMPT_ENDPOINT =
|
|
21
|
+
stage === 'prod' ? 'https://api.ampt.dev' : `https://${stage === 'dev' ? 'api' : stage}.amptlabs.dev`
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
process.env.AMPT_DASHBOARD_URL_ROOT = stage === 'prod' ? 'https://ampt.dev' : 'https://amptlabs.dev'
|
|
25
|
+
|
|
26
|
+
if (!process.env.AMPT_WS_ENDPOINT) {
|
|
27
|
+
process.env.AMPT_WS_ENDPOINT =
|
|
28
|
+
stage === 'prod'
|
|
29
|
+
? 'wss://ws.ampt.dev'
|
|
30
|
+
: stage === 'dev'
|
|
31
|
+
? 'wss://ws.amptlabs.dev'
|
|
32
|
+
: `wss://${stage}.ws.amptlabs.dev`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
require('source-map-support').install({
|
|
36
|
+
handleUncaughtExceptions: false,
|
|
37
|
+
environment: 'node'
|
|
38
|
+
})
|
|
39
|
+
require('../dist/sandbox.js')
|