@strapi/cloud-cli 0.0.0-next.c27880c9af0e2c29e6d6512b0d5fbaa6b506acdc → 0.0.0-next.c57731c6e91ae024fa544ad986d80a3c4a489dbf
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/LICENSE +18 -3
- package/dist/bin.js +53 -171
- package/dist/bin.js.map +1 -1
- package/dist/bin.mjs +57 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/chunks/index-Bpt2nQok.js +1896 -0
- package/dist/chunks/index-Bpt2nQok.js.map +1 -0
- package/dist/chunks/index-CDqSCNTc.mjs +1869 -0
- package/dist/chunks/index-CDqSCNTc.mjs.map +1 -0
- package/dist/index.js +33 -1230
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -1170
- package/dist/index.mjs.map +1 -1
- package/dist/src/cloud/command.d.ts +3 -0
- package/dist/src/cloud/command.d.ts.map +1 -0
- package/dist/src/create-project/action.d.ts +1 -1
- package/dist/src/create-project/action.d.ts.map +1 -1
- package/dist/src/create-project/command.d.ts.map +1 -1
- package/dist/src/create-project/utils/get-project-name-from-pkg.d.ts +3 -0
- package/dist/src/create-project/utils/get-project-name-from-pkg.d.ts.map +1 -0
- package/dist/src/create-project/utils/project-questions.utils.d.ts +20 -0
- package/dist/src/create-project/utils/project-questions.utils.d.ts.map +1 -0
- package/dist/src/deploy-project/action.d.ts +5 -1
- package/dist/src/deploy-project/action.d.ts.map +1 -1
- package/dist/src/deploy-project/command.d.ts.map +1 -1
- package/dist/src/environment/command.d.ts +3 -0
- package/dist/src/environment/command.d.ts.map +1 -0
- package/dist/src/environment/link/action.d.ts +4 -0
- package/dist/src/environment/link/action.d.ts.map +1 -0
- package/dist/src/environment/link/command.d.ts +4 -0
- package/dist/src/environment/link/command.d.ts.map +1 -0
- package/dist/src/environment/link/index.d.ts +7 -0
- package/dist/src/environment/link/index.d.ts.map +1 -0
- package/dist/src/environment/list/action.d.ts +4 -0
- package/dist/src/environment/list/action.d.ts.map +1 -0
- package/dist/src/environment/list/command.d.ts +4 -0
- package/dist/src/environment/list/command.d.ts.map +1 -0
- package/dist/src/environment/list/index.d.ts +7 -0
- package/dist/src/environment/list/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/link/action.d.ts +4 -0
- package/dist/src/link/action.d.ts.map +1 -0
- package/dist/src/link/command.d.ts +7 -0
- package/dist/src/link/command.d.ts.map +1 -0
- package/dist/src/link/index.d.ts +7 -0
- package/dist/src/link/index.d.ts.map +1 -0
- package/dist/src/list-projects/action.d.ts +4 -0
- package/dist/src/list-projects/action.d.ts.map +1 -0
- package/dist/src/list-projects/command.d.ts +7 -0
- package/dist/src/list-projects/command.d.ts.map +1 -0
- package/dist/src/list-projects/index.d.ts +7 -0
- package/dist/src/list-projects/index.d.ts.map +1 -0
- package/dist/src/login/action.d.ts +2 -2
- package/dist/src/login/action.d.ts.map +1 -1
- package/dist/src/login/command.d.ts.map +1 -1
- package/dist/src/logout/action.d.ts.map +1 -1
- package/dist/src/logout/command.d.ts.map +1 -1
- package/dist/src/services/build-logs.d.ts.map +1 -1
- package/dist/src/services/cli-api.d.ts +67 -10
- package/dist/src/services/cli-api.d.ts.map +1 -1
- package/dist/src/services/strapi-info-save.d.ts +15 -2
- package/dist/src/services/strapi-info-save.d.ts.map +1 -1
- package/dist/src/services/token.d.ts +1 -1
- package/dist/src/services/token.d.ts.map +1 -1
- package/dist/src/types.d.ts +8 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/analytics.d.ts +4 -0
- package/dist/src/utils/analytics.d.ts.map +1 -0
- package/dist/src/utils/compress-files.d.ts.map +1 -1
- package/dist/src/utils/get-local-config.d.ts +6 -0
- package/dist/src/utils/get-local-config.d.ts.map +1 -0
- package/dist/src/utils/helpers.d.ts.map +1 -1
- package/dist/src/utils/pkg.d.ts.map +1 -1
- package/package.json +15 -13
package/LICENSE
CHANGED
|
@@ -2,7 +2,21 @@ Copyright (c) 2015-present Strapi Solutions SAS
|
|
|
2
2
|
|
|
3
3
|
Portions of the Strapi software are licensed as follows:
|
|
4
4
|
|
|
5
|
-
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined
|
|
5
|
+
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined below.
|
|
6
|
+
|
|
7
|
+
Enterprise License
|
|
8
|
+
|
|
9
|
+
If you or the company you represent has entered into a written agreement referencing the Enterprise Edition of the Strapi source code available at
|
|
10
|
+
https://github.com/strapi/strapi, then such agreement applies to your use of the Enterprise Edition of the Strapi Software. If you or the company you
|
|
11
|
+
represent is using the Enterprise Edition of the Strapi Software in connection with a subscription to our cloud offering, then the agreement you have
|
|
12
|
+
agreed to with respect to our cloud offering and the licenses included in such agreement apply to your use of the Enterprise Edition of the Strapi Software.
|
|
13
|
+
Otherwise, the Strapi Enterprise Software License Agreement (found here https://strapi.io/enterprise-terms) applies to your use of the Enterprise Edition of the Strapi Software.
|
|
14
|
+
|
|
15
|
+
BY ACCESSING OR USING THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE RELEVANT REFERENCED AGREEMENT.
|
|
16
|
+
IF YOU ARE NOT AUTHORIZED TO ACCEPT THESE TERMS ON BEHALF OF THE COMPANY YOU REPRESENT OR IF YOU DO NOT AGREE TO ALL OF THE RELEVANT TERMS AND CONDITIONS REFERENCED AND YOU
|
|
17
|
+
HAVE NOT OTHERWISE EXECUTED A WRITTEN AGREEMENT WITH STRAPI, YOU ARE NOT AUTHORIZED TO ACCESS OR USE OR ALLOW ANY USER TO ACCESS OR USE ANY PART OF
|
|
18
|
+
THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE. YOUR ACCESS RIGHTS ARE CONDITIONAL ON YOUR CONSENT TO THE RELEVANT REFERENCED TERMS TO THE EXCLUSION OF ALL OTHER TERMS;
|
|
19
|
+
IF THE RELEVANT REFERENCED TERMS ARE CONSIDERED AN OFFER BY YOU, ACCEPTANCE IS EXPRESSLY LIMITED TO THE RELEVANT REFERENCED TERMS.
|
|
6
20
|
|
|
7
21
|
* All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
|
|
8
22
|
|
|
@@ -18,5 +32,6 @@ furnished to do so, subject to the following conditions:
|
|
|
18
32
|
The above copyright notice and this permission notice shall be included in all
|
|
19
33
|
copies or substantial portions of the Software.
|
|
20
34
|
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
36
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
37
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/bin.js
CHANGED
|
@@ -1,177 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require(
|
|
5
|
-
require(
|
|
6
|
-
require(
|
|
7
|
-
|
|
8
|
-
require(
|
|
9
|
-
require(
|
|
10
|
-
require(
|
|
11
|
-
require(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
n.default = e;
|
|
34
|
-
return Object.freeze(n);
|
|
35
|
-
}
|
|
36
|
-
const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
|
|
37
|
-
const stringify__default = /* @__PURE__ */ _interopDefault(stringify);
|
|
38
|
-
const ora__default = /* @__PURE__ */ _interopDefault(ora);
|
|
39
|
-
const cliProgress__namespace = /* @__PURE__ */ _interopNamespace(cliProgress);
|
|
40
|
-
({
|
|
41
|
-
apiBaseUrl: utils.env("STRAPI_CLI_CLOUD_API", "https://cloud-cli-api.strapi.io"),
|
|
42
|
-
dashboardBaseUrl: utils.env("STRAPI_CLI_CLOUD_DASHBOARD", "https://cloud.strapi.io")
|
|
43
|
-
});
|
|
44
|
-
const stringifyArg = (arg) => {
|
|
45
|
-
return typeof arg === "object" ? stringify__default.default(arg) : arg;
|
|
46
|
-
};
|
|
47
|
-
const createLogger = (options = {}) => {
|
|
48
|
-
const { silent = false, debug = false, timestamp = true } = options;
|
|
49
|
-
const state = { errors: 0, warning: 0 };
|
|
50
|
-
return {
|
|
51
|
-
get warnings() {
|
|
52
|
-
return state.warning;
|
|
53
|
-
},
|
|
54
|
-
get errors() {
|
|
55
|
-
return state.errors;
|
|
56
|
-
},
|
|
57
|
-
async debug(...args) {
|
|
58
|
-
if (silent || !debug) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
console.log(
|
|
62
|
-
chalk__default.default.cyan(`[DEBUG]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
63
|
-
...args.map(stringifyArg)
|
|
64
|
-
);
|
|
65
|
-
},
|
|
66
|
-
info(...args) {
|
|
67
|
-
if (silent) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
console.info(
|
|
71
|
-
chalk__default.default.blue(`[INFO]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
72
|
-
...args.map(stringifyArg)
|
|
73
|
-
);
|
|
74
|
-
},
|
|
75
|
-
log(...args) {
|
|
76
|
-
if (silent) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
console.info(
|
|
80
|
-
chalk__default.default.blue(`${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
81
|
-
...args.map(stringifyArg)
|
|
82
|
-
);
|
|
83
|
-
},
|
|
84
|
-
success(...args) {
|
|
85
|
-
if (silent) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
console.info(
|
|
89
|
-
chalk__default.default.green(`[SUCCESS]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
90
|
-
...args.map(stringifyArg)
|
|
91
|
-
);
|
|
92
|
-
},
|
|
93
|
-
warn(...args) {
|
|
94
|
-
state.warning += 1;
|
|
95
|
-
if (silent) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
console.warn(
|
|
99
|
-
chalk__default.default.yellow(`[WARN]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
100
|
-
...args.map(stringifyArg)
|
|
101
|
-
);
|
|
102
|
-
},
|
|
103
|
-
error(...args) {
|
|
104
|
-
state.errors += 1;
|
|
105
|
-
if (silent) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
console.error(
|
|
109
|
-
chalk__default.default.red(`[ERROR]${timestamp ? ` [${(/* @__PURE__ */ new Date()).toISOString()}]` : ""}`),
|
|
110
|
-
...args.map(stringifyArg)
|
|
111
|
-
);
|
|
112
|
-
},
|
|
113
|
-
// @ts-expect-error – returning a subpart of ora is fine because the types tell us what is what.
|
|
114
|
-
spinner(text) {
|
|
115
|
-
if (silent) {
|
|
116
|
-
return {
|
|
117
|
-
succeed() {
|
|
118
|
-
return this;
|
|
119
|
-
},
|
|
120
|
-
fail() {
|
|
121
|
-
return this;
|
|
122
|
-
},
|
|
123
|
-
start() {
|
|
124
|
-
return this;
|
|
125
|
-
},
|
|
126
|
-
text: "",
|
|
127
|
-
isSpinning: false
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
return ora__default.default(text);
|
|
131
|
-
},
|
|
132
|
-
progressBar(totalSize, text) {
|
|
133
|
-
if (silent) {
|
|
134
|
-
return {
|
|
135
|
-
start() {
|
|
136
|
-
return this;
|
|
137
|
-
},
|
|
138
|
-
stop() {
|
|
139
|
-
return this;
|
|
140
|
-
},
|
|
141
|
-
update() {
|
|
142
|
-
return this;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
const progressBar = new cliProgress__namespace.SingleBar({
|
|
147
|
-
format: `${text ? `${text} |` : ""}${chalk__default.default.green("{bar}")}| {percentage}%`,
|
|
148
|
-
barCompleteChar: "█",
|
|
149
|
-
barIncompleteChar: "░",
|
|
150
|
-
hideCursor: true,
|
|
151
|
-
forceRedraw: true
|
|
152
|
-
});
|
|
153
|
-
progressBar.start(totalSize, 0);
|
|
154
|
-
return progressBar;
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var commander = require('commander');
|
|
4
|
+
require('axios');
|
|
5
|
+
require('fs-extra');
|
|
6
|
+
require('os');
|
|
7
|
+
var index = require('./chunks/index-Bpt2nQok.js');
|
|
8
|
+
require('path');
|
|
9
|
+
require('xdg-app-paths');
|
|
10
|
+
require('lodash');
|
|
11
|
+
require('jwks-rsa');
|
|
12
|
+
require('jsonwebtoken');
|
|
13
|
+
require('crypto');
|
|
14
|
+
require('inquirer');
|
|
15
|
+
require('boxen');
|
|
16
|
+
require('chalk');
|
|
17
|
+
require('node:crypto');
|
|
18
|
+
require('@strapi/utils');
|
|
19
|
+
require('tar');
|
|
20
|
+
require('minimatch');
|
|
21
|
+
require('lodash/fp');
|
|
22
|
+
require('fast-safe-stringify');
|
|
23
|
+
require('ora');
|
|
24
|
+
require('cli-progress');
|
|
25
|
+
require('pkg-up');
|
|
26
|
+
require('yup');
|
|
27
|
+
require('eventsource');
|
|
28
|
+
|
|
158
29
|
function loadStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
30
|
+
// Initial program setup
|
|
31
|
+
command.storeOptionsAsProperties(false).allowUnknownOption(true);
|
|
32
|
+
// Help command
|
|
33
|
+
command.helpOption('-h, --help', 'Display help for command');
|
|
34
|
+
command.addHelpCommand('help [command]', 'Display help for command');
|
|
35
|
+
const cwd = process.cwd();
|
|
36
|
+
const hasDebug = argv.includes('--debug');
|
|
37
|
+
const hasSilent = argv.includes('--silent');
|
|
38
|
+
const logger = index.createLogger({
|
|
39
|
+
debug: hasDebug,
|
|
40
|
+
silent: hasSilent,
|
|
41
|
+
timestamp: false
|
|
42
|
+
});
|
|
43
|
+
const ctx = {
|
|
44
|
+
cwd,
|
|
45
|
+
logger
|
|
46
|
+
};
|
|
47
|
+
index.buildStrapiCloudCommands({
|
|
48
|
+
command,
|
|
49
|
+
ctx,
|
|
50
|
+
argv
|
|
51
|
+
});
|
|
171
52
|
}
|
|
172
53
|
function runStrapiCloudCommand(argv = process.argv, command = new commander.Command()) {
|
|
173
|
-
|
|
174
|
-
|
|
54
|
+
loadStrapiCloudCommand(argv, command);
|
|
55
|
+
command.parse(argv);
|
|
175
56
|
}
|
|
57
|
+
|
|
176
58
|
exports.runStrapiCloudCommand = runStrapiCloudCommand;
|
|
177
59
|
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"bin.js","sources":["../src/bin.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { createLogger } from './services';\nimport { CLIContext } from './types';\nimport { buildStrapiCloudCommands } from './index';\n\nfunction loadStrapiCloudCommand(argv = process.argv, command = new Command()) {\n // Initial program setup\n command.storeOptionsAsProperties(false).allowUnknownOption(true);\n\n // Help command\n command.helpOption('-h, --help', 'Display help for command');\n command.addHelpCommand('help [command]', 'Display help for command');\n\n const cwd = process.cwd();\n\n const hasDebug = argv.includes('--debug');\n const hasSilent = argv.includes('--silent');\n\n const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });\n\n const ctx = {\n cwd,\n logger,\n } satisfies CLIContext;\n\n buildStrapiCloudCommands({ command, ctx, argv });\n}\n\nfunction runStrapiCloudCommand(argv = process.argv, command = new Command()) {\n loadStrapiCloudCommand(argv, command);\n command.parse(argv);\n}\n\nexport { runStrapiCloudCommand };\n"],"names":["loadStrapiCloudCommand","argv","process","command","Command","storeOptionsAsProperties","allowUnknownOption","helpOption","addHelpCommand","cwd","hasDebug","includes","hasSilent","logger","createLogger","debug","silent","timestamp","ctx","buildStrapiCloudCommands","runStrapiCloudCommand","parse"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASA,uBAAuBC,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,iBAAS,EAAA,EAAA;;AAE1ED,IAAAA,OAAAA,CAAQE,wBAAwB,CAAC,KAAOC,CAAAA,CAAAA,kBAAkB,CAAC,IAAA,CAAA;;IAG3DH,OAAQI,CAAAA,UAAU,CAAC,YAAc,EAAA,0BAAA,CAAA;IACjCJ,OAAQK,CAAAA,cAAc,CAAC,gBAAkB,EAAA,0BAAA,CAAA;IAEzC,MAAMC,GAAAA,GAAMP,QAAQO,GAAG,EAAA;IAEvB,MAAMC,QAAAA,GAAWT,IAAKU,CAAAA,QAAQ,CAAC,SAAA,CAAA;IAC/B,MAAMC,SAAAA,GAAYX,IAAKU,CAAAA,QAAQ,CAAC,UAAA,CAAA;AAEhC,IAAA,MAAME,SAASC,kBAAa,CAAA;QAAEC,KAAOL,EAAAA,QAAAA;QAAUM,MAAQJ,EAAAA,SAAAA;QAAWK,SAAW,EAAA;AAAM,KAAA,CAAA;AAEnF,IAAA,MAAMC,GAAM,GAAA;AACVT,QAAAA,GAAAA;AACAI,QAAAA;AACF,KAAA;IAEAM,8BAAyB,CAAA;AAAEhB,QAAAA,OAAAA;AAASe,QAAAA,GAAAA;AAAKjB,QAAAA;AAAK,KAAA,CAAA;AAChD;AAEA,SAASmB,sBAAsBnB,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,iBAAS,EAAA,EAAA;AACzEJ,IAAAA,sBAAAA,CAAuBC,IAAME,EAAAA,OAAAA,CAAAA;AAC7BA,IAAAA,OAAAA,CAAQkB,KAAK,CAACpB,IAAAA,CAAAA;AAChB;;;;"}
|
package/dist/bin.mjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import 'axios';
|
|
3
|
+
import 'fs-extra';
|
|
4
|
+
import 'os';
|
|
5
|
+
import { b as buildStrapiCloudCommands, c as createLogger } from './chunks/index-CDqSCNTc.mjs';
|
|
6
|
+
import 'path';
|
|
7
|
+
import 'xdg-app-paths';
|
|
8
|
+
import 'lodash';
|
|
9
|
+
import 'jwks-rsa';
|
|
10
|
+
import 'jsonwebtoken';
|
|
11
|
+
import 'crypto';
|
|
12
|
+
import 'inquirer';
|
|
13
|
+
import 'boxen';
|
|
14
|
+
import 'chalk';
|
|
15
|
+
import 'node:crypto';
|
|
16
|
+
import '@strapi/utils';
|
|
17
|
+
import 'tar';
|
|
18
|
+
import 'minimatch';
|
|
19
|
+
import 'lodash/fp';
|
|
20
|
+
import 'fast-safe-stringify';
|
|
21
|
+
import 'ora';
|
|
22
|
+
import 'cli-progress';
|
|
23
|
+
import 'pkg-up';
|
|
24
|
+
import 'yup';
|
|
25
|
+
import 'eventsource';
|
|
26
|
+
|
|
27
|
+
function loadStrapiCloudCommand(argv = process.argv, command = new Command()) {
|
|
28
|
+
// Initial program setup
|
|
29
|
+
command.storeOptionsAsProperties(false).allowUnknownOption(true);
|
|
30
|
+
// Help command
|
|
31
|
+
command.helpOption('-h, --help', 'Display help for command');
|
|
32
|
+
command.addHelpCommand('help [command]', 'Display help for command');
|
|
33
|
+
const cwd = process.cwd();
|
|
34
|
+
const hasDebug = argv.includes('--debug');
|
|
35
|
+
const hasSilent = argv.includes('--silent');
|
|
36
|
+
const logger = createLogger({
|
|
37
|
+
debug: hasDebug,
|
|
38
|
+
silent: hasSilent,
|
|
39
|
+
timestamp: false
|
|
40
|
+
});
|
|
41
|
+
const ctx = {
|
|
42
|
+
cwd,
|
|
43
|
+
logger
|
|
44
|
+
};
|
|
45
|
+
buildStrapiCloudCommands({
|
|
46
|
+
command,
|
|
47
|
+
ctx,
|
|
48
|
+
argv
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function runStrapiCloudCommand(argv = process.argv, command = new Command()) {
|
|
52
|
+
loadStrapiCloudCommand(argv, command);
|
|
53
|
+
command.parse(argv);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { runStrapiCloudCommand };
|
|
57
|
+
//# sourceMappingURL=bin.mjs.map
|
package/dist/bin.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.mjs","sources":["../src/bin.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { createLogger } from './services';\nimport { CLIContext } from './types';\nimport { buildStrapiCloudCommands } from './index';\n\nfunction loadStrapiCloudCommand(argv = process.argv, command = new Command()) {\n // Initial program setup\n command.storeOptionsAsProperties(false).allowUnknownOption(true);\n\n // Help command\n command.helpOption('-h, --help', 'Display help for command');\n command.addHelpCommand('help [command]', 'Display help for command');\n\n const cwd = process.cwd();\n\n const hasDebug = argv.includes('--debug');\n const hasSilent = argv.includes('--silent');\n\n const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false });\n\n const ctx = {\n cwd,\n logger,\n } satisfies CLIContext;\n\n buildStrapiCloudCommands({ command, ctx, argv });\n}\n\nfunction runStrapiCloudCommand(argv = process.argv, command = new Command()) {\n loadStrapiCloudCommand(argv, command);\n command.parse(argv);\n}\n\nexport { runStrapiCloudCommand };\n"],"names":["loadStrapiCloudCommand","argv","process","command","Command","storeOptionsAsProperties","allowUnknownOption","helpOption","addHelpCommand","cwd","hasDebug","includes","hasSilent","logger","createLogger","debug","silent","timestamp","ctx","buildStrapiCloudCommands","runStrapiCloudCommand","parse"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASA,uBAAuBC,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,OAAS,EAAA,EAAA;;AAE1ED,IAAAA,OAAAA,CAAQE,wBAAwB,CAAC,KAAOC,CAAAA,CAAAA,kBAAkB,CAAC,IAAA,CAAA;;IAG3DH,OAAQI,CAAAA,UAAU,CAAC,YAAc,EAAA,0BAAA,CAAA;IACjCJ,OAAQK,CAAAA,cAAc,CAAC,gBAAkB,EAAA,0BAAA,CAAA;IAEzC,MAAMC,GAAAA,GAAMP,QAAQO,GAAG,EAAA;IAEvB,MAAMC,QAAAA,GAAWT,IAAKU,CAAAA,QAAQ,CAAC,SAAA,CAAA;IAC/B,MAAMC,SAAAA,GAAYX,IAAKU,CAAAA,QAAQ,CAAC,UAAA,CAAA;AAEhC,IAAA,MAAME,SAASC,YAAa,CAAA;QAAEC,KAAOL,EAAAA,QAAAA;QAAUM,MAAQJ,EAAAA,SAAAA;QAAWK,SAAW,EAAA;AAAM,KAAA,CAAA;AAEnF,IAAA,MAAMC,GAAM,GAAA;AACVT,QAAAA,GAAAA;AACAI,QAAAA;AACF,KAAA;IAEAM,wBAAyB,CAAA;AAAEhB,QAAAA,OAAAA;AAASe,QAAAA,GAAAA;AAAKjB,QAAAA;AAAK,KAAA,CAAA;AAChD;AAEA,SAASmB,sBAAsBnB,IAAOC,GAAAA,OAAAA,CAAQD,IAAI,EAAEE,OAAAA,GAAU,IAAIC,OAAS,EAAA,EAAA;AACzEJ,IAAAA,sBAAAA,CAAuBC,IAAME,EAAAA,OAAAA,CAAAA;AAC7BA,IAAAA,OAAAA,CAAQkB,KAAK,CAACpB,IAAAA,CAAAA;AAChB;;;;"}
|