@rxap/plugin-library 19.3.2-dev.8 → 19.4.0-dev.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,12 @@
|
|
|
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
|
+
# [19.4.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/plugin-library@19.3.2-dev.8...@rxap/plugin-library@19.4.0-dev.0) (2024-07-24)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- support auto version set ([602e045](https://gitlab.com/rxap/packages/commit/602e0454538a5179142b7abebe83d61d7461f61f))
|
|
11
|
+
|
|
6
12
|
## [19.3.2-dev.8](https://gitlab.com/rxap/packages/compare/@rxap/plugin-library@19.3.2-dev.7...@rxap/plugin-library@19.3.2-dev.8) (2024-07-22)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "19.
|
|
2
|
+
"version": "19.4.0-dev.0",
|
|
3
3
|
"name": "@rxap/plugin-library",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
},
|
|
49
49
|
"schematics": "./generators.json",
|
|
50
50
|
"type": "commonjs",
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "8a00f2bd3b9da032f4598640966a466ae27fb808",
|
|
52
52
|
"main": "./src/index.js"
|
|
53
53
|
}
|
|
@@ -9,16 +9,30 @@ const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const init_project_1 = require("../init-with-migrations/init-project");
|
|
11
11
|
const init_workspace_1 = require("../init-with-migrations/init-workspace");
|
|
12
|
+
const semver_1 = require("semver");
|
|
12
13
|
function addMigrationGenerator(tree, options) {
|
|
13
14
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
if (!options.packageVersion && !options.increment) {
|
|
16
|
+
throw new Error('You must provide either a package version or an increment');
|
|
17
|
+
}
|
|
18
|
+
let packageVersion = options.packageVersion;
|
|
19
|
+
if (!packageVersion) {
|
|
20
|
+
const projectPackageJson = (0, workspace_utilities_1.GetProjectPackageJson)(tree, options.project);
|
|
21
|
+
const currentVersion = projectPackageJson.version;
|
|
22
|
+
const normalizedVersion = currentVersion.replace(/-\w+\.\d+/, '');
|
|
23
|
+
packageVersion = (0, semver_1.inc)(normalizedVersion, options.increment);
|
|
24
|
+
if (!packageVersion) {
|
|
25
|
+
throw new Error(`Invalid increment "${options.increment}" for version "${normalizedVersion}"`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
14
28
|
const projectRoot = (0, workspace_utilities_1.GetProjectRoot)(tree, options.project);
|
|
15
|
-
const majorVersion =
|
|
29
|
+
const majorVersion = packageVersion.split('.')[0];
|
|
16
30
|
const migrationRoot = (0, path_1.join)(projectRoot, 'src', 'migrations', `${majorVersion}.0.0`, (0, utilities_1.dasherize)(options.name));
|
|
17
31
|
const generatorOptions = { project: options.project, projects: [options.project] };
|
|
18
32
|
(0, init_workspace_1.initWorkspace)(tree, generatorOptions);
|
|
19
33
|
yield (0, generators_1.migrationGenerator)(tree, {
|
|
20
34
|
name: options.name,
|
|
21
|
-
packageVersion
|
|
35
|
+
packageVersion,
|
|
22
36
|
packageJsonUpdates: options.packageJsonUpdates,
|
|
23
37
|
description: options.description,
|
|
24
38
|
directory: migrationRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/add-migration/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAGoB;AACpB,sDAA2D;AAC3D,+CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/library/src/generators/add-migration/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAGoB;AACpB,sDAA2D;AAC3D,+CAA4C;AAC5C,mEAGmC;AACnC,+BAA4B;AAC5B,uEAAmE;AACnE,2EAAuE;AAEvE,mCAA6B;AAE7B,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAAoC;;QAGpC,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC/E,CAAC;QAED,IAAI,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,kBAAkB,GAAG,IAAA,2CAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACxE,MAAM,cAAc,GAAG,kBAAkB,CAAC,OAAQ,CAAC;YACnD,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YAClE,cAAc,GAAG,IAAA,YAAG,EAAC,iBAAiB,EAAE,OAAO,CAAC,SAAU,CAAE,CAAC;YAC7D,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,sBAAsB,OAAO,CAAC,SAAS,kBAAkB,iBAAiB,GAAG,CAAC,CAAC;YACjG,CAAC;QACH,CAAC;QAED,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,MAAM,EAAE,IAAA,qBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAE7G,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnF,IAAA,8BAAa,EAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAEtC,MAAM,IAAA,+BAAkB,EAAC,IAAI,EAAE;YAC7B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,cAAc;YACd,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;YAC9C,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,SAAS,EAAE,aAAa;YACxB,sBAAsB,EAAE,aAAa;SACtC,CAAC,CAAC;QAEH,IAAA,0BAAW,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAExG,CAAC;CAAA;AAtCD,sDAsCC;AAED,kBAAe,qBAAqB,CAAC"}
|
|
@@ -29,11 +29,16 @@
|
|
|
29
29
|
"type": "boolean",
|
|
30
30
|
"description": "Whether or not to include `package.json` updates.",
|
|
31
31
|
"default": false
|
|
32
|
+
},
|
|
33
|
+
"increment": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"enum": ["major", "minor", "patch"],
|
|
36
|
+
"description": "Increment the version of the package.json file",
|
|
37
|
+
"x-priority": "important"
|
|
32
38
|
}
|
|
33
39
|
},
|
|
34
40
|
"required": [
|
|
35
41
|
"project",
|
|
36
|
-
"name"
|
|
37
|
-
"packageVersion"
|
|
42
|
+
"name"
|
|
38
43
|
]
|
|
39
44
|
}
|