@x-wp/semantic-release-config 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/cli +3 -0
- package/dist/config/branches.config.d.ts +4 -0
- package/dist/config/branches.config.js +11 -0
- package/dist/config/branches.config.js.map +1 -0
- package/dist/config/commit-analyzer.config.d.ts +13 -0
- package/dist/config/commit-analyzer.config.js +32 -0
- package/dist/config/commit-analyzer.config.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/{enums → config}/index.js +3 -1
- package/dist/config/index.js.map +1 -0
- package/dist/config/release-notes-generator.config.d.ts +10 -0
- package/dist/config/release-notes-generator.config.js +46 -0
- package/dist/config/release-notes-generator.config.js.map +1 -0
- package/dist/functions/create-config.fn.d.ts +1 -0
- package/dist/functions/create-config.fn.js +8 -0
- package/dist/functions/create-config.fn.js.map +1 -0
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/index.js +1 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces/semantic-wp-config.interface.d.ts +1 -1
- package/dist/interfaces/wp-release-config.interface.d.ts +7 -5
- package/dist/main.d.ts +1 -0
- package/dist/main.js +12 -0
- package/dist/main.js.map +1 -0
- package/dist/services/generator.service.d.ts +7 -5
- package/dist/services/generator.service.js +101 -48
- package/dist/services/generator.service.js.map +1 -1
- package/package.json +7 -4
- package/dist/enums/index.d.ts +0 -1
- package/dist/enums/index.js.map +0 -1
- package/dist/enums/package-type.enum.d.ts +0 -4
- package/dist/enums/package-type.enum.js +0 -9
- package/dist/enums/package-type.enum.js.map +0 -1
- package/dist/functions/generate-config.fn.d.ts +0 -2
- package/dist/functions/generate-config.fn.js +0 -43
- package/dist/functions/generate-config.fn.js.map +0 -1
package/bin/cli
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"branches.config.js","sourceRoot":"","sources":["../../lib/config/branches.config.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,QAAQ;IACR;QACE,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,IAAI;KACjB;CACF,CAAC"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.commitAnalyzer = void 0;
|
4
|
+
exports.commitAnalyzer = {
|
5
|
+
preset: 'conventionalcommits',
|
6
|
+
releaseRules: [
|
7
|
+
{
|
8
|
+
type: 'chore',
|
9
|
+
release: false,
|
10
|
+
},
|
11
|
+
{
|
12
|
+
type: 'perf',
|
13
|
+
release: 'patch',
|
14
|
+
},
|
15
|
+
{
|
16
|
+
type: 'compat',
|
17
|
+
release: 'patch',
|
18
|
+
},
|
19
|
+
{
|
20
|
+
type: 'refactor',
|
21
|
+
release: 'patch',
|
22
|
+
},
|
23
|
+
{
|
24
|
+
type: 'style',
|
25
|
+
release: 'patch',
|
26
|
+
},
|
27
|
+
],
|
28
|
+
parserOpts: {
|
29
|
+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
|
30
|
+
},
|
31
|
+
};
|
32
|
+
//# sourceMappingURL=commit-analyzer.config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"commit-analyzer.config.js","sourceRoot":"","sources":["../../lib/config/commit-analyzer.config.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,qBAAqB;IAC7B,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;SACf;QACD;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,OAAO;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO;SACjB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,OAAO;SACjB;QACD;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,OAAO;SACjB;KACF;IACD,UAAU,EAAE;QACV,YAAY,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;KACtD;CACF,CAAC"}
|
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./
|
17
|
+
__exportStar(require("./branches.config"), exports);
|
18
|
+
__exportStar(require("./commit-analyzer.config"), exports);
|
19
|
+
__exportStar(require("./release-notes-generator.config"), exports);
|
18
20
|
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,2DAAyC;AACzC,mEAAiD"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.releaseNotesGenerator = void 0;
|
4
|
+
exports.releaseNotesGenerator = {
|
5
|
+
preset: 'conventionalcommits',
|
6
|
+
presetConfig: {
|
7
|
+
types: [
|
8
|
+
{
|
9
|
+
type: 'feat',
|
10
|
+
section: ':sparkles: Features',
|
11
|
+
hidden: false,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
type: 'fix',
|
15
|
+
section: ':bug: Bug Fixes',
|
16
|
+
hidden: false,
|
17
|
+
},
|
18
|
+
{
|
19
|
+
type: 'compat',
|
20
|
+
section: ':gear: Compatibility',
|
21
|
+
hidden: false,
|
22
|
+
},
|
23
|
+
{
|
24
|
+
type: 'refactor',
|
25
|
+
section: ':recycle: Refactor',
|
26
|
+
hidden: false,
|
27
|
+
},
|
28
|
+
{
|
29
|
+
type: 'style',
|
30
|
+
section: ':art: Code style',
|
31
|
+
hidden: false,
|
32
|
+
},
|
33
|
+
{
|
34
|
+
type: 'perf',
|
35
|
+
section: ':rocket: Performance',
|
36
|
+
hidden: false,
|
37
|
+
},
|
38
|
+
{
|
39
|
+
type: 'chore',
|
40
|
+
section: ':wrench: Maintenance',
|
41
|
+
hidden: false,
|
42
|
+
},
|
43
|
+
],
|
44
|
+
},
|
45
|
+
};
|
46
|
+
//# sourceMappingURL=release-notes-generator.config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"release-notes-generator.config.js","sourceRoot":"","sources":["../../lib/config/release-notes-generator.config.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG;IACnC,MAAM,EAAE,qBAAqB;IAC7B,YAAY,EAAE;QACZ,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,qBAAqB;gBAC9B,MAAM,EAAE,KAAK;aACd;YACD;gBACE,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,iBAAiB;gBAC1B,MAAM,EAAE,KAAK;aACd;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,KAAK;aACd;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,oBAAoB;gBAC7B,MAAM,EAAE,KAAK;aACd;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,kBAAkB;gBAC3B,MAAM,EAAE,KAAK;aACd;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,KAAK;aACd;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,KAAK;aACd;SACF;KACF;CACF,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function createConfig(composer: string, release: string): void;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createConfig = createConfig;
|
4
|
+
const services_1 = require("../services");
|
5
|
+
function createConfig(composer, release) {
|
6
|
+
new services_1.Generator().parse(composer).create().write(release);
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=create-config.fn.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"create-config.fn.js","sourceRoot":"","sources":["../../lib/functions/create-config.fn.ts"],"names":[],"mappings":";;AAEA,oCAEC;AAJD,0CAAwC;AAExC,SAAgB,YAAY,CAAC,QAAgB,EAAE,OAAe;IAC5D,IAAI,oBAAS,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1D,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
export * from './
|
1
|
+
export * from './create-config.fn';
|
package/dist/functions/index.js
CHANGED
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./
|
17
|
+
__exportStar(require("./create-config.fn"), exports);
|
18
18
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { createConfig } from './functions/create-config.fn';
|
2
2
|
import { SemanticWpConfig, WpReleaseConfig } from './interfaces';
|
3
|
-
|
4
|
-
export
|
5
|
-
export default generateConfig;
|
3
|
+
export { SemanticWpConfig, WpReleaseConfig };
|
4
|
+
export default createConfig;
|
package/dist/index.js
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
4
|
-
|
5
|
-
const enums_1 = require("./enums");
|
6
|
-
Object.defineProperty(exports, "PackageType", { enumerable: true, get: function () { return enums_1.PackageType; } });
|
7
|
-
exports.default = generate_config_fn_1.generateConfig;
|
3
|
+
const create_config_fn_1 = require("./functions/create-config.fn");
|
4
|
+
exports.default = create_config_fn_1.createConfig;
|
8
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;AAAA,mEAA4D;AAI5D,kBAAe,+BAAY,CAAC"}
|
@@ -1,15 +1,17 @@
|
|
1
1
|
import type { BranchSpec } from 'semantic-release';
|
2
|
-
import { PackageType } from '../enums/package-type.enum';
|
3
2
|
import { PluginConfig } from '@semantic-release/wordpress/dist/classes/plugin-config.class';
|
4
3
|
export interface WpReleaseConfig {
|
5
4
|
branches: BranchSpec[];
|
6
|
-
|
5
|
+
commitMsgOpts?: {
|
7
6
|
[key: string]: unknown;
|
8
7
|
};
|
9
|
-
|
8
|
+
releaseNoteOpts?: {
|
9
|
+
[key: string]: unknown;
|
10
|
+
};
|
11
|
+
type: 'plugin' | 'theme';
|
10
12
|
name: string;
|
11
13
|
slug: string;
|
12
|
-
changelog?:
|
13
|
-
|
14
|
+
changelog?: boolean | string;
|
15
|
+
ghAsset?: boolean;
|
14
16
|
wp: Partial<PluginConfig>;
|
15
17
|
}
|
package/dist/main.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/dist/main.js
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const commander_1 = require("commander");
|
4
|
+
const functions_1 = require("./functions");
|
5
|
+
const { composer, release } = new commander_1.Command()
|
6
|
+
.enablePositionalOptions()
|
7
|
+
.option('-c, --composer [composer]', 'Path to the composer.json file', 'composer.json')
|
8
|
+
.option('-r, --release [release]', 'Release file', '.releaserc')
|
9
|
+
.parse()
|
10
|
+
.opts();
|
11
|
+
(0, functions_1.createConfig)(composer, release);
|
12
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,2CAA2C;AAE3C,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,mBAAO,EAAE;KACxC,uBAAuB,EAAE;KACzB,MAAM,CACL,2BAA2B,EAC3B,gCAAgC,EAChC,eAAe,CAChB;KACA,MAAM,CAAC,yBAAyB,EAAE,cAAc,EAAE,YAAY,CAAC;KAC/D,KAAK,EAAE;KACP,IAAI,EAAE,CAAC;AAEV,IAAA,wBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC"}
|
@@ -1,9 +1,11 @@
|
|
1
|
-
import { SemanticWpConfig
|
1
|
+
import { SemanticWpConfig } from '../interfaces';
|
2
2
|
export declare class Generator {
|
3
|
-
private
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
private composerJSON;
|
4
|
+
private releaseRC;
|
5
|
+
parse(composerFile: string): this;
|
6
|
+
create(): this;
|
7
|
+
write(releaseFile: string): void;
|
8
|
+
get(): SemanticWpConfig;
|
7
9
|
private deslugify;
|
8
10
|
private pathExists;
|
9
11
|
}
|
@@ -1,4 +1,37 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
37
|
};
|
@@ -6,32 +39,70 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.Generator = void 0;
|
7
40
|
const node_path_1 = __importDefault(require("node:path"));
|
8
41
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
42
|
+
const Default = __importStar(require("../config"));
|
9
43
|
class Generator {
|
10
|
-
|
11
|
-
|
12
|
-
|
44
|
+
composerJSON;
|
45
|
+
releaseRC;
|
46
|
+
parse(composerFile) {
|
47
|
+
composerFile = node_path_1.default.posix.resolve(composerFile);
|
48
|
+
const cfg = fs_extra_1.default.readJSONSync(composerFile)?.extra?.release ?? {};
|
49
|
+
cfg.slug = cfg?.slug || node_path_1.default.basename(composerFile);
|
50
|
+
cfg.name = cfg?.name || this.deslugify(cfg.slug);
|
51
|
+
cfg.changelog = cfg?.changelog ?? false;
|
52
|
+
cfg.wp = cfg.wp ?? {};
|
53
|
+
cfg.wp.path = cfg.wp?.path ?? './';
|
54
|
+
if (typeof cfg.changelog !== 'string' && cfg.changelog !== false) {
|
55
|
+
cfg.changelog = 'CHANGELOG.md';
|
56
|
+
}
|
57
|
+
this.composerJSON = {
|
58
|
+
name: cfg.name,
|
59
|
+
slug: cfg.slug,
|
60
|
+
branches: cfg.branches ?? Default.branches,
|
61
|
+
changelog: cfg.changelog,
|
62
|
+
ghAsset: cfg?.ghAsset ?? true,
|
63
|
+
commitMsgOpts: cfg?.commitMsgOpts ?? Default.commitAnalyzer,
|
64
|
+
releaseNoteOpts: cfg?.releaseNoteOpts ?? Default.releaseNotesGenerator,
|
65
|
+
wp: {
|
66
|
+
slug: cfg.slug,
|
67
|
+
type: cfg?.type ?? 'plugin',
|
68
|
+
path: cfg.wp.path,
|
69
|
+
withAssets: cfg.wp?.withAssets ??
|
70
|
+
this.pathExists(cfg.wp.path, '.wordpress-org', 'assets'),
|
71
|
+
withReadme: cfg.wp?.withReadme ??
|
72
|
+
this.pathExists(cfg.wp.path, '.wordpress-org', 'readme.txt'),
|
73
|
+
withVersionFile: cfg.wp?.withVersionFile ?? true,
|
74
|
+
versionFiles: cfg.wp?.versionFiles ?? [],
|
75
|
+
include: cfg.wp?.include ?? undefined,
|
76
|
+
exclude: cfg.wp?.exclude ?? undefined,
|
77
|
+
releasePath: cfg.wp?.releasePath ?? '/tmp/wp-release',
|
78
|
+
},
|
79
|
+
};
|
80
|
+
return this;
|
13
81
|
}
|
14
|
-
|
15
|
-
const { wp, branches, ...cfg } = this.
|
16
|
-
|
17
|
-
branches
|
82
|
+
create() {
|
83
|
+
const { wp, branches, ...cfg } = this.composerJSON;
|
84
|
+
this.releaseRC = {
|
85
|
+
branches,
|
18
86
|
plugins: [],
|
19
87
|
};
|
20
88
|
if (cfg.changelog !== false) {
|
21
|
-
|
89
|
+
this.releaseRC.plugins.push([
|
22
90
|
'@semantic-release/changelog',
|
23
91
|
{
|
24
92
|
changelogFile: cfg.changelog,
|
25
93
|
},
|
26
94
|
]);
|
27
95
|
}
|
28
|
-
|
96
|
+
this.releaseRC.plugins.push([
|
29
97
|
'@semantic-release/commit-analyzer',
|
30
|
-
cfg.
|
98
|
+
cfg.commitMsgOpts,
|
99
|
+
]);
|
100
|
+
this.releaseRC.plugins.push([
|
101
|
+
'@semantic-release/release-notes-generator',
|
102
|
+
cfg.releaseNoteOpts,
|
31
103
|
]);
|
32
|
-
srConfig.plugins.push('@semantic-release/release-notes-generator');
|
33
104
|
if (cfg.changelog !== false) {
|
34
|
-
|
105
|
+
this.releaseRC.plugins.push([
|
35
106
|
'@semantic-release/git',
|
36
107
|
{
|
37
108
|
assets: [cfg.changelog],
|
@@ -39,59 +110,41 @@ class Generator {
|
|
39
110
|
},
|
40
111
|
]);
|
41
112
|
}
|
42
|
-
|
43
|
-
const assetName =
|
44
|
-
const assetLabel =
|
113
|
+
this.releaseRC.plugins.push(['@semantic-release/wordpress', wp]);
|
114
|
+
const assetName = wp.type === 'plugin' ? cfg.slug : `${cfg.slug}-theme`;
|
115
|
+
const assetLabel = wp.type === 'plugin' ? cfg.name : `${cfg.name} Theme`;
|
45
116
|
const ghAssets = [
|
46
117
|
{
|
47
118
|
path: node_path_1.default.join(wp.releasePath, 'package.zip'),
|
48
119
|
label: assetLabel + ' v${nextRelease.version}',
|
49
|
-
name: assetName + '
|
120
|
+
name: assetName + '-v${nextRelease.version}.zip',
|
50
121
|
},
|
51
122
|
];
|
52
123
|
if (wp.withAssets) {
|
53
124
|
ghAssets.push({
|
54
125
|
path: node_path_1.default.join(wp.releasePath, 'assets.zip'),
|
55
126
|
label: assetLabel + ' Assets v${nextRelease.version}',
|
56
|
-
name: assetName + '-assets
|
127
|
+
name: assetName + '-assets-v${nextRelease.version}.zip',
|
57
128
|
});
|
58
129
|
}
|
59
|
-
|
130
|
+
this.releaseRC.plugins.push([
|
60
131
|
'@semantic-release/github',
|
61
132
|
{
|
62
133
|
assets: ghAssets,
|
63
134
|
},
|
64
135
|
]);
|
65
|
-
|
66
|
-
return srConfig;
|
136
|
+
return this;
|
67
137
|
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
slug: slug,
|
79
|
-
branches: config.branches || def.branches,
|
80
|
-
type: config.type || def.type,
|
81
|
-
changelog: changelog,
|
82
|
-
releaseAsset: config.releaseAsset || def.releaseAsset,
|
83
|
-
commitOpts: config.commitOpts || def.commitOpts,
|
84
|
-
wp: {
|
85
|
-
slug: slug,
|
86
|
-
withAssets: wp?.withAssets || this.pathExists('.wordpress-org', 'assets'),
|
87
|
-
withReadme: wp?.withReadme || this.pathExists('.wordpress-org', 'readme.txt'),
|
88
|
-
withVersionFile: wp?.withVersionFile || def.wp.withVersionFile,
|
89
|
-
versionFiles: wp?.versionFiles || def.wp.versionFiles,
|
90
|
-
include: wp?.include || def.wp.include,
|
91
|
-
exclude: wp?.exclude || def.wp.exclude,
|
92
|
-
releasePath: wp?.releasePath || def.wp.releasePath,
|
93
|
-
},
|
94
|
-
};
|
138
|
+
write(releaseFile) {
|
139
|
+
releaseFile = node_path_1.default.posix.resolve(releaseFile);
|
140
|
+
fs_extra_1.default.writeJSONSync(releaseFile, this.releaseRC, {
|
141
|
+
encoding: 'utf-8',
|
142
|
+
spaces: 2,
|
143
|
+
flag: 'w',
|
144
|
+
});
|
145
|
+
}
|
146
|
+
get() {
|
147
|
+
return this.releaseRC;
|
95
148
|
}
|
96
149
|
deslugify(slug) {
|
97
150
|
return slug
|
@@ -100,7 +153,7 @@ class Generator {
|
|
100
153
|
.join(' ');
|
101
154
|
}
|
102
155
|
pathExists(...filePath) {
|
103
|
-
return fs_extra_1.default.existsSync(node_path_1.default.posix.resolve(
|
156
|
+
return fs_extra_1.default.existsSync(node_path_1.default.posix.resolve(...filePath));
|
104
157
|
}
|
105
158
|
}
|
106
159
|
exports.Generator = Generator;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generator.service.js","sourceRoot":"","sources":["../../lib/services/generator.service.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"generator.service.js","sourceRoot":"","sources":["../../lib/services/generator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0DAA6B;AAC7B,wDAA0B;AAC1B,mDAAqC;AAGrC,MAAa,SAAS;IACZ,YAAY,CAAiC;IAC7C,SAAS,CAAoB;IAErC,KAAK,CAAC,YAAoB;QACxB,YAAY,GAAG,mBAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAChD,MAAM,GAAG,GACP,kBAAE,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC;QAEtD,GAAG,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,IAAI,mBAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QACpD,GAAG,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEjD,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,SAAS,IAAI,KAAK,CAAC;QACxC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;QACtB,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,EAAE,IAAI,IAAI,IAAI,CAAC;QAEnC,IAAI,OAAO,GAA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CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;aACzE,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAEO,UAAU,CAAC,GAAG,QAAkB;QACtC,OAAO,kBAAE,CAAC,UAAU,CAAC,mBAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IACxD,CAAC;CACF;AA7ID,8BA6IC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@x-wp/semantic-release-config",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.4.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "Sibin Grasic <sibin.grasic@oblak.studio> (https://oblak.studio)",
|
6
6
|
"contributors": [],
|
@@ -21,13 +21,15 @@
|
|
21
21
|
"engines": {
|
22
22
|
"node": ">= 18"
|
23
23
|
},
|
24
|
+
"bin": "./bin/cli",
|
24
25
|
"main": "dist/index.js",
|
25
26
|
"types": "dist/index.d.ts",
|
26
27
|
"dependencies": {
|
28
|
+
"commander": "^12.1.0",
|
27
29
|
"fs-extra": "^11.2.0"
|
28
30
|
},
|
29
31
|
"devDependencies": {
|
30
|
-
"@semantic-release/wordpress": "^1.6.
|
32
|
+
"@semantic-release/wordpress": "^1.6.6",
|
31
33
|
"@types/fs-extra": "^11.0.4",
|
32
34
|
"@types/jest": "^29.5.3",
|
33
35
|
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
@@ -38,9 +40,10 @@
|
|
38
40
|
"jest": "^29.6.2",
|
39
41
|
"prettier": "^3.0.0",
|
40
42
|
"rimraf": "^5.0.1",
|
41
|
-
"semantic-release": "^
|
43
|
+
"semantic-release": "^24.1.1",
|
42
44
|
"ts-jest": "^29.1.1",
|
43
|
-
"
|
45
|
+
"ts-node": "^10.9.2",
|
46
|
+
"typescript": "^5.7.2"
|
44
47
|
},
|
45
48
|
"publishConfig": {
|
46
49
|
"access": "public",
|
package/dist/enums/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './package-type.enum';
|
package/dist/enums/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.PackageType = void 0;
|
4
|
-
var PackageType;
|
5
|
-
(function (PackageType) {
|
6
|
-
PackageType["Plugin"] = "plugin";
|
7
|
-
PackageType["Theme"] = "theme";
|
8
|
-
})(PackageType || (exports.PackageType = PackageType = {}));
|
9
|
-
//# sourceMappingURL=package-type.enum.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"package-type.enum.js","sourceRoot":"","sources":["../../lib/enums/package-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB"}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generateConfig = void 0;
|
4
|
-
const enums_1 = require("../enums");
|
5
|
-
const services_1 = require("../services");
|
6
|
-
const defaults = {
|
7
|
-
branches: [
|
8
|
-
'master',
|
9
|
-
{
|
10
|
-
name: 'alpha',
|
11
|
-
prerelease: true,
|
12
|
-
},
|
13
|
-
{
|
14
|
-
name: 'beta',
|
15
|
-
prerelease: true,
|
16
|
-
},
|
17
|
-
],
|
18
|
-
commitOpts: {
|
19
|
-
preset: 'angular',
|
20
|
-
releaseRules: [
|
21
|
-
{ type: 'refactor', release: 'patch' },
|
22
|
-
{ type: 'style', release: 'patch' },
|
23
|
-
],
|
24
|
-
parserOpts: {
|
25
|
-
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
|
26
|
-
},
|
27
|
-
},
|
28
|
-
type: enums_1.PackageType.Plugin,
|
29
|
-
changelog: false,
|
30
|
-
releaseAsset: true,
|
31
|
-
wp: {
|
32
|
-
withVersionFile: true,
|
33
|
-
releasePath: '/tmp/wp-release',
|
34
|
-
versionFiles: [],
|
35
|
-
include: undefined,
|
36
|
-
exclude: undefined,
|
37
|
-
},
|
38
|
-
};
|
39
|
-
function generateConfig(config) {
|
40
|
-
return new services_1.Generator(defaults).generate(config);
|
41
|
-
}
|
42
|
-
exports.generateConfig = generateConfig;
|
43
|
-
//# sourceMappingURL=generate-config.fn.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generate-config.fn.js","sourceRoot":"","sources":["../../lib/functions/generate-config.fn.ts"],"names":[],"mappings":";;;AAAA,oCAAuC;AAEvC,0CAAwC;AAExC,MAAM,QAAQ,GAA2C;IACvD,QAAQ,EAAE;QACR,QAAQ;QACR;YACE,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,IAAI;SACjB;QACD;YACE,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,IAAI;SACjB;KACF;IACD,UAAU,EAAE;QACV,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE;YACZ,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE;YACtC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE;SACpC;QACD,UAAU,EAAE;YACV,YAAY,EAAE,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;SACtD;KACF;IACD,IAAI,EAAE,mBAAW,CAAC,MAAM;IACxB,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,IAAI;IAClB,EAAE,EAAE;QACF,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,iBAAiB;QAC9B,YAAY,EAAE,EAAE;QAChB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;KACnB;CACF,CAAC;AAEF,SAAgB,cAAc,CAC5B,MAAgC;IAEhC,OAAO,IAAI,oBAAS,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAJD,wCAIC"}
|