@webiny/cli 0.0.0-unstable.eb196ccd2f β 0.0.0-unstable.f6dc066313
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 +10 -6
- package/bin.js +9 -97
- package/files/references.json +1 -1
- package/index.js +2 -4
- package/package.json +16 -56
- package/commands/about/getDatabaseSetup.js +0 -45
- package/commands/about/getNpmVersion.js +0 -5
- package/commands/about/getNpxVersion.js +0 -5
- package/commands/about/getPulumiVersions.js +0 -43
- package/commands/about/getYarnVersion.js +0 -5
- package/commands/about/index.js +0 -97
- package/commands/index.js +0 -21
- package/commands/run/index.js +0 -38
- package/commands/telemetry/index.js +0 -31
- package/commands/upgrade/index.js +0 -108
- package/commands/wcp/hooks.js +0 -133
- package/commands/wcp/index.js +0 -8
- package/commands/wcp/login.js +0 -228
- package/commands/wcp/logout.js +0 -28
- package/commands/wcp/project.js +0 -203
- package/commands/wcp/utils/getProjectEnvironment.js +0 -120
- package/commands/wcp/utils/getUser.js +0 -100
- package/commands/wcp/utils/getWcpOrgProjectId.js +0 -9
- package/commands/wcp/utils/getWcpPat.js +0 -5
- package/commands/wcp/utils/getWcpProjectId.js +0 -3
- package/commands/wcp/utils/index.js +0 -19
- package/commands/wcp/utils/setProjectId.js +0 -44
- package/commands/wcp/utils/setWcpPat.js +0 -5
- package/commands/wcp/utils/updateUserLastActiveOn.js +0 -28
- package/commands/wcp/whoami.js +0 -43
- package/context.js +0 -137
- package/files/README.md +0 -1
- package/index.d.ts +0 -5
- package/regions.d.ts +0 -6
- package/regions.js +0 -30
- package/types.d.ts +0 -234
- package/utils/PluginsContainer.js +0 -49
- package/utils/createProjectApplicationWorkspace.js +0 -16
- package/utils/getProject.js +0 -48
- package/utils/getProjectApplication.js +0 -83
- package/utils/importModule.js +0 -43
- package/utils/index.d.ts +0 -28
- package/utils/index.js +0 -28
- package/utils/loadEnvVariables.js +0 -63
- package/utils/localStorage.js +0 -44
- package/utils/log.js +0 -67
- package/utils/sendEvent.js +0 -11
- package/utils/sleep.js +0 -3
- package/utils/sleepSync.js +0 -8
package/README.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
# webiny
|
|
2
|
-
[](https://www.npmjs.com/package/webiny-cli)
|
|
3
|
-
[](https://www.npmjs.com/package/webiny-cli)
|
|
4
|
-
[](https://github.com/prettier/prettier)
|
|
5
|
-
[](http://makeapullrequest.com)
|
|
1
|
+
# @webiny/cli
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> Itβs **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
6
|
+
|
|
7
|
+
π **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/bin.js
CHANGED
|
@@ -1,103 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import "tsx/esm";
|
|
2
3
|
|
|
3
|
-
// Suppress punycode warnings. This is a known issue
|
|
4
|
-
|
|
4
|
+
// Suppress punycode warnings. This is a known issue we can't fix.
|
|
5
|
+
import "./utils/suppressPunycodeWarnings.js";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Detect different Webiny package versions.
|
|
10
|
-
require("./utils/ensureSameWebinyPackageVersions").ensureSameWebinyPackageVersions();
|
|
11
|
-
|
|
12
|
-
const yargs = require("yargs");
|
|
13
|
-
|
|
14
|
-
// Disable help processing until after plugins are imported.
|
|
15
|
-
yargs.help(false);
|
|
16
|
-
|
|
17
|
-
// Loads environment variables from multiple sources.
|
|
18
|
-
require("./utils/loadEnvVariables");
|
|
19
|
-
|
|
20
|
-
const { blue, red, bold, bgYellow } = require("chalk");
|
|
21
|
-
const context = require("./context");
|
|
22
|
-
const { createCommands } = require("./commands");
|
|
23
|
-
|
|
24
|
-
yargs
|
|
25
|
-
.usage("Usage: $0 <command> [options]")
|
|
26
|
-
.demandCommand(1)
|
|
27
|
-
.recommendCommands()
|
|
28
|
-
.scriptName("webiny")
|
|
29
|
-
.epilogue(
|
|
30
|
-
`To find more information, docs and tutorials, see ${blue("https://www.webiny.com/docs")}.`
|
|
31
|
-
)
|
|
32
|
-
.epilogue(`Want to contribute? ${blue("https://github.com/webiny/webiny-js")}.`)
|
|
33
|
-
.fail(function (msg, error, yargs) {
|
|
34
|
-
if (msg) {
|
|
35
|
-
if (msg.includes("Not enough non-option arguments")) {
|
|
36
|
-
console.log();
|
|
37
|
-
context.error(red("Command was not invoked as expected!"));
|
|
38
|
-
context.info(
|
|
39
|
-
`Some non-optional arguments are missing. See the usage examples printed below.`
|
|
40
|
-
);
|
|
41
|
-
console.log();
|
|
42
|
-
yargs.showHelp();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
7
|
+
import { Cli } from "@webiny/cli-core";
|
|
8
|
+
import { ensureSystemRequirements } from "@webiny/system-requirements";
|
|
45
9
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.split(":")[1]
|
|
49
|
-
.split(",")
|
|
50
|
-
.map(v => v.trim());
|
|
51
|
-
|
|
52
|
-
console.log();
|
|
53
|
-
context.error(red("Command was not invoked as expected!"));
|
|
54
|
-
context.info(
|
|
55
|
-
`Missing required argument(s): ${args
|
|
56
|
-
.map(arg => red(arg))
|
|
57
|
-
.join(", ")}. See the usage examples printed below.`
|
|
58
|
-
);
|
|
59
|
-
console.log();
|
|
60
|
-
yargs.showHelp();
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
console.log();
|
|
64
|
-
context.error(red("Command execution was aborted!"));
|
|
65
|
-
context.error(msg);
|
|
66
|
-
console.log();
|
|
67
|
-
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
console.log();
|
|
72
|
-
// Unfortunately, yargs doesn't provide passed args here, so we had to do it via process.argv.
|
|
73
|
-
const debugEnabled = process.argv.includes("--debug");
|
|
74
|
-
if (debugEnabled) {
|
|
75
|
-
context.debug(error);
|
|
76
|
-
} else {
|
|
77
|
-
context.error(error.message);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const gracefulError = error.cause?.gracefulError;
|
|
81
|
-
if (gracefulError instanceof Error) {
|
|
82
|
-
console.log();
|
|
83
|
-
console.log(bgYellow(bold("π‘ How can I resolve this?")));
|
|
84
|
-
console.log(gracefulError.message);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const plugins = context.plugins.byType("cli-command-error");
|
|
88
|
-
for (let i = 0; i < plugins.length; i++) {
|
|
89
|
-
const plugin = plugins[i];
|
|
90
|
-
plugin.handle({
|
|
91
|
-
error,
|
|
92
|
-
context
|
|
93
|
-
});
|
|
94
|
-
}
|
|
10
|
+
// Ensure system requirements are met.
|
|
11
|
+
ensureSystemRequirements();
|
|
95
12
|
|
|
96
|
-
|
|
97
|
-
});
|
|
13
|
+
const cli = await Cli.init();
|
|
98
14
|
|
|
99
|
-
|
|
100
|
-
await createCommands(yargs, context);
|
|
101
|
-
// Enable help and run the CLI.
|
|
102
|
-
yargs.help().argv;
|
|
103
|
-
})();
|
|
15
|
+
await cli.run();
|