@webiny/cli 5.16.0-beta.1 → 5.16.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,44 @@
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.16.0](https://github.com/webiny/webiny-js/compare/v5.16.0-beta.4...v5.16.0) (2021-10-21)
7
+
8
+ **Note:** Version bump only for package @webiny/cli
9
+
10
+
11
+
12
+
13
+
14
+ # [5.16.0-beta.4](https://github.com/webiny/webiny-js/compare/v5.16.0-beta.3...v5.16.0-beta.4) (2021-10-20)
15
+
16
+ **Note:** Version bump only for package @webiny/cli
17
+
18
+
19
+
20
+
21
+
22
+ # [5.16.0-beta.3](https://github.com/webiny/webiny-js/compare/v5.16.0-beta.2...v5.16.0-beta.3) (2021-10-20)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **cli:** upgrade must take current cli version ([#1977](https://github.com/webiny/webiny-js/issues/1977)) ([4f9f4f0](https://github.com/webiny/webiny-js/commit/4f9f4f0dad8550de816b478a7a813a105a5f661f))
28
+
29
+
30
+
31
+
32
+
33
+ # [5.16.0-beta.2](https://github.com/webiny/webiny-js/compare/v5.16.0-beta.1...v5.16.0-beta.2) (2021-10-20)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **cli:** add missing workspaces ([9cb126b](https://github.com/webiny/webiny-js/commit/9cb126b5d1183e70d0e0062e60eb856024c58e5a))
39
+
40
+
41
+
42
+
43
+
6
44
  # [5.16.0-beta.1](https://github.com/webiny/webiny-js/compare/v5.16.0-beta.0...v5.16.0-beta.1) (2021-10-19)
7
45
 
8
46
 
@@ -4,15 +4,16 @@
4
4
  */
5
5
  const {
6
6
  prettierFormat,
7
- yarnInstall,
7
+ yarnUp,
8
8
  addWorkspaceToRootPackageJson,
9
9
  removeWorkspaceToRootPackageJson
10
10
  } = require("../utils");
11
11
  const path = require("path");
12
12
  const fs = require("fs");
13
13
  const fsExtra = require("fs-extra");
14
+ const cliPackageJson = require("@webiny/cli/package.json");
14
15
 
15
- const targetVersion = "5.16.0";
16
+ const targetVersion = cliPackageJson.version;
16
17
 
17
18
  const checkFiles = files => {
18
19
  for (const initialFile of files) {
@@ -157,7 +158,7 @@ const assignPackageVersions = (context, initialTargets) => {
157
158
  dependencies[key] = json.dependencies[key];
158
159
  return dependencies;
159
160
  } else if (json.dependencies[key] === "latest") {
160
- dependencies[key] = `^${targetVersion}`;
161
+ dependencies[key] = `${targetVersion}`;
161
162
  } else {
162
163
  dependencies[key] = json.dependencies[key];
163
164
  }
@@ -174,7 +175,7 @@ const assignPackageVersions = (context, initialTargets) => {
174
175
  dependencies[key] = json.devDependencies[key];
175
176
  return dependencies;
176
177
  } else if (json.devDependencies[key] === "latest") {
177
- dependencies[key] = `^${targetVersion}`;
178
+ dependencies[key] = `${targetVersion}`;
178
179
  } else {
179
180
  dependencies[key] = json.devDependencies[key];
180
181
  }
@@ -292,9 +293,10 @@ module.exports = {
292
293
  /**
293
294
  * Update workspaces in root package.json.
294
295
  */
295
- context.info(" Update workspaces in root package.json...");
296
+ context.info("Update workspaces in root package.json...");
296
297
  const rootPackageJson = path.join(context.project.root, "package.json");
297
298
  await addWorkspaceToRootPackageJson(rootPackageJson, [
299
+ "api/code/pageBuilder/updateSettings",
298
300
  "api/code/pageBuilder/importPages/*",
299
301
  "api/code/pageBuilder/exportPages/*"
300
302
  ]);
@@ -306,10 +308,11 @@ module.exports = {
306
308
  );
307
309
 
308
310
  /**
309
- * Install new packages.
311
+ * Up the versions again and install the packages.
310
312
  */
311
- await yarnInstall({
312
- context
313
+ await yarnUp({
314
+ context,
315
+ targetVersion
313
316
  });
314
317
 
315
318
  context.info("\n");
@@ -174,6 +174,26 @@ const yarnInstall = async ({ context }) => {
174
174
  }
175
175
  };
176
176
 
177
+ /**
178
+ * Run to up the versions of all packages.
179
+ */
180
+ const yarnUp = async ({ context, targetVersion }) => {
181
+ const { info, error } = context;
182
+ try {
183
+ info(`Updating all package versions to ${targetVersion}...`);
184
+ await execa(`yarn`, [`up`, `@webiny/*@${targetVersion}`], { cwd: process.cwd() });
185
+ await execa("yarn", { cwd: process.cwd() });
186
+ info("Finished update packages.");
187
+ } catch (ex) {
188
+ error("Updating of the packages failed.");
189
+ console.log(ex);
190
+ console.log(error(ex.message));
191
+ if (ex.stdout) {
192
+ console.log(ex.stdout);
193
+ }
194
+ }
195
+ };
196
+
177
197
  /**
178
198
  *
179
199
  * @param plugins {tsMorph.Node}
@@ -356,6 +376,7 @@ module.exports = {
356
376
  createMorphProject,
357
377
  prettierFormat,
358
378
  yarnInstall,
379
+ yarnUp,
359
380
  addImportsToSource,
360
381
  addWorkspaceToRootPackageJson,
361
382
  removeWorkspaceToRootPackageJson
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/cli",
3
- "version": "5.16.0-beta.1",
3
+ "version": "5.16.0",
4
4
  "main": "index.js",
5
5
  "bin": {
6
6
  "webiny": "./bin.js"
@@ -13,7 +13,7 @@
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.16.0-beta.1",
16
+ "@webiny/telemetry": "5.16.0",
17
17
  "boolean": "3.1.2",
18
18
  "camelcase": "5.3.1",
19
19
  "chalk": "4.1.2",
@@ -36,8 +36,8 @@
36
36
  "yargs": "14.2.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@webiny/handler": "^5.16.0-beta.1",
40
- "@webiny/plugins": "^5.16.0-beta.1"
39
+ "@webiny/handler": "^5.16.0",
40
+ "@webiny/plugins": "^5.16.0"
41
41
  },
42
42
  "license": "MIT",
43
43
  "publishConfig": {
@@ -71,5 +71,5 @@
71
71
  ]
72
72
  }
73
73
  },
74
- "gitHead": "b02057112579ce84543b5fe302f24c7dc18dab94"
74
+ "gitHead": "a31f07d466c5b5ebac53b31deb0a3044b6d3ae4c"
75
75
  }