cross-bump 0.1.0-alpha.3 → 0.1.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/dist/index.d.ts +3 -3
- package/dist/index.js +12 -7
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { PathLike } from 'node:fs';
|
|
|
2
2
|
import semver from 'semver';
|
|
3
3
|
export { parse as parseVersion } from 'semver';
|
|
4
4
|
|
|
5
|
-
declare const
|
|
5
|
+
declare const DEFAULT_IGNORED_GLOBS: string[];
|
|
6
6
|
declare const G_GITIGNORE = "**/.gitignore";
|
|
7
|
-
declare function getGitignores(cwd: string): Set<string>;
|
|
7
|
+
declare function getGitignores(cwd: string, ignoreGlobs?: string[]): Set<string>;
|
|
8
8
|
|
|
9
9
|
declare const supportedProjectCategory: readonly ["java", "javascript", "rust"];
|
|
10
10
|
declare const supportedProjectFiles: readonly ["package.json", "pom.xml", "Cargo.toml"];
|
|
@@ -105,4 +105,4 @@ declare function upgradeProjectVersion(nextVersion: string, projectFile?: Projec
|
|
|
105
105
|
declare function getProjectVersion(projectFile: ProjectFile): Promise<string | undefined>;
|
|
106
106
|
declare function isVersionValid(version?: string): boolean;
|
|
107
107
|
|
|
108
|
-
export {
|
|
108
|
+
export { DEFAULT_IGNORED_GLOBS, G_GITIGNORE, type ProjectCategory, type ProjectFile, type ProjectFileName, findProjectFiles, getGitignores, getJSProjectVersion, getJavaProjectVersion, getNextVersions, getProjectVersion, getRustProjectVersion, isBlankPath, isVersionValid, supportedProjectCategory, supportedProjectFiles, supportedProjectGlobs, upgradeCargoVersion, upgradePackageVersion, upgradePomVersion, upgradeProjectVersion };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
// src/ignore.ts
|
|
2
2
|
import fg from "fast-glob";
|
|
3
3
|
import gitignore from "parse-gitignore";
|
|
4
|
-
var
|
|
4
|
+
var DEFAULT_IGNORED_GLOBS = ["**/node_modules/**", "**/.git/**", "**/target/**", "**/build/**", "**/dist/**"];
|
|
5
5
|
var G_GITIGNORE = "**/.gitignore";
|
|
6
|
-
function getGitignores(cwd) {
|
|
7
|
-
const gitignores = fg.sync(G_GITIGNORE, {
|
|
8
|
-
|
|
6
|
+
function getGitignores(cwd, ignoreGlobs = DEFAULT_IGNORED_GLOBS) {
|
|
7
|
+
const gitignores = fg.sync(G_GITIGNORE, {
|
|
8
|
+
absolute: true,
|
|
9
|
+
cwd,
|
|
10
|
+
ignore: ignoreGlobs,
|
|
11
|
+
onlyFiles: true
|
|
12
|
+
});
|
|
13
|
+
const set = /* @__PURE__ */ new Set();
|
|
9
14
|
for (const gi of gitignores) {
|
|
10
15
|
const result = gitignore(gi);
|
|
11
16
|
if (!result?.globs()?.length) continue;
|
|
@@ -150,7 +155,7 @@ function getJSProjectVersion(filePath) {
|
|
|
150
155
|
}
|
|
151
156
|
async function getRustProjectVersion(filePath) {
|
|
152
157
|
const file = fs2.readFileSync(filePath, "utf8");
|
|
153
|
-
await initTomlEdit();
|
|
158
|
+
await initTomlEdit({});
|
|
154
159
|
const { package: cargoPackage } = parse(file);
|
|
155
160
|
if (cargoPackage?.version) {
|
|
156
161
|
return cargoPackage.version;
|
|
@@ -160,7 +165,7 @@ async function upgradeCargoVersion(filePath, version, opts = {}) {
|
|
|
160
165
|
const {
|
|
161
166
|
dry = process.env.DRY
|
|
162
167
|
} = opts;
|
|
163
|
-
await initTomlEdit();
|
|
168
|
+
await initTomlEdit({});
|
|
164
169
|
const cargoFile = fs2.readFileSync(filePath, "utf8");
|
|
165
170
|
const cargoToml = parse(cargoFile);
|
|
166
171
|
let newCargoFile = cargoFile;
|
|
@@ -215,8 +220,8 @@ function isVersionValid(version) {
|
|
|
215
220
|
// src/index.ts
|
|
216
221
|
import { parse as parse2 } from "semver";
|
|
217
222
|
export {
|
|
223
|
+
DEFAULT_IGNORED_GLOBS,
|
|
218
224
|
G_GITIGNORE,
|
|
219
|
-
IGNORE_DEFAULT,
|
|
220
225
|
findProjectFiles,
|
|
221
226
|
getGitignores,
|
|
222
227
|
getJSProjectVersion,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-bump",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"description": "cross language bump utility",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "rainbowatcher",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"./dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@rainbowatcher/toml-edit-js": "^0.2.
|
|
37
|
+
"@rainbowatcher/toml-edit-js": "^0.2.1",
|
|
38
38
|
"cheerio": "1.0.0",
|
|
39
39
|
"detect-indent": "^7.0.1",
|
|
40
40
|
"fast-glob": "^3.3.2",
|