@common-stack/generate-plugin 6.0.2-alpha.11 → 6.0.2-alpha.12

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,10 @@
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
+ ## [6.0.2-alpha.12](https://github.com/cdmbase/common-stack/compare/v6.0.2-alpha.11...v6.0.2-alpha.12) (2024-08-24)
7
+
8
+ **Note:** Version bump only for package @common-stack/generate-plugin
9
+
6
10
  ## [6.0.2-alpha.11](https://github.com/cdmbase/common-stack/compare/v6.0.2-alpha.10...v6.0.2-alpha.11) (2024-08-23)
7
11
 
8
12
  **Note:** Version bump only for package @common-stack/generate-plugin
@@ -63,6 +63,7 @@
63
63
  "dependencies": {
64
64
  "@apollo/client": "^3.9.0",
65
65
  "@babel/runtime": "^7.20.1",
66
+ "@common-stack/server-stack": "6.0.2-alpha.2",
66
67
  "@remix-run/node": "^2.8.1",
67
68
  "lodash": "^4.17.15",
68
69
  "react": "18.2.0",
@@ -71,6 +72,7 @@
71
72
  },
72
73
  "devDependencies": {
73
74
  "cross-env": "^7.0.3",
75
+ "esbuild-loader": "^4.2.2",
74
76
  "pm2": "^5.2.2",
75
77
  "rimraf": "^3.0.2",
76
78
  "tsx": "^4.7.0"
@@ -1,4 +1,5 @@
1
1
  const fs = require('fs');
2
+ const { exec } = require('child_process');
2
3
 
3
4
  function updateLernaJson(filePath, versionArg) {
4
5
  // Read the existing lerna.json file
@@ -23,18 +24,36 @@ function updateLernaJson(filePath, versionArg) {
23
24
  const minorVersion = versionComponents.length > 1 ? versionComponents[1] : '0';
24
25
  lernaConfig.version = `${majorVersion}.${minorVersion}.0`;
25
26
 
26
- // Update the allowBranch fields
27
- const branchName = `devpublish${majorVersion}${minorVersion !== '0' ? '_' + minorVersion : ''}`;
27
+ // Update the allowBranch fields with dash instead of dot
28
+ const branchName = `devpublish${majorVersion}${minorVersion !== '0' ? '-' + minorVersion : ''}`;
29
+ const branchDevelopName = `develop${majorVersion}${minorVersion !== '0' ? '-' + minorVersion : ''}`;
30
+
28
31
  lernaConfig.command.publish.allowBranch.push(branchName);
29
32
  lernaConfig.command.version.allowBranch.push(branchName);
33
+ lernaConfig.command.version.allowBranch.push(branchDevelopName);
30
34
 
31
35
  // Write the updated lerna.json file
32
- fs.writeFile(filePath, JSON.stringify(lernaConfig, null, 2), 'utf8', writeErr => {
36
+ fs.writeFile(filePath, JSON.stringify(lernaConfig, null, 2), 'utf8', (writeErr) => {
33
37
  if (writeErr) {
34
38
  console.error(`Error writing file: ${writeErr}`);
35
39
  return;
36
40
  }
37
- console.log(`lerna.json updated successfully to version ${lernaConfig.version} with branch ${branchName}`);
41
+ console.log(
42
+ `lerna.json updated successfully to version ${lernaConfig.version} with branches ${branchName} and ${branchDevelopName}`,
43
+ );
44
+
45
+ // Run prettier to format the updated lerna.json file
46
+ exec(`npx prettier --write ${filePath}`, (execErr, stdout, stderr) => {
47
+ if (execErr) {
48
+ console.error(`Error running prettier: ${execErr}`);
49
+ return;
50
+ }
51
+ if (stderr) {
52
+ console.error(`Prettier stderr: ${stderr}`);
53
+ }
54
+ console.log(`Prettier stdout: ${stdout}`);
55
+ console.log('lerna.json formatted successfully.');
56
+ });
38
57
  });
39
58
  });
40
59
  }
@@ -48,4 +67,4 @@ if (!filePath || !versionArg || !versionArg.match(/^v\d+(\.\d+)?$/)) {
48
67
  process.exit(1);
49
68
  }
50
69
 
51
- updateLernaJson(filePath, versionArg);
70
+ updateLernaJson(filePath, versionArg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/generate-plugin",
3
- "version": "6.0.2-alpha.11",
3
+ "version": "6.0.2-alpha.12",
4
4
  "type": "module",
5
5
  "main": "./lib/index.mjs",
6
6
  "typings": "./lib/index.d.ts",
@@ -26,5 +26,5 @@
26
26
  },
27
27
  "executors": "./executors.json",
28
28
  "generators": "./generators.json",
29
- "gitHead": "9f91ac309b8a45339c8ff5e9344092b385be1f7a"
29
+ "gitHead": "442703284b5279b799d8170b26d171ab07206bb0"
30
30
  }
@@ -0,0 +1 @@
1
+ npx lint-staged
@@ -1,4 +1,5 @@
1
1
  const fs = require('fs');
2
+ const { exec } = require('child_process');
2
3
 
3
4
  function updateLernaJson(filePath, versionArg) {
4
5
  // Read the existing lerna.json file
@@ -23,18 +24,36 @@ function updateLernaJson(filePath, versionArg) {
23
24
  const minorVersion = versionComponents.length > 1 ? versionComponents[1] : '0';
24
25
  lernaConfig.version = `${majorVersion}.${minorVersion}.0`;
25
26
 
26
- // Update the allowBranch fields
27
- const branchName = `devpublish${majorVersion}${minorVersion !== '0' ? '_' + minorVersion : ''}`;
27
+ // Update the allowBranch fields with dash instead of dot
28
+ const branchName = `devpublish${majorVersion}${minorVersion !== '0' ? '-' + minorVersion : ''}`;
29
+ const branchDevelopName = `develop${majorVersion}${minorVersion !== '0' ? '-' + minorVersion : ''}`;
30
+
28
31
  lernaConfig.command.publish.allowBranch.push(branchName);
29
32
  lernaConfig.command.version.allowBranch.push(branchName);
33
+ lernaConfig.command.version.allowBranch.push(branchDevelopName);
30
34
 
31
35
  // Write the updated lerna.json file
32
- fs.writeFile(filePath, JSON.stringify(lernaConfig, null, 2), 'utf8', writeErr => {
36
+ fs.writeFile(filePath, JSON.stringify(lernaConfig, null, 2), 'utf8', (writeErr) => {
33
37
  if (writeErr) {
34
38
  console.error(`Error writing file: ${writeErr}`);
35
39
  return;
36
40
  }
37
- console.log(`lerna.json updated successfully to version ${lernaConfig.version} with branch ${branchName}`);
41
+ console.log(
42
+ `lerna.json updated successfully to version ${lernaConfig.version} with branches ${branchName} and ${branchDevelopName}`,
43
+ );
44
+
45
+ // Run prettier to format the updated lerna.json file
46
+ exec(`npx prettier --write ${filePath}`, (execErr, stdout, stderr) => {
47
+ if (execErr) {
48
+ console.error(`Error running prettier: ${execErr}`);
49
+ return;
50
+ }
51
+ if (stderr) {
52
+ console.error(`Prettier stderr: ${stderr}`);
53
+ }
54
+ console.log(`Prettier stdout: ${stdout}`);
55
+ console.log('lerna.json formatted successfully.');
56
+ });
38
57
  });
39
58
  });
40
59
  }
@@ -48,4 +67,4 @@ if (!filePath || !versionArg || !versionArg.match(/^v\d+(\.\d+)?$/)) {
48
67
  process.exit(1);
49
68
  }
50
69
 
51
- updateLernaJson(filePath, versionArg);
70
+ updateLernaJson(filePath, versionArg);