Skip to content

Commit 8d92063

Browse files
fix: lock file maintenance (#170)
BREAKING CHANGE: node.js >= 18
1 parent 80d0b9a commit 8d92063

12 files changed

+2017
-2081
lines changed

.github/workflows/build.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
needs: test
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
with:
1515
lfs: true
1616
ref: ${{ github.event.pull_request.head.repo.full_name == github.repository &&
1717
github.event.pull_request.head.ref || '' }}
18-
- uses: actions/setup-node@v3
18+
- uses: actions/setup-node@v4
1919
with:
2020
node-version: 20
2121
- run: git config --global user.email "actions@github.com"
@@ -38,11 +38,11 @@ jobs:
3838
needs: cancel-existing
3939
runs-on: ${{ matrix.os }}
4040
steps:
41-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
4242
with:
4343
fetch-depth: 0
4444
lfs: true
45-
- uses: actions/setup-node@v3
45+
- uses: actions/setup-node@v4
4646
with:
4747
node-version: ${{ matrix.node }}
4848
- run: yarn --frozen-lockfile
@@ -61,8 +61,6 @@ jobs:
6161
strategy:
6262
matrix:
6363
include:
64-
- node: 16
65-
os: ubuntu-latest
6664
- node: 18
6765
os: ubuntu-latest
6866
- node: 20

.github/workflows/deprecated-dependencies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ jobs:
22
run:
33
runs-on: ubuntu-latest
44
steps:
5-
- uses: actions/checkout@v3
5+
- uses: actions/checkout@v4
66
with:
77
lfs: true
88
- continue-on-error: true

.github/workflows/sync-labels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ jobs:
22
build:
33
runs-on: ubuntu-latest
44
steps:
5-
- uses: actions/checkout@v3
5+
- uses: actions/checkout@v4
66
- env:
77
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88
uses: micnncim/action-label-syncer@v1

.github/workflows/sync-metadata.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ jobs:
22
build:
33
runs-on: ubuntu-latest
44
steps:
5-
- uses: actions/checkout@v3
5+
- uses: actions/checkout@v4
66
- uses: jaid/action-sync-node-meta@v2.0.0
77
with:
88
approve: false

.gitpod.Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Need to add :latest, otherwise old versions (e.g. of node) are installed
2-
FROM gitpod/workspace-full:latest
2+
FROM gitpod/workspace-full-vnc:latest
33

44
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
55
RUN sudo apt-get install git-lfs
66
RUN git lfs install
77

88
# https://www.gitpod.io/docs/languages/javascript
9-
RUN bash -c 'VERSION="20" && source $HOME/.nvm/nvm.sh && nvm install $VERSION && nvm use $VERSION && nvm alias default $VERSION'
9+
# https://github.com/gitpod-io/gitpod/issues/945
10+
RUN bash -c 'source $HOME/.nvm/nvm.sh && nvm install 20'
11+
RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
1012

1113
RUN echo "\nexport PATH=$(yarn global bin):\$PATH" >> /home/gitpod/.bashrc
1214

.renovaterc.json

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
":semanticCommits",
44
":semanticPrefixFix"
55
],
6+
"gitIgnoredAuthors": [
7+
"actions@github.com"
8+
],
69
"github-actions": {
710
"enabled": false
811
},

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Copyright &copy; Sebastian Landwehr <info@sebastianlandwehr.com>
66

77
and licensed under:
88

9-
[MIT License](https://opensource.org/licenses/MIT)
9+
[MIT License](https://opensource.org/license/mit/)
1010

1111
## MIT License
1212

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,5 @@ Thanks a lot for your support! ❤️
162162

163163
## License
164164

165-
[MIT License](https://opensource.org/licenses/MIT) © [Sebastian Landwehr](https://sebastianlandwehr.com)
165+
[MIT License](https://opensource.org/license/mit/) © [Sebastian Landwehr](https://sebastianlandwehr.com)
166166
<!-- /LICENSE -->

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,24 @@
4444
},
4545
"dependencies": {
4646
"@babel/core": "^7.10.2",
47-
"@dword-design/functions": "^5.0.22",
47+
"@dword-design/functions": "^6.0.0",
4848
"babel-plugin-module-resolver": "^5.0.0",
4949
"deepmerge": "^4.3.1",
5050
"jiti": "^1.18.2"
5151
},
5252
"devDependencies": {
53-
"@dword-design/base": "^10.1.0",
53+
"@dword-design/base": "^11.0.7",
5454
"@dword-design/tester": "^2.0.19",
5555
"@dword-design/tester-plugin-tmp-dir": "^2.1.26",
5656
"depcheck-package-name": "^3.0.1",
5757
"eslint": "^8.0.0",
5858
"execa": "^8.0.0",
5959
"fs-extra": "^11.1.1",
60+
"in-folder": "^1.0.3",
6061
"output-files": "^2.0.0"
6162
},
6263
"engines": {
63-
"node": ">=16"
64+
"node": ">=18"
6465
},
6566
"publishConfig": {
6667
"access": "public"

src/rules/prefer-alias.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ export default {
3434
const manager = new OptionManager()
3535

3636
const babelConfig = manager.init({
37-
babelrc: true,
3837
filename: currentFile,
39-
root: folder,
38+
rootMode: 'upward-optional',
4039
})
4140

4241
const plugin = babelConfig.plugins |> find({ key: 'module-resolver' })

src/rules/prefer-alias.spec.js

+15-24
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import deepmerge from 'deepmerge'
55
import packageName from 'depcheck-package-name'
66
import { Linter } from 'eslint'
77
import fs from 'fs-extra'
8+
import inFolder from 'in-folder'
89
import outputFiles from 'output-files'
910
import P from 'path'
1011

@@ -161,30 +162,6 @@ export default tester(
161162
output: "import foo from '@/foo'",
162163
})
163164
},
164-
'cwd: packagejson': async () => {
165-
await outputFiles({
166-
sub: {
167-
'.babelrc.json': JSON.stringify({
168-
plugins: [
169-
[
170-
packageName`babel-plugin-module-resolver`,
171-
{ alias: { '@': '.' }, cwd: 'packagejson' },
172-
],
173-
],
174-
}),
175-
'foo.js': '',
176-
'package.json': JSON.stringify({}),
177-
},
178-
})
179-
expect(
180-
lint("import foo from '../foo'", {
181-
filename: P.join('sub', 'sub', 'index.js'),
182-
}),
183-
).toEqual({
184-
messages: ["Unexpected parent import '../foo'. Use '@/foo' instead"],
185-
output: "import foo from '@/foo'",
186-
})
187-
},
188165
'cwd: subfolder': async () => {
189166
await outputFiles({
190167
'.babelrc.json': JSON.stringify({
@@ -220,6 +197,20 @@ export default tester(
220197
)
221198
expect(lint("import foo from 'foo'").messages).toEqual([])
222199
},
200+
'file in parent folder': async () => {
201+
await outputFiles({
202+
'babel.config.json': JSON.stringify({
203+
plugins: [
204+
[
205+
packageName`babel-plugin-module-resolver`,
206+
{ alias: { '@': '.' } },
207+
],
208+
],
209+
}),
210+
'sub/package.json': JSON.stringify({}),
211+
})
212+
await inFolder('sub', () => expect(lint('').messages).toEqual([]))
213+
},
223214
'no aliases': async () => {
224215
await outputFiles({
225216
'foo.js': '',

0 commit comments

Comments
 (0)