@webiny/cli 5.30.0 → 5.31.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/CHANGELOG.md CHANGED
@@ -3,6 +3,39 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.31.0](https://github.com/webiny/webiny-js/compare/v5.31.0-beta.1...v5.31.0) (2022-08-18)
7
+
8
+ **Note:** Version bump only for package @webiny/cli
9
+
10
+
11
+
12
+
13
+
14
+ # [5.31.0-beta.1](https://github.com/webiny/webiny-js/compare/v5.31.0-beta.0...v5.31.0-beta.1) (2022-08-17)
15
+
16
+ **Note:** Version bump only for package @webiny/cli
17
+
18
+
19
+
20
+
21
+
22
+ # [5.31.0-beta.0](https://github.com/webiny/webiny-js/compare/v5.30.0...v5.31.0-beta.0) (2022-08-16)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * improve setup-project script ([#2571](https://github.com/webiny/webiny-js/issues/2571)) ([6c010d9](https://github.com/webiny/webiny-js/commit/6c010d99a58e3974d0d7efaefc5ac9cea2abc113))
28
+
29
+
30
+ ### Features
31
+
32
+ * **handler-fastify:** add fastify as handler into the system ([#2546](https://github.com/webiny/webiny-js/issues/2546)) ([8d258aa](https://github.com/webiny/webiny-js/commit/8d258aa2ebd8562b79e395d7aeea6316405f7f4e))
33
+ * add support for custom React apps ([#2569](https://github.com/webiny/webiny-js/issues/2569)) ([f7af516](https://github.com/webiny/webiny-js/commit/f7af516d745b2da74da9497658f3fd9702d5a639))
34
+
35
+
36
+
37
+
38
+
6
39
  # [5.30.0](https://github.com/webiny/webiny-js/compare/v5.30.0-beta.1...v5.30.0) (2022-07-27)
7
40
 
8
41
  **Note:** Version bump only for package @webiny/cli
package/commands/index.js CHANGED
@@ -1,10 +1,16 @@
1
1
  const run = require("./run");
2
2
  const telemetry = require("./telemetry");
3
- const wcp = require("./wcp");
4
3
  const upgrade = require("./upgrade");
5
4
 
6
5
  module.exports.createCommands = async (yargs, context) => {
7
- context.plugins.register(run, telemetry, upgrade, wcp);
6
+ context.plugins.register(run, telemetry, upgrade);
7
+
8
+ try {
9
+ const wcp = require("./wcp");
10
+ context.plugins.register(wcp);
11
+ } catch {
12
+ // Skip WCP command
13
+ }
8
14
 
9
15
  await context.loadUserPlugins();
10
16
 
@@ -1,5 +1,6 @@
1
1
  const camelCase = require("camelcase");
2
2
  const findUp = require("find-up");
3
+ const path = require("path");
3
4
 
4
5
  module.exports = {
5
6
  type: "cli-command",
@@ -16,9 +17,16 @@ module.exports = {
16
17
  },
17
18
  async argv => {
18
19
  const configFile = findUp.sync(["webiny.config.ts", "webiny.config.js"]);
19
- const config = context.import(configFile);
20
+ let config = context.import(configFile);
20
21
 
21
22
  const command = camelCase(argv.command);
23
+ if (typeof config === "function") {
24
+ config = config({
25
+ options: { ...argv, cwd: path.dirname(configFile) },
26
+ context
27
+ });
28
+ }
29
+
22
30
  if (config.commands && typeof config.commands[command] === "function") {
23
31
  return await config.commands[command]({ ...argv }, context);
24
32
  }
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { CliContext } from "./types";
2
+
3
+ export declare const cli: CliContext;
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ const context = require("./context");
2
+
3
+ module.exports.cli = context;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/cli",
3
- "version": "5.30.0",
3
+ "version": "5.31.0",
4
4
  "main": "index.js",
5
5
  "bin": {
6
6
  "webiny": "./bin.js"
@@ -13,8 +13,8 @@
13
13
  "author": "Pavel Denisjuk <pavel@webiny.com>",
14
14
  "description": "A tool to bootstrap a Webiny project.",
15
15
  "dependencies": {
16
- "@webiny/telemetry": "5.30.0",
17
- "@webiny/wcp": "5.30.0",
16
+ "@webiny/telemetry": "5.31.0",
17
+ "@webiny/wcp": "5.31.0",
18
18
  "boolean": "3.1.4",
19
19
  "camelcase": "5.3.1",
20
20
  "chalk": "4.1.2",
@@ -50,9 +50,7 @@
50
50
  "@webiny/project-utils",
51
51
  "@webiny/api-file-manager",
52
52
  "@webiny/cli-plugin-deploy-pulumi",
53
- "@webiny/handler",
54
- "@webiny/handler-http",
55
- "@webiny/handler-args",
53
+ "@webiny/api",
56
54
  "@webiny/handler-client",
57
55
  "@webiny/api-elasticsearch",
58
56
  "@webiny/api-tenancy",
@@ -66,5 +64,5 @@
66
64
  ]
67
65
  }
68
66
  },
69
- "gitHead": "3cadc5d26e565586b28772afbc18ae554ce7b782"
67
+ "gitHead": "0b3fa2ace7f258628438aa993d782fb562a64358"
70
68
  }
package/types.d.ts CHANGED
@@ -111,39 +111,3 @@ export interface CliContext {
111
111
  get: (key: string) => any;
112
112
  };
113
113
  }
114
-
115
- /**
116
- * Args received from the CLI.
117
- */
118
- interface CliUpgradePluginOptions {
119
- /**
120
- * Targeted version of the upgrade.
121
- */
122
- targetVersion: string;
123
- }
124
- /**
125
- *
126
- */
127
- export interface CliUpgradePlugin extends Plugin {
128
- /**
129
- * Name of the plugin to differentiate from others.
130
- * Something like: cli-upgrade-5.0.0
131
- */
132
- name: string;
133
- /**
134
- * Type of the plugin.
135
- */
136
- type: "cli-upgrade";
137
- /**
138
- * Version the plugin is for.
139
- */
140
- version: string;
141
- /**
142
- * Is this plugin usable for the upgrade?
143
- */
144
- canUpgrade?: (options: CliUpgradePluginOptions, context: CliContext) => Promise<boolean>;
145
- /**
146
- * Apply the upgrade.
147
- */
148
- upgrade: (options: CliUpgradePluginOptions, context: CliContext) => Promise<void>;
149
- }