@ckeditor/ckeditor5-dev-release-tools 44.1.1 → 44.2.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/lib/index.js CHANGED
@@ -20,6 +20,7 @@ export {
20
20
  getNextPreRelease,
21
21
  getLastNightly,
22
22
  getNextNightly,
23
+ getNextInternal,
23
24
  getCurrent,
24
25
  getLastTagFromGit
25
26
  } from './utils/versions.js';
@@ -93,16 +93,24 @@ export async function getNextPreRelease( releaseIdentifier, cwd = process.cwd()
93
93
  * @returns {Promise<string>}
94
94
  */
95
95
  export async function getNextNightly( cwd = process.cwd() ) {
96
- const today = new Date();
97
- const year = today.getFullYear().toString();
98
- const month = ( today.getMonth() + 1 ).toString().padStart( 2, '0' );
99
- const day = today.getDate().toString().padStart( 2, '0' );
100
-
101
- const nextNightlyReleaseIdentifier = `0.0.0-nightly-${ year }${ month }${ day }`;
96
+ const nextNightlyReleaseIdentifier = `0.0.0-nightly-${ getDateIdentifier() }`;
102
97
 
103
98
  return getNextPreRelease( nextNightlyReleaseIdentifier, cwd );
104
99
  }
105
100
 
101
+ /**
102
+ * Returns the next available internal version in the format of "0.0.0-internal-YYYYMMDD.X", where the "YYYYMMDD" is the current date for
103
+ * the internal release and the "X" is the sequential number starting from 0.
104
+ *
105
+ * @param {string} [cwd=process.cwd()]
106
+ * @returns {Promise<string>}
107
+ */
108
+ export async function getNextInternal( cwd = process.cwd() ) {
109
+ const nextInternalReleaseIdentifier = `0.0.0-internal-${ getDateIdentifier() }`;
110
+
111
+ return getNextPreRelease( nextInternalReleaseIdentifier, cwd );
112
+ }
113
+
106
114
  /**
107
115
  * Returns a name of the last created tag.
108
116
  *
@@ -129,6 +137,18 @@ export function getCurrent( cwd = process.cwd() ) {
129
137
  return getPackageJson( cwd ).version;
130
138
  }
131
139
 
140
+ /**
141
+ * @returns {string}
142
+ */
143
+ function getDateIdentifier() {
144
+ const today = new Date();
145
+ const year = today.getFullYear().toString();
146
+ const month = ( today.getMonth() + 1 ).toString().padStart( 2, '0' );
147
+ const day = today.getDate().toString().padStart( 2, '0' );
148
+
149
+ return `${ year }${ month }${ day }`;
150
+ }
151
+
132
152
  /**
133
153
  * @typedef {string} ReleaseIdentifier The pre-release identifier without the last dynamic part (the pre-release sequential number).
134
154
  * It consists of the core base version ("<major>.<minor>.<path>"), a hyphen ("-"), and a pre-release identifier name (e.g. "alpha").
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-dev-release-tools",
3
- "version": "44.1.1",
3
+ "version": "44.2.0",
4
4
  "description": "Tools used for releasing CKEditor 5 and related packages.",
5
5
  "keywords": [],
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -22,7 +22,7 @@
22
22
  "lib"
23
23
  ],
24
24
  "dependencies": {
25
- "@ckeditor/ckeditor5-dev-utils": "^44.1.1",
25
+ "@ckeditor/ckeditor5-dev-utils": "^44.2.0",
26
26
  "@octokit/rest": "^21.0.0",
27
27
  "chalk": "^5.0.0",
28
28
  "cli-columns": "^4.0.0",