@alexaegis/standard-version 0.3.3 → 0.4.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/config/config.d.ts.map +1 -1
- package/index.cjs +3 -6
- package/index.d.ts.map +1 -1
- package/index.js +3 -6
- package/index.spec.d.ts +2 -0
- package/index.spec.d.ts.map +1 -0
- package/package.json +15 -15
- package/readme.md +2 -2
- package/workspace/collect-packages.d.ts.map +1 -1
- package/workspace/generic-updater.d.ts.map +1 -1
- package/workspace/package-json-updater.d.ts.map +1 -1
- package/index.cjs.map +0 -1
- package/index.js.map +0 -1
package/config/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/config/config.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,2BAA2B;;;;;;;;;;;;CA6BvC,CAAC"}
|
package/index.cjs
CHANGED
|
@@ -91,9 +91,8 @@ const normalizePackageJsonWorkspacesField = (packageJsonWorkspaces) => {
|
|
|
91
91
|
const createGenericUpdater = (packages) => {
|
|
92
92
|
return {
|
|
93
93
|
readVersion: (contents) => {
|
|
94
|
-
var _a;
|
|
95
94
|
const results = [...contents.matchAll(/"version": "(.*)"/g)];
|
|
96
|
-
return
|
|
95
|
+
return results[0]?.[1] ?? "0.0.0";
|
|
97
96
|
},
|
|
98
97
|
writeVersion: (contents, version) => {
|
|
99
98
|
return packages.map((localPackage) => localPackage.packageJson.name).filter(common.isNotNullish).reduce(
|
|
@@ -119,9 +118,8 @@ const nonWorkspaceDependencyVersionRegexp = /^(?!workspace:)([\^~])?.*$/g;
|
|
|
119
118
|
const createPackageJsonUpdater = (packages) => {
|
|
120
119
|
return {
|
|
121
120
|
readVersion: (contents) => {
|
|
122
|
-
var _a;
|
|
123
121
|
const results = [...contents.matchAll(/"version": "(.*)"/g)];
|
|
124
|
-
return
|
|
122
|
+
return results[0]?.[1] ?? "0.0.0";
|
|
125
123
|
},
|
|
126
124
|
writeVersion: (contents, version) => {
|
|
127
125
|
const packageJson = JSON.parse(contents);
|
|
@@ -131,7 +129,7 @@ const createPackageJsonUpdater = (packages) => {
|
|
|
131
129
|
for (const localPackageName of packages.map((localPackage) => localPackage.packageJson.name).filter(common.isNotNullish)) {
|
|
132
130
|
for (const dependencyField of PACKAGE_JSON_DEPENDENCY_FIELDS) {
|
|
133
131
|
const dependencies = packageJson[dependencyField];
|
|
134
|
-
const localDependency = dependencies
|
|
132
|
+
const localDependency = dependencies?.[localPackageName];
|
|
135
133
|
if (dependencies && localDependency) {
|
|
136
134
|
dependencies[localPackageName] = localDependency.replaceAll(workspaceDependencyVersionRegexp, "$1$2").replaceAll(nonWorkspaceDependencyVersionRegexp, `$1${version}`);
|
|
137
135
|
}
|
|
@@ -176,4 +174,3 @@ const createStandardVersionConfig = () => {
|
|
|
176
174
|
};
|
|
177
175
|
exports.collectPackages = collectPackages;
|
|
178
176
|
exports.createStandardVersionConfig = createStandardVersionConfig;
|
|
179
|
-
//# sourceMappingURL=index.cjs.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
|
package/index.js
CHANGED
|
@@ -89,9 +89,8 @@ const normalizePackageJsonWorkspacesField = (packageJsonWorkspaces) => {
|
|
|
89
89
|
const createGenericUpdater = (packages) => {
|
|
90
90
|
return {
|
|
91
91
|
readVersion: (contents) => {
|
|
92
|
-
var _a;
|
|
93
92
|
const results = [...contents.matchAll(/"version": "(.*)"/g)];
|
|
94
|
-
return
|
|
93
|
+
return results[0]?.[1] ?? "0.0.0";
|
|
95
94
|
},
|
|
96
95
|
writeVersion: (contents, version) => {
|
|
97
96
|
return packages.map((localPackage) => localPackage.packageJson.name).filter(isNotNullish).reduce(
|
|
@@ -117,9 +116,8 @@ const nonWorkspaceDependencyVersionRegexp = /^(?!workspace:)([\^~])?.*$/g;
|
|
|
117
116
|
const createPackageJsonUpdater = (packages) => {
|
|
118
117
|
return {
|
|
119
118
|
readVersion: (contents) => {
|
|
120
|
-
var _a;
|
|
121
119
|
const results = [...contents.matchAll(/"version": "(.*)"/g)];
|
|
122
|
-
return
|
|
120
|
+
return results[0]?.[1] ?? "0.0.0";
|
|
123
121
|
},
|
|
124
122
|
writeVersion: (contents, version) => {
|
|
125
123
|
const packageJson = JSON.parse(contents);
|
|
@@ -129,7 +127,7 @@ const createPackageJsonUpdater = (packages) => {
|
|
|
129
127
|
for (const localPackageName of packages.map((localPackage) => localPackage.packageJson.name).filter(isNotNullish)) {
|
|
130
128
|
for (const dependencyField of PACKAGE_JSON_DEPENDENCY_FIELDS) {
|
|
131
129
|
const dependencies = packageJson[dependencyField];
|
|
132
|
-
const localDependency = dependencies
|
|
130
|
+
const localDependency = dependencies?.[localPackageName];
|
|
133
131
|
if (dependencies && localDependency) {
|
|
134
132
|
dependencies[localPackageName] = localDependency.replaceAll(workspaceDependencyVersionRegexp, "$1$2").replaceAll(nonWorkspaceDependencyVersionRegexp, `$1${version}`);
|
|
135
133
|
}
|
|
@@ -176,4 +174,3 @@ export {
|
|
|
176
174
|
collectPackages,
|
|
177
175
|
createStandardVersionConfig
|
|
178
176
|
};
|
|
179
|
-
//# sourceMappingURL=index.js.map
|
package/index.spec.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../src/index.spec.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexaegis/standard-version",
|
|
3
3
|
"description": "Standard version",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"archetype": {
|
|
@@ -51,23 +51,23 @@
|
|
|
51
51
|
"./readme": "./readme.md"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@alexaegis/common": "^0.
|
|
55
|
-
"@alexaegis/coverage-tools": "^0.
|
|
56
|
-
"@alexaegis/workspace-tools": "^0.
|
|
57
|
-
"glob": "^10.3.
|
|
54
|
+
"@alexaegis/common": "^0.4.0",
|
|
55
|
+
"@alexaegis/coverage-tools": "^0.4.0",
|
|
56
|
+
"@alexaegis/workspace-tools": "^0.4.0",
|
|
57
|
+
"glob": "^10.3.1",
|
|
58
58
|
"js-yaml": "^4.1.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@alexaegis/eslint-config-vitest": "^0.
|
|
62
|
-
"@alexaegis/ts": "^0.
|
|
63
|
-
"@alexaegis/vite": "^0.
|
|
64
|
-
"@alexaegis/vitest": "^0.
|
|
61
|
+
"@alexaegis/eslint-config-vitest": "^0.4.0",
|
|
62
|
+
"@alexaegis/ts": "^0.4.0",
|
|
63
|
+
"@alexaegis/vite": "^0.4.0",
|
|
64
|
+
"@alexaegis/vitest": "^0.4.0",
|
|
65
65
|
"@types/js-yaml": "^4.0.5",
|
|
66
|
-
"@types/node": "^20.
|
|
67
|
-
"publint": "^0.1.
|
|
68
|
-
"typescript": "^5.1.
|
|
66
|
+
"@types/node": "^20.4.0",
|
|
67
|
+
"publint": "^0.1.16",
|
|
68
|
+
"typescript": "^5.1.6",
|
|
69
69
|
"vite": "^4.3.9",
|
|
70
|
-
"vitest": "^0.32.
|
|
70
|
+
"vitest": "^0.32.4"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "turbo run build-lib_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"lint:es": "turbo run lint:es_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
78
78
|
"lint:es_": "eslint --max-warnings=0 --fix --no-error-on-unmatched-pattern .",
|
|
79
79
|
"lint:format": "turbo run lint:format_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
80
|
-
"lint:format_": "prettier --
|
|
80
|
+
"lint:format_": "prettier --cache-location .cache/prettier --check .",
|
|
81
81
|
"lint:md": "turbo run lint:md_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
82
82
|
"lint:md_": "remark --frail --no-stdout --silently-ignore .",
|
|
83
83
|
"lint:tsc": "turbo run lint:tsc_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"publint_": "publint dist",
|
|
87
87
|
"all": "turbo run all_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
88
88
|
"format": "turbo run format_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
89
|
-
"format_": "prettier --
|
|
89
|
+
"format_": "prettier --cache-location .cache/prettier --write .",
|
|
90
90
|
"test": "turbo run test_ --concurrency 16 --cache-dir .cache/turbo --filter @alexaegis/standard-version",
|
|
91
91
|
"test_": "vitest --passWithNoTests --coverage --run",
|
|
92
92
|
"test:watch": "vitest --passWithNoTests --coverage"
|
package/readme.md
CHANGED
|
@@ -12,13 +12,13 @@ functions had to be reimplemented, albeit in a much simpler form.
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
npm i @alexaegis/standard-version@0.
|
|
15
|
+
npm i @alexaegis/standard-version@0.4.0
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
```json
|
|
19
19
|
{
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@alexaegis/standard-version": "^0.
|
|
21
|
+
"@alexaegis/standard-version": "^0.4.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-packages.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"collect-packages.d.ts","sourceRoot":"","sources":["../../../../src/workspace/collect-packages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkC,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQnG,eAAO,MAAM,8BAA8B,0FAKjC,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;sBACT,gBAAgB;iBACrB,gBAAgB,EAAE;CAyD/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-updater.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"generic-updater.d.ts","sourceRoot":"","sources":["../../../../src/workspace/generic-updater.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,aAAc,gBAAgB,EAAE;4BAEvC,MAAM,KAAG,MAAM;6BAId,MAAM,WAAW,MAAM,KAAG,MAAM;CAuB1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-updater.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"package-json-updater.d.ts","sourceRoot":"","sources":["../../../../src/workspace/package-json-updater.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAOhF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,aAAc,gBAAgB,EAAE;4BAE3C,MAAM,KAAG,MAAM;6BAId,MAAM,WAAW,MAAM,KAAG,MAAM;CA+B1D,CAAC"}
|
package/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/workspace/collect-packages.ts","../src/workspace/generic-updater.ts","../src/workspace/package-json-updater.ts","../src/config/config.ts"],"sourcesContent":["import { isNotNullish } from '@alexaegis/common';\nimport type { PackageJson, PnpmWorkspaceYaml, WorkspacePackage } from '@alexaegis/workspace-tools';\nimport { globSync } from 'glob';\nimport { load } from 'js-yaml';\nimport { existsSync, readFileSync, statSync } from 'node:fs';\nimport { dirname, join, normalize, relative } from 'node:path';\n\nconst PACKAGE_JSON_NAME = 'package.json';\n\nexport const PACKAGE_JSON_DEPENDENCY_FIELDS = [\n\t'dependencies',\n\t'devDependencies',\n\t'optionalDependencies',\n\t'peerDependencies',\n] as const;\n\n/**\n * The functions found in this file are copied from @alexaegis/workspace-tools\n * to be a sync, non-esm (globby is only esm) variant that could be invoked\n * from a CJS based configuration file.\n *\n * ? Once standard-version/commit-and-version is migrated to ESM, this can be removed\n */\nexport const collectPackages = (): {\n\tworkspacePackage: WorkspacePackage;\n\tsubPackages: WorkspacePackage[];\n} => {\n\tconst workspaceRoot = getWorkspaceRoot();\n\n\tif (!workspaceRoot) {\n\t\tthrow new Error('not in a workspace');\n\t}\n\n\tconst pnpmWorkspace = load(\n\t\treadFileSync(join(workspaceRoot, 'pnpm-workspace.yaml'), { encoding: 'utf8' })\n\t) as PnpmWorkspaceYaml;\n\n\tconst workspacePackageJsonPath = join(workspaceRoot, PACKAGE_JSON_NAME);\n\tconst workspacePackageJson = JSON.parse(\n\t\treadFileSync(workspacePackageJsonPath, { encoding: 'utf8' })\n\t) as PackageJson;\n\n\tlet workspaces = normalizePackageJsonWorkspacesField(workspacePackageJson.workspaces);\n\n\tif (pnpmWorkspace.packages) {\n\t\tworkspaces = [...workspaces, ...pnpmWorkspace.packages];\n\t}\n\n\tconst packagePaths = globSync(workspaces, {\n\t\tignore: ['node_modules'],\n\t\tcwd: workspaceRoot,\n\t\tabsolute: true,\n\t}).filter((path) => statSync(path).isDirectory());\n\n\tconst workspacePackage: WorkspacePackage = {\n\t\tpackageKind: 'root',\n\t\tpackagePath: workspaceRoot,\n\t\tpackageJson: workspacePackageJson,\n\t\tpackageJsonPath: workspacePackageJsonPath,\n\t\tworkspacePackagePatterns: workspaces,\n\t\tpackagePathFromRootPackage: '.',\n\t};\n\tconst subPackages: WorkspacePackage[] = packagePaths\n\t\t.map((packagePath) => {\n\t\t\tconst packageJsonPath = join(packagePath, PACKAGE_JSON_NAME);\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tpackageKind: 'regular',\n\t\t\t\t\tpackagePath: packagePath.toString(),\n\t\t\t\t\tpackageJsonPath,\n\t\t\t\t\tpackageJson: JSON.parse(\n\t\t\t\t\t\treadFileSync(packageJsonPath, { encoding: 'utf8' })\n\t\t\t\t\t) as PackageJson,\n\t\t\t\t\tpackagePathFromRootPackage: relative(workspaceRoot, dirname(packageJsonPath)),\n\t\t\t\t} as WorkspacePackage;\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})\n\t\t.filter(isNotNullish);\n\n\treturn { workspacePackage, subPackages };\n};\n\nconst getWorkspaceRoot = (cwd: string = process.cwd()): string | undefined => {\n\treturn collectPackageJsonPathsUpDirectoryTree(cwd)[0];\n};\n\nconst collectPackageJsonPathsUpDirectoryTree = (cwd: string = process.cwd()): string[] => {\n\treturn collectPackageJsonPathsUpDirectoryTreeInternal(cwd);\n};\n\nconst collectPackageJsonPathsUpDirectoryTreeInternal = (\n\tcwd: string,\n\tcollection: string[] = []\n): string[] => {\n\tconst path = normalize(cwd);\n\n\tif (existsSync(join(path, 'package.json'))) {\n\t\tcollection.unshift(path);\n\t}\n\n\tconst parentPath = join(path, '..');\n\tif (parentPath !== path) {\n\t\treturn collectPackageJsonPathsUpDirectoryTreeInternal(parentPath, collection);\n\t}\n\n\treturn collection;\n};\n\nconst normalizePackageJsonWorkspacesField = (\n\tpackageJsonWorkspaces?: PackageJson['workspaces']\n): string[] => {\n\tif (Array.isArray(packageJsonWorkspaces)) {\n\t\treturn packageJsonWorkspaces;\n\t} else if (packageJsonWorkspaces) {\n\t\treturn [\n\t\t\t...(packageJsonWorkspaces.packages ?? []),\n\t\t\t...(packageJsonWorkspaces.nohoist ?? []),\n\t\t];\n\t} else {\n\t\treturn [];\n\t}\n};\n","import { isNotNullish } from '@alexaegis/common';\nimport type { WorkspacePackage } from '@alexaegis/workspace-tools';\n\n/**\n * This updater also updates all local dependencies too that were updated\n * While it's mainly used for packageJson files, it does not assume the file to\n * be valid JSON, so it can be used with any file that contains lines like\n * \"version\": \"0.0.0\", like examples in readme files.\n *\n * It also replaces everything that looks like a `packageName@version`\n */\nexport const createGenericUpdater = (packages: WorkspacePackage[]) => {\n\treturn {\n\t\treadVersion: (contents: string): string => {\n\t\t\tconst results = [...contents.matchAll(/\"version\": \"(.*)\"/g)];\n\t\t\treturn results[0]?.[1] ?? '0.0.0';\n\t\t},\n\t\twriteVersion: (contents: string, version: string): string => {\n\t\t\treturn packages\n\t\t\t\t.map((localPackage) => localPackage.packageJson.name)\n\t\t\t\t.filter(isNotNullish)\n\t\t\t\t.reduce(\n\t\t\t\t\t(r, localPackageName) =>\n\t\t\t\t\t\tr\n\t\t\t\t\t\t\t.replaceAll(\n\t\t\t\t\t\t\t\tnew RegExp(`\"${localPackageName}\": \"(workspace:)([~^])?.*\"`, 'g'),\n\t\t\t\t\t\t\t\t`\"${localPackageName}\": \"$1$2\"` // the workspace protocol does not include versions but keeps the specifier. This is how pnpm leaves them on install.\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.replaceAll(\n\t\t\t\t\t\t\t\tnew RegExp(`\"${localPackageName}\": \"(?!workspace:)([~^])?.*\"`, 'g'),\n\t\t\t\t\t\t\t\t`\"${localPackageName}\": \"$1${version}\"`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.replaceAll(\n\t\t\t\t\t\t\t\tnew RegExp(`${localPackageName}@([^s\\t\\n\\r]+)`, 'g'),\n\t\t\t\t\t\t\t\t`${localPackageName}@${version}`\n\t\t\t\t\t\t\t),\n\t\t\t\t\tcontents.replace(/\"version\": \".*\"/, `\"version\": \"${version}\"`)\n\t\t\t\t);\n\t\t},\n\t};\n};\n","import { isNotNullish } from '@alexaegis/common';\nimport type { PackageJson, WorkspacePackage } from '@alexaegis/workspace-tools';\n\nimport { PACKAGE_JSON_DEPENDENCY_FIELDS } from './collect-packages.js';\n\nconst workspaceDependencyVersionRegexp = /^(workspace:)([\\^~])?.*$/g;\nconst nonWorkspaceDependencyVersionRegexp = /^(?!workspace:)([\\^~])?.*$/g;\n\n/**\n * This updater also updates all local dependencies too that were updated\n * While it's mainly used for packageJson files, it does not assume the file to\n * be valid JSON, so it can be used with any file that contains lines like\n * \"version\": \"0.0.0\", like examples in readme files.\n *\n * It also replaces everything that looks like a `packageName@version`\n */\nexport const createPackageJsonUpdater = (packages: WorkspacePackage[]) => {\n\treturn {\n\t\treadVersion: (contents: string): string => {\n\t\t\tconst results = [...contents.matchAll(/\"version\": \"(.*)\"/g)];\n\t\t\treturn results[0]?.[1] ?? '0.0.0';\n\t\t},\n\t\twriteVersion: (contents: string, version: string): string => {\n\t\t\tconst packageJson: PackageJson = JSON.parse(contents) as PackageJson;\n\t\t\tconst indent = '\\t';\n\t\t\tconst newline = contents.includes('\\r\\n') ? '\\r\\n' : '\\n';\n\t\t\tpackageJson.version = version;\n\n\t\t\tfor (const localPackageName of packages\n\t\t\t\t.map((localPackage) => localPackage.packageJson.name)\n\t\t\t\t.filter(isNotNullish)) {\n\t\t\t\tfor (const dependencyField of PACKAGE_JSON_DEPENDENCY_FIELDS) {\n\t\t\t\t\tconst dependencies = packageJson[dependencyField];\n\n\t\t\t\t\tconst localDependency: string | undefined = dependencies?.[localPackageName];\n\n\t\t\t\t\tif (dependencies && localDependency) {\n\t\t\t\t\t\tdependencies[localPackageName] = localDependency\n\t\t\t\t\t\t\t.replaceAll(workspaceDependencyVersionRegexp, '$1$2')\n\t\t\t\t\t\t\t.replaceAll(nonWorkspaceDependencyVersionRegexp, `$1${version}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst json = JSON.stringify(packageJson, undefined, indent);\n\n\t\t\tif (newline === '\\r\\n') {\n\t\t\t\treturn json.replaceAll('\\n', '\\r\\n') + '\\r\\n';\n\t\t\t}\n\n\t\t\treturn json + '\\n';\n\t\t},\n\t};\n};\n","import { join } from 'node:path';\nimport { collectPackages } from '../workspace/collect-packages.js';\nimport { createGenericUpdater } from '../workspace/generic-updater.js';\nimport { createPackageJsonUpdater } from '../workspace/package-json-updater.js';\n\nexport const createStandardVersionConfig = () => {\n\tconst { workspacePackage, subPackages } = collectPackages();\n\tconst packageJsonUpdater = createPackageJsonUpdater(subPackages);\n\tconst genericUpdater = createGenericUpdater(subPackages);\n\n\treturn {\n\t\tscripts: {\n\t\t\tpostbump: 'pnpm install',\n\t\t\tprechangelog: 'git add pnpm-lock.yaml',\n\t\t},\n\t\tbumpFiles: [\n\t\t\t{\n\t\t\t\tfilename: workspacePackage.packageJsonPath,\n\t\t\t\tupdater: packageJsonUpdater,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfilename: join(workspacePackage.packagePath, 'readme.md'),\n\t\t\t\tupdater: genericUpdater,\n\t\t\t},\n\t\t\t...subPackages.map((pkg) => ({\n\t\t\t\tfilename: pkg.packageJsonPath,\n\t\t\t\tupdater: packageJsonUpdater,\n\t\t\t})),\n\t\t\t...subPackages.map((pkg) => ({\n\t\t\t\tfilename: join(pkg.packagePath, 'readme.md'),\n\t\t\t\tupdater: genericUpdater,\n\t\t\t})),\n\t\t],\n\t};\n};\n"],"names":["load","readFileSync","join","globSync","statSync","relative","dirname","isNotNullish","normalize","existsSync"],"mappings":";;;;;;;AAOA,MAAM,oBAAoB;AAEnB,MAAM,iCAAiC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AASO,MAAM,kBAAkB,MAG1B;AACJ,QAAM,gBAAgB;AAEtB,M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qBAAqB,WAAW;AAEhD,SAAA;AAAA,IACN,SAAS;AAAA,MACR,UAAU;AAAA,MACV,cAAc;AAAA,IACf;AAAA,IACA,WAAW;AAAA,MACV;AAAA,QACC,UAAU,iBAAiB;AAAA,QAC3B,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,UAAUL,UAAA,KAAK,iBAAiB,aAAa,WAAW;AAAA,QACxD,SAAS;AAAA,MACV;AAAA,MACA,GAAG,YAAY,IAAI,CAAC,SAAS;AAAA,QAC5B,UAAU,IAAI;AAAA,QACd,SAAS;AAAA,MAAA,EACR;AAAA,MACF,GAAG,YAAY,IAAI,CAAC,SAAS;AAAA,QAC5B,UAAUA,UAAA,KAAK,IAAI,aAAa,WAAW;AAAA,QAC3C,SAAS;AAAA,MAAA,EACR;AAAA,IACH;AAAA,EAAA;AAEF;;;"}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/workspace/collect-packages.ts","../src/workspace/generic-updater.ts","../src/workspace/package-json-updater.ts","../src/config/config.ts"],"sourcesContent":["import { isNotNullish } from '@alexaegis/common';\nimport type { PackageJson, PnpmWorkspaceYaml, WorkspacePackage } from '@alexaegis/workspace-tools';\nimport { globSync } from 'glob';\nimport { load } from 'js-yaml';\nimport { existsSync, readFileSync, statSync } from 'node:fs';\nimport { dirname, join, normalize, relative } from 'node:path';\n\nconst PACKAGE_JSON_NAME = 'package.json';\n\nexport const PACKAGE_JSON_DEPENDENCY_FIELDS = [\n\t'dependencies',\n\t'devDependencies',\n\t'optionalDependencies',\n\t'peerDependencies',\n] as const;\n\n/**\n * The functions found in this file are copied from @alexaegis/workspace-tools\n * to be a sync, non-esm (globby is only esm) variant that could be invoked\n * from a CJS based configuration file.\n *\n * ? Once standard-version/commit-and-version is migrated to ESM, this can be removed\n */\nexport const collectPackages = (): {\n\tworkspacePackage: WorkspacePackage;\n\tsubPackages: WorkspacePackage[];\n} => {\n\tconst workspaceRoot = getWorkspaceRoot();\n\n\tif (!workspaceRoot) {\n\t\tthrow new Error('not in a workspace');\n\t}\n\n\tconst pnpmWorkspace = load(\n\t\treadFileSync(join(workspaceRoot, 'pnpm-workspace.yaml'), { encoding: 'utf8' })\n\t) as PnpmWorkspaceYaml;\n\n\tconst workspacePackageJsonPath = join(workspaceRoot, PACKAGE_JSON_NAME);\n\tconst workspacePackageJson = JSON.parse(\n\t\treadFileSync(workspacePackageJsonPath, { encoding: 'utf8' })\n\t) as PackageJson;\n\n\tlet workspaces = normalizePackageJsonWorkspacesField(workspacePackageJson.workspaces);\n\n\tif (pnpmWorkspace.packages) {\n\t\tworkspaces = [...workspaces, ...pnpmWorkspace.packages];\n\t}\n\n\tconst packagePaths = globSync(workspaces, {\n\t\tignore: ['node_modules'],\n\t\tcwd: workspaceRoot,\n\t\tabsolute: true,\n\t}).filter((path) => statSync(path).isDirectory());\n\n\tconst workspacePackage: WorkspacePackage = {\n\t\tpackageKind: 'root',\n\t\tpackagePath: workspaceRoot,\n\t\tpackageJson: workspacePackageJson,\n\t\tpackageJsonPath: workspacePackageJsonPath,\n\t\tworkspacePackagePatterns: workspaces,\n\t\tpackagePathFromRootPackage: '.',\n\t};\n\tconst subPackages: WorkspacePackage[] = packagePaths\n\t\t.map((packagePath) => {\n\t\t\tconst packageJsonPath = join(packagePath, PACKAGE_JSON_NAME);\n\t\t\ttry {\n\t\t\t\treturn {\n\t\t\t\t\tpackageKind: 'regular',\n\t\t\t\t\tpackagePath: packagePath.toString(),\n\t\t\t\t\tpackageJsonPath,\n\t\t\t\t\tpackageJson: JSON.parse(\n\t\t\t\t\t\treadFileSync(packageJsonPath, { encoding: 'utf8' })\n\t\t\t\t\t) as PackageJson,\n\t\t\t\t\tpackagePathFromRootPackage: relative(workspaceRoot, dirname(packageJsonPath)),\n\t\t\t\t} as WorkspacePackage;\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})\n\t\t.filter(isNotNullish);\n\n\treturn { workspacePackage, subPackages };\n};\n\nconst getWorkspaceRoot = (cwd: string = process.cwd()): string | undefined => {\n\treturn collectPackageJsonPathsUpDirectoryTree(cwd)[0];\n};\n\nconst collectPackageJsonPathsUpDirectoryTree = (cwd: string = process.cwd()): string[] => {\n\treturn collectPackageJsonPathsUpDirectoryTreeInternal(cwd);\n};\n\nconst collectPackageJsonPathsUpDirectoryTreeInternal = (\n\tcwd: string,\n\tcollection: string[] = []\n): string[] => {\n\tconst path = normalize(cwd);\n\n\tif (existsSync(join(path, 'package.json'))) {\n\t\tcollection.unshift(path);\n\t}\n\n\tconst parentPath = join(path, '..');\n\tif (parentPath !== path) {\n\t\treturn collectPackageJsonPathsUpDirectoryTreeInternal(parentPath, collection);\n\t}\n\n\treturn collection;\n};\n\nconst normalizePackageJsonWorkspacesField = (\n\tpackageJsonWorkspaces?: PackageJson['workspaces']\n): string[] => {\n\tif (Array.isArray(packageJsonWorkspaces)) {\n\t\treturn packageJsonWorkspaces;\n\t} else if (packageJsonWorkspaces) {\n\t\treturn [\n\t\t\t...(packageJsonWorkspaces.packages ?? []),\n\t\t\t...(packageJsonWorkspaces.nohoist ?? []),\n\t\t];\n\t} else {\n\t\treturn [];\n\t}\n};\n","import { isNotNullish } from '@alexaegis/common';\nimport type { WorkspacePackage } from '@alexaegis/workspace-tools';\n\n/**\n * This updater also updates all local dependencies too that were updated\n * While it's mainly used for packageJson files, it does not assume the file to\n * be valid JSON, so it can be used with any file that contains lines like\n * \"version\": \"0.0.0\", like examples in readme files.\n *\n * It also replaces everything that looks like a `packageName@version`\n */\nexport const createGenericUpdater = (packages: WorkspacePackage[]) => {\n\treturn {\n\t\treadVersion: (contents: string): string => {\n\t\t\tconst results = [...contents.matchAll(/\"version\": \"(.*)\"/g)];\n\t\t\treturn results[0]?.[1] ?? '0.0.0';\n\t\t},\n\t\twriteVersion: (contents: string, version: string): string => {\n\t\t\treturn packages\n\t\t\t\t.map((localPackage) => localPackage.packageJson.name)\n\t\t\t\t.filter(isNotNullish)\n\t\t\t\t.reduce(\n\t\t\t\t\t(r, localPackageName) =>\n\t\t\t\t\t\tr\n\t\t\t\t\t\t\t.replaceAll(\n\t\t\t\t\t\t\t\tnew RegExp(`\"${localPackageName}\": \"(workspace:)([~^])?.*\"`, 'g'),\n\t\t\t\t\t\t\t\t`\"${localPackageName}\": \"$1$2\"` // the workspace protocol does not include versions but keeps the specifier. This is how pnpm leaves them on install.\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.replaceAll(\n\t\t\t\t\t\t\t\tnew RegExp(`\"${localPackageName}\": \"(?!workspace:)([~^])?.*\"`, 'g'),\n\t\t\t\t\t\t\t\t`\"${localPackageName}\": \"$1${version}\"`\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.replaceAll(\n\t\t\t\t\t\t\t\tnew RegExp(`${localPackageName}@([^s\\t\\n\\r]+)`, 'g'),\n\t\t\t\t\t\t\t\t`${localPackageName}@${version}`\n\t\t\t\t\t\t\t),\n\t\t\t\t\tcontents.replace(/\"version\": \".*\"/, `\"version\": \"${version}\"`)\n\t\t\t\t);\n\t\t},\n\t};\n};\n","import { isNotNullish } from '@alexaegis/common';\nimport type { PackageJson, WorkspacePackage } from '@alexaegis/workspace-tools';\n\nimport { PACKAGE_JSON_DEPENDENCY_FIELDS } from './collect-packages.js';\n\nconst workspaceDependencyVersionRegexp = /^(workspace:)([\\^~])?.*$/g;\nconst nonWorkspaceDependencyVersionRegexp = /^(?!workspace:)([\\^~])?.*$/g;\n\n/**\n * This updater also updates all local dependencies too that were updated\n * While it's mainly used for packageJson files, it does not assume the file to\n * be valid JSON, so it can be used with any file that contains lines like\n * \"version\": \"0.0.0\", like examples in readme files.\n *\n * It also replaces everything that looks like a `packageName@version`\n */\nexport const createPackageJsonUpdater = (packages: WorkspacePackage[]) => {\n\treturn {\n\t\treadVersion: (contents: string): string => {\n\t\t\tconst results = [...contents.matchAll(/\"version\": \"(.*)\"/g)];\n\t\t\treturn results[0]?.[1] ?? '0.0.0';\n\t\t},\n\t\twriteVersion: (contents: string, version: string): string => {\n\t\t\tconst packageJson: PackageJson = JSON.parse(contents) as PackageJson;\n\t\t\tconst indent = '\\t';\n\t\t\tconst newline = contents.includes('\\r\\n') ? '\\r\\n' : '\\n';\n\t\t\tpackageJson.version = version;\n\n\t\t\tfor (const localPackageName of packages\n\t\t\t\t.map((localPackage) => localPackage.packageJson.name)\n\t\t\t\t.filter(isNotNullish)) {\n\t\t\t\tfor (const dependencyField of PACKAGE_JSON_DEPENDENCY_FIELDS) {\n\t\t\t\t\tconst dependencies = packageJson[dependencyField];\n\n\t\t\t\t\tconst localDependency: string | undefined = dependencies?.[localPackageName];\n\n\t\t\t\t\tif (dependencies && localDependency) {\n\t\t\t\t\t\tdependencies[localPackageName] = localDependency\n\t\t\t\t\t\t\t.replaceAll(workspaceDependencyVersionRegexp, '$1$2')\n\t\t\t\t\t\t\t.replaceAll(nonWorkspaceDependencyVersionRegexp, `$1${version}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst json = JSON.stringify(packageJson, undefined, indent);\n\n\t\t\tif (newline === '\\r\\n') {\n\t\t\t\treturn json.replaceAll('\\n', '\\r\\n') + '\\r\\n';\n\t\t\t}\n\n\t\t\treturn json + '\\n';\n\t\t},\n\t};\n};\n","import { join } from 'node:path';\nimport { collectPackages } from '../workspace/collect-packages.js';\nimport { createGenericUpdater } from '../workspace/generic-updater.js';\nimport { createPackageJsonUpdater } from '../workspace/package-json-updater.js';\n\nexport const createStandardVersionConfig = () => {\n\tconst { workspacePackage, subPackages } = collectPackages();\n\tconst packageJsonUpdater = createPackageJsonUpdater(subPackages);\n\tconst genericUpdater = createGenericUpdater(subPackages);\n\n\treturn {\n\t\tscripts: {\n\t\t\tpostbump: 'pnpm install',\n\t\t\tprechangelog: 'git add pnpm-lock.yaml',\n\t\t},\n\t\tbumpFiles: [\n\t\t\t{\n\t\t\t\tfilename: workspacePackage.packageJsonPath,\n\t\t\t\tupdater: packageJsonUpdater,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfilename: join(workspacePackage.packagePath, 'readme.md'),\n\t\t\t\tupdater: genericUpdater,\n\t\t\t},\n\t\t\t...subPackages.map((pkg) => ({\n\t\t\t\tfilename: pkg.packageJsonPath,\n\t\t\t\tupdater: packageJsonUpdater,\n\t\t\t})),\n\t\t\t...subPackages.map((pkg) => ({\n\t\t\t\tfilename: join(pkg.packagePath, 'readme.md'),\n\t\t\t\tupdater: genericUpdater,\n\t\t\t})),\n\t\t],\n\t};\n};\n"],"names":[],"mappings":";;;;;AAOA,MAAM,oBAAoB;AAEnB,MAAM,iCAAiC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AASO,MAAM,kBAAkB,MAG1B;AACJ,QAAM,gBAAgB;AAEtB,MAAI,CAAC,eAAe;AACb,UAAA,IAAI,MAAM,oBAAoB;AAAA,EACrC;AAEA,QAAM,gBAAgB;AAAA,IACrB,aAAa,KAAK,eAAe,qBAAqB,GAAG,EAAE,UAAU,QAAQ;AAAA,EAAA;AAGxE,QAAA,2BAA2B,KAAK,eAAe,iBAAiB;AACtE,QAAM,uBAAuB,KAAK;AAAA,IACjC,aAAa,0BAA0B,EAAE,UAAU,QAAQ;AAAA,EAAA;AAGxD,MAAA,aAAa,oCAAoC,qBAAqB,UAAU;AAEpF,MAAI,cAAc,UAAU;AAC3B,iBAAa,CAAC,GAAG,YAAY,GAAG,cAAc,QAAQ;AAAA,EACvD;AAEM,QAAA,eAAe,SAAS,YAAY;AAAA,IACzC,QAAQ,CAAC,cAAc;AAAA,IACvB,KAAK;AAAA,IACL,UAAU;AAAA,EAAA,CACV,EAAE,OAAO,CAAC,SAAS,SAAS,IAAI,EAAE,YAAA,CAAa;AAEhD,QAAM,mBAAqC;AAAA,IAC1C,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,0BAA0B;AAAA,IAC1B,4BAA4B;AAAA,EAA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