Skip to content

Commit e458523

Browse files
chore(module): call hook before resolving config (#655)
* chore(module): call hook before resolving config * chore(module): lint * chore(github): update ci to use pnpm
1 parent 9b244ef commit e458523

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,38 @@ jobs:
2525
- name: checkout
2626
uses: actions/checkout@master
2727

28-
- name: cache node_modules
29-
uses: actions/cache@v3
28+
- uses: pnpm/action-setup@v2
29+
name: Install pnpm
30+
id: pnpm-install
3031
with:
31-
path: node_modules
32-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
32+
version: 7
33+
run_install: false
34+
35+
- name: Get pnpm store directory
36+
id: pnpm-cache
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
40+
41+
- uses: actions/cache@v3
42+
name: Setup pnpm cache
43+
with:
44+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
45+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
46+
restore-keys: |
47+
${{ runner.os }}-pnpm-store-
3348
3449
- name: Install dependencies
35-
if: steps.cache.outputs.cache-hit != 'true'
36-
run: yarn
50+
run: pnpm install
3751

3852
- name: Prepare
39-
run: yarn dev:prepare
53+
run: pnpm run dev:prepare
4054

4155
- name: Lint
42-
run: yarn lint
56+
run: pnpm run lint
4357

4458
- name: Test
45-
run: yarn test
59+
run: pnpm run test
4660

4761
# - name: Coverage
4862
# run: yarn codecov

src/module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ export default defineNuxtModule<ModuleOptions>({
154154
}
155155
}
156156

157+
// Allow extending tailwindcss config by other modules
158+
await nuxt.callHook('tailwindcss:config', tailwindConfig)
159+
157160
// Write cjs version of config to support vscode extension
158161
const resolveConfig = await import('tailwindcss/resolveConfig.js').then(r => r.default || r)
159162
const resolvedConfig = resolveConfig(tailwindConfig) as Config
@@ -174,9 +177,6 @@ export default defineNuxtModule<ModuleOptions>({
174177
createTemplates(resolvedConfig, moduleOptions.exposeLevel, nuxt)
175178
}
176179

177-
// Allow extending tailwindcss config by other modules
178-
await nuxt.callHook('tailwindcss:config', tailwindConfig)
179-
180180
// Compute tailwindConfig hash
181181
tailwindConfig._hash = String(Date.now())
182182

0 commit comments

Comments
 (0)