Skip to content

Commit

Permalink
feat: support nuxt3 rc.12 (nuxt-modules#1570)
Browse files Browse the repository at this point in the history
* feat: support nuxt3 rc.12

* fix: ci

* fix

* fix: update npm scripts for docs

* fix: tweak node version

* updates
  • Loading branch information
kazupon authored Oct 20, 2022
1 parent 697d7ef commit b23e472
Show file tree
Hide file tree
Showing 44 changed files with 9,844 additions and 13,379 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,56 @@ jobs:
CI: true
strategy:
matrix:
node-version: [14.16, 16.11, 17, 18]
node-version: [14, 16, 17, 18, 19]
name: Use Node.js ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v2
- name: Checkout codes
uses: actions/checkout@v3

- name: Enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: yarn install
run: yarn --immutable
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Linting
# Only test on one version to avoid duplicate linter annotations.
if: ${{ matrix.node-version == '16.11' }}
run: yarn lint
run: pnpm lint

- name: Building
run: yarn build
run: pnpm build

- name: Testing
run: yarn test
run: pnpm test

edge-release:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout codes
uses: actions/checkout@v3

- name: Enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'yarn'
- name: yarn install
run: yarn --immutable
node-version: 16
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Building
run: yarn build
run: pnpm build

- name: Release Edge
if: |
github.event_name == 'push' &&
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ jobs:
with:
fetch-depth: 0

- name: Enable corepack
run: corepack enable

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 16
cache: 'pnpm'

- name: Install dependencies
run: yarn --immutable
run: pnpm install --frozen-lockfile

- name: Create github releases
run: |
Expand All @@ -41,7 +45,7 @@ jobs:

- name: Sync changelog from github releases
run: |
yarn changelog --tag=${{ steps.split.outputs._2 }}
pnpm changelog --tag=${{ steps.split.outputs._2 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ temp
coverage
node_modules

*/**/yarn.lock
/.yarn

package-lock.json
test/setup/context.json
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shamefully-hoist=true
strict-peer-dependencies=false
shell-emulator=true
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
semi: false,
singleQuote: true,
printWidth: 120,
trailingComma: 'none',
endOfLine: 'auto',
arrowParens: 'avoid'
}
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

5 changes: 0 additions & 5 deletions .yarnrc.yml

This file was deleted.

6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"preview": "nuxi preview"
},
"devDependencies": {
"@docus/docs-theme": "npm:@docus/docs-theme-edge@latest",
"@docus/github": "npm:@docus/github-edge@latest",
"nuxt": "npm:nuxt3@3.0.0-rc.12-27755545.c905a23",
"@docus/docs-theme": "npm:@docus/docs-theme-edge@3.0.0-1138f93",
"@docus/github": "npm:@docus/github-edge@1.2.6-1138f93",
"nuxt": "latest",
"vue-plausible": "^1.3.2"
}
}
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "i18n for Nuxt",
"version": "8.0.0-alpha.3",
"homepage": "https://i18n.nuxtjs.org",
"packageManager": "yarn@3.1.1",
"packageManager": "pnpm@7.13.5",
"bugs": {
"url": "https://github.com/nuxt-community/i18n-module/issues"
},
Expand All @@ -23,11 +23,6 @@
"name": "Kazuya Kawaguchi (@kazupon)"
}
],
"workspaces": {
"packages": [
"docs"
]
},
"exports": {
".": {
"import": "./dist/module.mjs",
Expand All @@ -42,34 +37,38 @@
"dist"
],
"scripts": {
"build": "nuxt-module-build",
"build:dev": "nuxi build playground",
"preview:dev": "node playground/.output/server/index.mjs",
"stub": "nuxt-module-build --stub",
"dev": "nuxi dev playground",
"dev:generate": "nuxi generate playground",
"prepare": "yarn build",
"build": "nuxi build-module .",
"prepare": "pnpm stub",
"stub": "nuxi build-module --stub .",
"prepack": "pnpm build",
"release": "bumpp --commit \"release: v%s\" --push --tag",
"changelog": "gh-changelogen --repo=nuxt-community/i18n-module",
"prepare:dev": "yarn stub && nuxi prepare playground",
"docs:dev": "yarn workspace @nuxtjs/i18n-docs dev",
"docs:build": "yarn workspace @nuxtjs/i18n-docs build",
"docs:generate": "yarn workspace @nuxtjs/i18n-docs generate",
"docs:preview": "npx serve -s docs/.output/public",
"dev": "pnpm build && nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:generate": "nuxi generate playground",
"dev:preview": "nuxi preview playground",
"docs:dev": "nuxi dev docs",
"docs:build": "nuxi build docs",
"docs:generate": "nuxi generate docs",
"docs:preview": "nuxi preview docs",
"fix": "run-p lint:fix format:fix",
"format": "prettier --config .prettierrc --ignore-path .prettierignore --list-different '**/*.{js,json,html}'",
"format:fix": "yarn format --write",
"format": "prettier --config .prettierrc.cjs --ignore-path .prettierignore --list-different '**/*.{js,json,html}'",
"format:fix": "pnpm format --write",
"lint": "eslint --ext .js,.ts,.vue,.json .",
"lint:fix": "yarn lint --fix",
"lint:fix": "pnpm lint --fix",
"test": "run-s test:unit test:spec",
"test:unit": "vitest run test",
"test:spec": "yarn build && vitest run specs"
"test:spec": "pnpm build && vitest run specs"
},
"resolutions": {
"@nuxtjs/i18n": "link:.",
"nuxt": "^3.0.0-rc.12"
},
"dependencies": {
"@intlify/bundle-utils": "^3.2.1",
"@intlify/shared": "9.3.0-beta.6",
"@intlify/unplugin-vue-i18n": "^0.7.0",
"@nuxt/kit": "npm:@nuxt/kit-edge@3.0.0-rc.12-27755545.c905a23",
"@nuxt/kit": "^3.0.0-rc.12",
"cookie-es": "^0.5.0",
"debug": "^4.3.2",
"is-https": "^4.0.0",
Expand All @@ -86,8 +85,8 @@
"devDependencies": {
"@babel/parser": "^7.17.9",
"@nuxt/module-builder": "latest",
"@nuxt/schema": "npm:@nuxt/schema-edge@3.0.0-rc.12-27755545.c905a23",
"@nuxt/test-utils": "npm:@nuxt/test-utils-edge@3.0.0-rc.12-27755545.c905a23",
"@nuxt/schema": "^3.0.0-rc.12",
"@nuxt/test-utils": "^3.0.0-rc.12",
"@types/debug": "^4.1.7",
"@types/js-cookie": "^3.0.1",
"@types/rimraf": "^3",
Expand All @@ -104,13 +103,14 @@
"jsdom": "^20.0.0",
"lint-staged": "^12.1.2",
"npm-run-all": "^4.1.5",
"nuxt": "npm:nuxt3@3.0.0-rc.12-27755545.c905a23",
"nuxt": "^3.0.0-rc.12",
"playwright": "^1.22.2",
"prettier": "^2.7.0",
"rimraf": "^3.0.2",
"ts-essentials": "^9.1.2",
"typescript": "^4.8.4",
"vitest": "^0.23.4",
"vue": "^3.2.41",
"yorkie": "^2.0.0"
},
"gitHooks": {
Expand All @@ -133,6 +133,6 @@
"access": "public"
},
"engines": {
"node": "^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0"
"node": "^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
}
8 changes: 4 additions & 4 deletions playground/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const title = computed(() => t('layouts.title', { title: t(route.meta.title ?? '
<Html :lang="head.htmlAttrs.lang">
<Head>
<Title>{{ title }}</Title>
<template v-for="(link, index) in head.link" :key="index">
<Link :hid="link.hid" :rel="link.rel" :href="link.href" :hreflang="link.hreflang" />
<template v-for="link in head.link" :key="link.hid">
<Link :id="link.hid" :rel="link.rel" :href="link.href" :hreflang="link.hreflang" />
</template>
<template v-for="(meta, index) in head.meta" :key="index">
<Meta :hid="meta.hid" :property="meta.property" :content="meta.content" />
<template v-for="meta in head.meta" :key="meta.hid">
<Meta :id="meta.hid" :property="meta.property" :content="meta.content" />
</template>
</Head>
<Body>
Expand Down
4 changes: 1 addition & 3 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// @ts-ignore
import I18nModule from '../dist/module.mjs'
import Module1 from './module1'

import type { NuxtApp } from 'nuxt/dist/app/index'

// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
modules: [Module1, I18nModule],
modules: [Module1, '@nuxtjs/i18n'],

vite: {
build: {
Expand Down
15 changes: 15 additions & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@nuxtjs/i18n-playground",
"private": true,
"type": "module",
"scripts": {
"build": "nuxi build",
"dev": "nuxi dev",
"generate": "nuxi generate",
"preview": "nuxi preview"
},
"devDependencies": {
"@nuxtjs/i18n": "latest",
"nuxt": "latest"
}
}
Loading

0 comments on commit b23e472

Please sign in to comment.