Skip to content

Commit 0fcdf63

Browse files
authored
feat!: bump all (dev)Deps, require node 18+ (#139)
1 parent 955c958 commit 0fcdf63

File tree

11 files changed

+5966
-5532
lines changed

11 files changed

+5966
-5532
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"commit": false,
1010
"linked": [],
11-
"access": "restricted",
11+
"access": "public",
1212
"baseBranch": "main",
1313
"updateInternalDependencies": "patch",
1414
"ignore": []

.changeset/funny-planes-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"changesets-gitlab": minor
3+
---
4+
5+
feat!: bump all (dev)Deps, require node 18+

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout Repo
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: Setup Node.js ${{ matrix.node }}
2121
uses: actions/setup-node@v4
@@ -24,7 +24,7 @@ jobs:
2424
cache: yarn
2525

2626
- name: Install Dependencies
27-
run: yarn --frozen-lockfile --ignore-engines
27+
run: yarn --frozen-lockfile
2828

2929
- name: Build, Lint and Test
3030
run: |

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout Repo
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515
with:
1616
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1717
fetch-depth: 0

.remarkrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"plugins": [
3-
"@1stg/remark-config"
3+
"@1stg/remark-preset"
44
]
55
}

package.json

Lines changed: 27 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,10 @@
44
"type": "module",
55
"repository": "git+https://github.com/rx-ts/changesets-gitlab.git",
66
"author": "JounQin (https://www.1stG.me) <admin@1stg.me>",
7-
"donate": {
8-
"recipients": [
9-
{
10-
"name": "unts",
11-
"platform": "opencollective",
12-
"address": "https://opencollective.com/unts",
13-
"weight": 60
14-
},
15-
{
16-
"name": "rxts",
17-
"platform": "opencollective",
18-
"address": "https://opencollective.com/rxts",
19-
"weight": 20
20-
},
21-
{
22-
"name": "1stG",
23-
"email": "i@1stg.me",
24-
"weight": 20,
25-
"platforms": [
26-
{
27-
"platform": "opencollective",
28-
"address": "https://opencollective.com/1stG"
29-
},
30-
{
31-
"platform": "patreon",
32-
"address": "https://www.patreon.com/1stG"
33-
}
34-
]
35-
}
36-
]
37-
},
387
"funding": "https://opencollective.com/unts",
398
"license": "MIT",
409
"engines": {
41-
"node": "^12.20.0 || ^14.18.0 || >=16.0.0"
10+
"node": ">=18.0.0"
4211
},
4312
"bin": {
4413
"changesets-gitlab": "lib/cli.js"
@@ -69,7 +38,7 @@
6938
"typecov": "type-coverage"
7039
},
7140
"dependencies": {
72-
"@actions/core": "^1.9.0",
41+
"@actions/core": "^1.10.1",
7342
"@actions/exec": "^1.1.1",
7443
"@changesets/assemble-release-plan": "^5.2.4",
7544
"@changesets/config": "^2.3.1",
@@ -79,52 +48,49 @@
7948
"@changesets/read": "^0.5.9",
8049
"@gitbeaker/rest": "^39.23.0",
8150
"@manypkg/get-packages": "^1.1.3",
82-
"@sentry/node": "^7.6.0",
83-
"commander": "^9.3.0",
84-
"dotenv": "^16.0.3",
85-
"fs-extra": "^10.1.0",
51+
"@sentry/node": "^7.80.1",
52+
"commander": "^11.1.0",
53+
"dotenv": "^16.3.1",
54+
"fs-extra": "^11.1.1",
8655
"global-agent": "^3.0.0",
87-
"human-id": "^4.0.0",
56+
"human-id": "^4.1.0",
8857
"js-yaml": "^4.1.0",
8958
"markdown-table": "^3.0.3",
90-
"mdast-util-to-string": "^3.1.0",
59+
"mdast-util-to-string": "^4.0.0",
9160
"micromatch": "^4.0.5",
92-
"remark-parse": "^10.0.2",
93-
"remark-stringify": "^10.0.3",
61+
"remark-parse": "^11.0.0",
62+
"remark-stringify": "^11.0.0",
9463
"resolve-from": "^5.0.0",
9564
"semver": "^7.5.4",
96-
"unified": "^10.1.2"
65+
"unified": "^11.0.4"
9766
},
9867
"devDependencies": {
99-
"@1stg/lib-config": "^8.1.2",
68+
"@1stg/lib-config": "^12.0.0",
10069
"@changesets/changelog-github": "^0.4.8",
10170
"@changesets/cli": "^2.26.2",
102-
"@types/global-agent": "^2.1.2",
103-
"@types/jest": "^28.1.8",
104-
"@types/js-yaml": "^4.0.8",
105-
"@types/micromatch": "^4.0.4",
106-
"jest": "^28.1.3",
107-
"ts-jest": "^28.0.8",
71+
"@types/global-agent": "^2.1.3",
72+
"@types/jest": "^29.5.8",
73+
"@types/js-yaml": "^4.0.9",
74+
"@types/micromatch": "^4.0.5",
75+
"jest": "^29.7.0",
76+
"ts-jest": "^29.1.1",
10877
"ts-node": "^10.9.1",
10978
"type-coverage": "^2.27.0",
110-
"typescript": "^4.7.4",
111-
"yarn-deduplicate": "^5.0.2"
112-
},
113-
"resolutions": {
114-
"prettier": "^2.8.8"
115-
},
116-
"publishConfig": {
117-
"access": "public"
79+
"typescript": "^5.2.2",
80+
"yarn-deduplicate": "^6.0.2"
11881
},
11982
"jest": {
12083
"preset": "ts-jest",
12184
"extensionsToTreatAsEsm": [
12285
".ts"
12386
],
124-
"globals": {
125-
"ts-jest": {
126-
"useESM": true
127-
}
87+
"transform": {
88+
"^.+\\.tsx?$": [
89+
"ts-jest",
90+
{
91+
"useESM": true
92+
}
93+
]
12894
}
12995
},
13096
"typeCoverage": {

src/get-changed-packages.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,7 @@ export const getChangedPackages = async ({
114114
)
115115
}
116116
}
117-
let tool:
118-
| {
119-
tool: Tool
120-
globs: string[]
121-
}
122-
| undefined
117+
let tool: { tool: Tool; globs: string[] } | undefined
123118

124119
if (isPnpm) {
125120
tool = {
@@ -134,16 +129,12 @@ export const getChangedPackages = async ({
134129
const rootPackageJsonContent = await rootPackageJsonContentsPromise
135130

136131
if (rootPackageJsonContent.workspaces) {
137-
// eslint-disable-next-line no-negated-condition
138-
tool = !Array.isArray(rootPackageJsonContent.workspaces)
139-
? {
140-
tool: 'yarn',
141-
globs: rootPackageJsonContent.workspaces.packages,
142-
}
143-
: {
144-
tool: 'yarn',
145-
globs: rootPackageJsonContent.workspaces,
146-
}
132+
tool = {
133+
tool: 'yarn',
134+
globs: Array.isArray(rootPackageJsonContent.workspaces)
135+
? rootPackageJsonContent.workspaces
136+
: rootPackageJsonContent.workspaces.packages,
137+
}
147138
} else if (rootPackageJsonContent.bolt?.workspaces) {
148139
tool = {
149140
tool: 'bolt',
@@ -170,8 +161,8 @@ export const getChangedPackages = async ({
170161
) {
171162
throw new Error('globs are not valid: ' + JSON.stringify(tool.globs))
172163
}
173-
const matches = micromatch(potentialWorkspaceDirectories, tool.globs)
174164

165+
const matches = micromatch(potentialWorkspaceDirectories, tool.globs)
175166
packages.packages = await Promise.all(matches.map(dir => getPackage(dir)))
176167
} else {
177168
packages.packages.push(packages.root)

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,23 @@ export const createApi = (gitlabToken?: string) => {
2929
// we cannot use { [tokenType]: token } now
3030
// because it will break the type of the Gitlab constructor
3131
switch (process.env.GITLAB_TOKEN_TYPE) {
32-
case 'job':
32+
case 'job': {
3333
return new Gitlab({
3434
host,
3535
jobToken: token,
3636
})
37-
case 'oauth':
37+
}
38+
case 'oauth': {
3839
return new Gitlab({
3940
host,
4041
oauthToken: token,
4142
})
42-
default:
43+
}
44+
default: {
4345
return new Gitlab({
4446
host,
4547
token,
4648
})
49+
}
4750
}
4851
}

src/run.ts

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,31 @@ export async function runPublish({
9797
const { packages, tool } = await getPackages(cwd)
9898
const releasedPackages: Package[] = []
9999

100-
// eslint-disable-next-line no-negated-condition -- do not change original source code logic
101-
if (tool !== 'root') {
100+
if (tool === 'root') {
101+
if (packages.length === 0) {
102+
throw new Error(
103+
`No package found.` +
104+
'This is probably a bug in the action, please open an issue',
105+
)
106+
}
107+
const pkg = packages[0]
108+
const newTagRegex = /New tag:/
109+
110+
for (const line of changesetPublishOutput.stdout.split('\n')) {
111+
const match = newTagRegex.exec(line)
112+
113+
if (match) {
114+
releasedPackages.push(pkg)
115+
if (createGitlabReleases) {
116+
await createRelease(api, {
117+
pkg,
118+
tagName: `v${pkg.packageJson.version}`,
119+
})
120+
}
121+
break
122+
}
123+
}
124+
} else {
102125
// eslint-disable-next-line regexp/no-super-linear-backtracking
103126
const newTagRegex = /New tag:\s+(@[^/]+\/[^@]+|[^/]+)@(\S+)/
104127
const packagesByName = new Map(packages.map(x => [x.packageJson.name, x]))
@@ -128,30 +151,6 @@ export async function runPublish({
128151
),
129152
)
130153
}
131-
} else {
132-
if (packages.length === 0) {
133-
throw new Error(
134-
`No package found.` +
135-
'This is probably a bug in the action, please open an issue',
136-
)
137-
}
138-
const pkg = packages[0]
139-
const newTagRegex = /New tag:/
140-
141-
for (const line of changesetPublishOutput.stdout.split('\n')) {
142-
const match = newTagRegex.exec(line)
143-
144-
if (match) {
145-
releasedPackages.push(pkg)
146-
if (createGitlabReleases) {
147-
await createRelease(api, {
148-
pkg,
149-
tagName: `v${pkg.packageJson.version}`,
150-
})
151-
}
152-
break
153-
}
154-
}
155154
}
156155

157156
if (releasedPackages.length > 0) {

test/__snapshots__/utils.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`utils getAllFiles 1`] = `
4-
Array [
4+
[
55
".gitkeep",
66
"dir/.gitkeep",
77
"dir/subdir/.gitkeep",

0 commit comments

Comments
 (0)