Skip to content

Commit 1dd88cb

Browse files
authored
feat: nuxt 3 support
2 parents 87fa5f0 + f8a97dd commit 1dd88cb

40 files changed

Lines changed: 8803 additions & 12625 deletions

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ module.exports = {
44
sourceType: 'module'
55
},
66
extends: [
7-
'@nuxtjs/eslint-config-typescript'
8-
]
7+
'@nuxt/eslint-config'
8+
],
9+
rules: {
10+
"vue/multi-word-component-names": "off",
11+
}
912
}

.github/workflows/ci.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ name: CI
44
on:
55
push:
66
branches:
7-
- master
7+
- master
88
pull_request:
99
branches:
10-
- master
10+
- master
1111

1212
jobs:
1313
build:
@@ -16,17 +16,23 @@ jobs:
1616
CI: true
1717
strategy:
1818
matrix:
19-
node-version: [12.x, 14.x]
19+
node-version: [18.x, 20.x]
2020
name: Use Node.js ${{ matrix.node-version }}
2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
23+
- uses: pnpm/action-setup@v2
24+
with:
25+
version: 8.8.0
2326
- name: Setup node
24-
uses: actions/setup-node@v2
27+
uses: actions/setup-node@v3
2528
with:
2629
node-version: ${{ matrix.node-version }}
27-
- name: yarn install
28-
run: yarn
30+
cache: "pnpm"
31+
- name: Install dependencies
32+
run: pnpm install
33+
- name: Stub
34+
run: pnpm dev:prepare
2935
- name: Unittesting
30-
run: yarn test
36+
run: pnpm test
3137
- name: Linting
32-
run: yarn lint
38+
run: pnpm lint

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn run commitlint
4+
pnpm run commitlint

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn run lint
4+
pnpm run lint

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# Style Resources for Nuxt 2 - Nobody likes extra @import statements!
1+
# Style Resources for Nuxt 3 - Nobody likes extra @import statements!
22

33
[![npm version][npm-version-src]][npm-version-href]
44
[![npm downloads][npm-downloads-src]][npm-downloads-href]
55
[![Codecov][codecov-src]][codecov-href]
66
[![License][license-src]][license-href]
77

8-
>
8+
Nuxt 2 is supported with `@nuxtjs/style-resources@^1`, documentation is on [v1](https://github.com/nuxt-community/style-resources-module/tree/v1) branch.
9+
10+
If you are using Vite, this module is not needed.
11+
12+
You can use the [`css.preprocessorOptions`](https://vitejs.dev/config/shared-options.html#css-preprocessoroptions) instead.
913

1014
[📖 **Release Notes**](CHANGELOG.md)
1115

lib/module.js

Lines changed: 0 additions & 99 deletions
This file was deleted.

package.json

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,21 @@
66
"contributors": [
77
{
88
"name": "Alexander Lichter <npm@lichter.io>"
9+
},
10+
{
11+
"name": "Ryota Watanabe",
12+
"url": "https://github.com/wattanx"
913
}
1014
],
11-
"main": "lib/module.js",
15+
"type": "module",
16+
"exports": {
17+
".": {
18+
"types": "./dist/types.d.ts",
19+
"import": "./dist/module.mjs",
20+
"require": "./dist/module.cjs"
21+
}
22+
},
23+
"main": "./dist/module.cjs",
1224
"repository": {
1325
"mode": "git",
1426
"url": "git+https://github.com/nuxt-community/style-resources-module"
@@ -20,15 +32,19 @@
2032
"access": "public"
2133
},
2234
"scripts": {
23-
"dev": "nuxt dev --config-file test/fixture/sass/nuxt.config.js",
24-
"lint": "eslint --ext .js,.ts,.vue lib test types",
25-
"test": "yarn lint && jest",
35+
"prepack": "nuxt-module-build",
36+
"dev": "nuxi dev playground",
37+
"dev:build": "nuxi build playground",
38+
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
39+
"lint": "eslint --ext .js,.ts,.vue src test",
40+
"test": "vitest run",
41+
"test:watch": "vitest watch",
2642
"release": "standard-version && git push --follow-tags && npm publish",
27-
"commitlint": "commitlint -e $GIT_PARAMS",
43+
"commitlint": "commitlint --config commitlint.config.cjs -e $GIT_PARAMS",
2844
"coverage": "codecov",
2945
"prepare": "husky install"
3046
},
31-
"types": "types/index.d.ts",
47+
"types": "./dist/types.d.ts",
3248
"eslintIgnore": [
3349
".nuxt",
3450
"coverage",
@@ -37,8 +53,7 @@
3753
"node_modules"
3854
],
3955
"files": [
40-
"lib",
41-
"types"
56+
"dist"
4257
],
4358
"keywords": [
4459
"nuxtjs",
@@ -54,39 +69,33 @@
5469
"node": ">=v10.24.1",
5570
"npm": ">=6.14.14"
5671
},
57-
"jest": {
58-
"testEnvironment": "node",
59-
"collectCoverage": true,
60-
"collectCoverageFrom": [
61-
"lib/**/*.js"
62-
]
63-
},
6472
"dependencies": {
65-
"consola": "^2.15.3",
66-
"glob-all": "^3.2.1",
67-
"sass-resources-loader": "^2.2.4"
73+
"@nuxt/kit": "3.7.3",
74+
"sass-resources-loader": "2.2.5"
6875
},
6976
"devDependencies": {
7077
"@commitlint/cli": "^13.1.0",
7178
"@commitlint/config-conventional": "^13.1.0",
72-
"@nuxt/types": "^2.15.7",
73-
"@nuxtjs/eslint-config-typescript": "^6.0.1",
74-
"@types/jest": "^27.0.0",
79+
"@nuxt/eslint-config": "^0.1.1",
80+
"@nuxt/module-builder": "0.5.1",
81+
"@nuxt/schema": "3.7.3",
82+
"@nuxt/test-utils": "3.7.3",
83+
"@nuxt/webpack-builder": "3.7.3",
7584
"codecov": "^3.8.3",
76-
"eslint": "^7.32.0",
85+
"eslint": "^8.49.0",
7786
"get-port": "^5.1.1",
7887
"husky": "^7.0.1",
79-
"jest": "^27.0.6",
8088
"jsdom": "^16.7.0",
81-
"less": "^4.1.1",
82-
"less-loader": "^4.1.0",
89+
"less": "^4.1.3",
90+
"less-loader": "^11.1.2",
8391
"mathsass": "^0.11.0",
84-
"nuxt-edge": "^2.16.0-27132492.cdbea391",
85-
"sass": "^1.37.5",
86-
"sass-loader": "^7.3.1",
87-
"standard-version": "^9.3.1",
88-
"stylus": "^0.54.8",
89-
"stylus-loader": "^3.0.2",
90-
"typescript": "^4.3.5"
91-
}
92+
"nuxt": "3.7.3",
93+
"sass": "^1.62.1",
94+
"sass-loader": "^13.3.1",
95+
"stylus": "^0.59.0",
96+
"stylus-loader": "^7.1.2",
97+
"typescript": "^5.1.3",
98+
"vitest": "0.34.4"
99+
},
100+
"packageManager": "pnpm@8.8.0"
92101
}

playground/app.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div>
3+
<SassTest />
4+
</div>
5+
</template>

0 commit comments

Comments
 (0)