Skip to content

Commit

Permalink
fix: lock file maintenance (#204)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: node.js >= 18
  • Loading branch information
renovate[bot] authored Mar 28, 2024
1 parent 8355e60 commit badf619
Show file tree
Hide file tree
Showing 16 changed files with 6,302 additions and 6,087 deletions.
2 changes: 0 additions & 2 deletions .baserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
{ "repository": "nuxt-content-git", "description": "Additional module for @nuxt/content that replaces or adds createdAt and updatedAt dates based on the git history." },
{ "repository": "nuxt-babel-runtime", "description": "Nuxt CLI that supports babel. Inspired by @nuxt/typescript-runtime." }
],
"supportedNodeVersions": [16],
"nodeVersion": 16,
"eslintConfig": {
"extends": "@dword-design/eslint-config",
"rules": {
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-16",
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-20",
"updateContentCommand": "yarn --frozen-lockfile"
}
20 changes: 11 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: true
ref: ${{ github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.head.ref || '' }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: git config --global user.email "actions@github.com"
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
Expand All @@ -38,11 +38,11 @@ jobs:
needs: cancel-existing
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: yarn --frozen-lockfile
Expand All @@ -54,18 +54,20 @@ jobs:
with:
name: Image Snapshot Diffs
path: "**/__image_snapshots__/__diff_output__"
- if: matrix.os == 'ubuntu-latest' && matrix.node == 16
- if: matrix.os == 'ubuntu-latest' && matrix.node == 20
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
strategy:
matrix:
include:
- node: 16
- node: 18
os: ubuntu-latest
- node: 16
- node: 20
os: ubuntu-latest
- node: 20
os: macos-latest
- node: 16
- node: 20
os: windows-latest
name: build
on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deprecated-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: true
- continue-on-error: true
Expand All @@ -20,7 +20,7 @@ jobs:
update_existing: true
- if: ${{ !steps.check-deprecated-js-deps.outputs.deprecated &&
steps.create-deprecation-issue.outputs.number }}
uses: peter-evans/close-issue@v2
uses: peter-evans/close-issue@v3
with:
comment: Auto-closing the issue
issue-number: ${{ steps.create-deprecation-issue.outputs.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: micnncim/action-label-syncer@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: jaid/action-sync-node-meta@v2.0.0
with:
approve: false
Expand Down
6 changes: 4 additions & 2 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Need to add :latest, otherwise old versions (e.g. of node) are installed
FROM gitpod/workspace-full:latest
FROM gitpod/workspace-full-vnc:latest

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

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

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

Expand Down
3 changes: 2 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ tasks:
PUPPETEER_CACHE_DIR=/workspace/nuxt-mail/node_modules/.cache/puppeteer" >>
/home/gitpod/.bashrc
gitpod-env-per-project >> /home/gitpod/.bashrc && source /home/gitpod/.bashrc
gitpod-env-per-project >> /home/gitpod/.bashrc && source
/home/gitpod/.bashrc
init: |-
git config --global user.name "Sebastian Landwehr"
git config diff.lfs.textconv cat
Expand Down
3 changes: 3 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
":semanticCommits",
":semanticPrefixFix"
],
"gitIgnoredAuthors": [
"actions@github.com"
],
"github-actions": {
"enabled": false
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"editor.tabSize": 2,
"files.autoSave": "off",
"files.exclude": {
".babelrc.json": true,
".commitlintrc.json": true,
".cz.json": true,
".devcontainer": true,
Expand All @@ -20,6 +19,7 @@
".vscode": true,
"CHANGELOG.md": true,
"LICENSE.md": true,
"babel.config.json": true,
"coverage": true,
"dist": true,
"node_modules": true,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Copyright &copy; Sebastian Landwehr <info@sebastianlandwehr.com>

and licensed under:

[MIT License](https://opensource.org/licenses/MIT)
[MIT License](https://opensource.org/license/mit/)

## MIT License

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,5 @@ Thanks a lot for your support! ❤️

## License

[MIT License](https://opensource.org/licenses/MIT) © [Sebastian Landwehr](https://sebastianlandwehr.com)
[MIT License](https://opensource.org/license/mit/) © [Sebastian Landwehr](https://sebastianlandwehr.com)
<!-- /LICENSE -->
File renamed without changes.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,34 @@
"test": "base test"
},
"dependencies": {
"@dword-design/functions": "^5",
"@dword-design/functions": "^6.0.0",
"@nuxt/kit": "^3.0.0",
"express": "^4.17.1",
"fs-extra": "^11.1.0",
"h3": "^1.0.2",
"nodemailer": "^6.4.11",
"nuxt-alias-path": "^1.0.0",
"nuxt-alias-path": "^2.0.0",
"nuxt-push-plugins": "^2.1.2",
"parse-packagejson-name": "^1.0.1"
},
"devDependencies": {
"@dword-design/base": "^10.0.0",
"@dword-design/puppeteer": "^5.0.0",
"@dword-design/base": "^11.0.4",
"@dword-design/puppeteer": "^7.0.0",
"@nuxtjs/axios": "^5.13.1",
"axios": "^0.27.2",
"axios": "^0",
"depcheck-package-name": "^3.0.0",
"execa": "^7.1.1",
"execa": "^8.0.1",
"nuxt": "^3.3.3",
"nuxt-dev-ready": "^2.0.1",
"ora": "^6.3.0",
"nuxt-dev-ready": "^3.0.0",
"ora": "^8.0.1",
"output-files": "^2.0.19",
"port-ready": "^0.1.0",
"smtp-tester": "^2.0.1",
"tree-kill-promise": "^3.0.9",
"with-local-tmp-dir": "^5.0.0"
},
"engines": {
"node": ">=16"
"node": ">=18"
},
"publishConfig": {
"access": "public"
Expand Down
98 changes: 49 additions & 49 deletions src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export default {
'SMTP config is missing.',
)
},
async nuxt2() {
async 'nuxt2: client side'() {
await outputFiles({
'nuxt.config.js': endent`
export default {
Expand All @@ -487,17 +487,21 @@ export default {
`,
'pages/index.vue': endent`
<template>
<div />
<button @click="send" />
</template>
<script>
export default {
asyncData: context => context.$mail.send({
from: 'a@b.de',
subject: 'Incredible',
text: 'This is an incredible test message',
to: 'foo@bar.de',
})
methods: {
send() {
this.$mail.send({
from: 'a@b.de',
subject: 'Incredible',
text: 'This is an incredible test message',
to: 'foo@bar.de',
})
},
},
}
</script>
`,
Expand All @@ -510,10 +514,13 @@ export default {
const nuxt = execa(P.join('node_modules', '.bin', 'nuxt'), ['dev'])
try {
await nuxtDevReady()
await this.page.goto('http://localhost:3000')

const button = await this.page.waitForSelector('button')

const [capture] = await Promise.all([
this.mailServer.captureOne('johndoe@gmail.com'),
this.page.goto('http://localhost:3000'),
button.click(),
])
expect(capture.email.body).toEqual('This is an incredible test message')
expect(capture.email.headers.subject).toEqual('Incredible')
Expand All @@ -523,36 +530,23 @@ export default {
await kill(nuxt.pid)
}
},
async 'nuxt2: client side'() {
'nuxt2: error': async () => {
await outputFiles({
'nuxt.config.js': endent`
export default {
modules: [
'${packageName`@nuxtjs/axios`}',
['~/../src/index.js', {
message: { to: 'johndoe@gmail.com' },
smtp: { port: 3001 },
message: [{ to: 'foo@bar.com' }],
smtp: {},
}],
],
}
`,
'pages/index.vue': endent`
<template>
<button @click="send" />
</template>
<script>
export default {
methods: {
send() {
this.$mail.send({
from: 'a@b.de',
subject: 'Incredible',
text: 'This is an incredible test message',
to: 'foo@bar.de',
})
},
},
asyncData: context => context.$mail.send({ config: 10 })
}
</script>
`,
Expand All @@ -565,39 +559,43 @@ export default {
const nuxt = execa(P.join('node_modules', '.bin', 'nuxt'), ['dev'])
try {
await nuxtDevReady()
await this.page.goto('http://localhost:3000')

const button = await this.page.waitForSelector('button')

const [capture] = await Promise.all([
this.mailServer.captureOne('johndoe@gmail.com'),
button.click(),
])
expect(capture.email.body).toEqual('This is an incredible test message')
expect(capture.email.headers.subject).toEqual('Incredible')
expect(capture.email.headers.from).toEqual('a@b.de')
expect(capture.email.headers.to).toEqual('johndoe@gmail.com')
let errorMessage
try {
console.log(await axios.post('http://localhost:3000'))
} catch (error) {
errorMessage = error.response.data.error.message
}
expect(errorMessage).toEqual('Message config not found at index 10.')
} finally {
await kill(nuxt.pid)
}
},
'nuxt2: error': async () => {
async 'nuxt2: works'() {
await outputFiles({
'nuxt.config.js': endent`
export default {
modules: [
'${packageName`@nuxtjs/axios`}',
['~/../src/index.js', {
message: [{ to: 'foo@bar.com' }],
smtp: {},
message: { to: 'johndoe@gmail.com' },
smtp: { port: 3001 },
}],
],
}
`,
'pages/index.vue': endent`
<template>
<div />
</template>
<script>
export default {
asyncData: context => context.$mail.send({ config: 10 })
asyncData: context => context.$mail.send({
from: 'a@b.de',
subject: 'Incredible',
text: 'This is an incredible test message',
to: 'foo@bar.de',
})
}
</script>
`,
Expand All @@ -610,13 +608,15 @@ export default {
const nuxt = execa(P.join('node_modules', '.bin', 'nuxt'), ['dev'])
try {
await nuxtDevReady()
let errorMessage
try {
console.log(await axios.post('http://localhost:3000'))
} catch (error) {
errorMessage = error.response.data.error.message
}
expect(errorMessage).toEqual('Message config not found at index 10.')

const [capture] = await Promise.all([
this.mailServer.captureOne('johndoe@gmail.com'),
this.page.goto('http://localhost:3000'),
])
expect(capture.email.body).toEqual('This is an incredible test message')
expect(capture.email.headers.subject).toEqual('Incredible')
expect(capture.email.headers.from).toEqual('a@b.de')
expect(capture.email.headers.to).toEqual('johndoe@gmail.com')
} finally {
await kill(nuxt.pid)
}
Expand Down
Loading

0 comments on commit badf619

Please sign in to comment.