vite-plugin-twig-drupal 1.6.2 โ†’ 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,40 @@
1
+ name: validate
2
+ on:
3
+ pull_request: {}
4
+ jobs:
5
+ main:
6
+ strategy:
7
+ matrix:
8
+ node: [18, 20, 22]
9
+ vite: [4, 5, 6, 7, 8]
10
+ exclude:
11
+ - node: 18
12
+ vite: 7
13
+ - node: 18
14
+ vite: 8
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: ๐Ÿ›‘ Cancel Previous Runs
18
+ uses: styfle/cancel-workflow-action@0.9.0
19
+
20
+ - name: โฌ‡๏ธ Checkout repo
21
+ uses: actions/checkout@v2
22
+
23
+ - name: โŽ” Setup node
24
+ uses: actions/setup-node@v2
25
+ with:
26
+ node-version: ${{ matrix.node }}
27
+
28
+ - name: ๐Ÿ“ฅ Download deps
29
+ uses: bahmutov/npm-install@v1
30
+ with:
31
+ useLockFile: false
32
+
33
+ - name: โšก๏ธ Setup vite
34
+ run: npm install vite@${{ matrix.vite }}
35
+
36
+ - name: ๐Ÿงน Linting
37
+ run: npm run lint
38
+
39
+ - name: โœ… Tests
40
+ run: npm run test
@@ -0,0 +1,41 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+
7
+ permissions:
8
+ contents: read # for checkout
9
+
10
+ jobs:
11
+ release:
12
+ name: Release
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write # to be able to publish a GitHub release
16
+ issues: write # to be able to comment on released issues
17
+ pull-requests: write # to be able to comment on released pull requests
18
+ id-token: write # to enable use of OIDC for trusted publishing and npm provenance
19
+ steps:
20
+ - name: Checkout
21
+ uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0
24
+ - name: Setup Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: "lts/*"
28
+ - name: Install dependencies
29
+ run: npm install
30
+ - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
31
+ run: npm audit signatures
32
+ - name: Lint
33
+ run: npm run lint
34
+ - name: Test
35
+ run: npm run test
36
+ - name: Build
37
+ run: npm run build
38
+ - name: Release
39
+ env:
40
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41
+ run: npx semantic-release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-twig-drupal",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Provides a โšก๏ธ Vite plugin to transform ๐ŸŒฑ Twig into HTML with a ๐Ÿ’ง Drupal flavour",
5
5
  "keywords": [
6
6
  "Vite",
@@ -18,8 +18,7 @@
18
18
  "format": "prettier --write \"{test,src}/**/*.js\"",
19
19
  "lint": "prettier --check \"{test,src}/**/*.js\"",
20
20
  "test": "vitest run",
21
- "pretest": "npm run-script build",
22
- "semantic-release": "semantic-release"
21
+ "pretest": "npm run-script build"
23
22
  },
24
23
  "repository": {
25
24
  "type": "git",
@@ -31,11 +30,10 @@
31
30
  "twig": "^1.16.0"
32
31
  },
33
32
  "peerDependencies": {
34
- "vite": "^4.4.11 || ^5 || ^6 || ^7"
33
+ "vite": "^4.4.11 || ^5 || ^6 || ^7 || ^8"
35
34
  },
36
35
  "devDependencies": {
37
36
  "prettier": "^3.0.3",
38
- "semantic-release": "^22.0.5",
39
37
  "vite": "^4.4.11 || ^ 5",
40
38
  "vitest": "^0.34.6"
41
39
  }
package/src/index.js CHANGED
@@ -146,9 +146,6 @@ const plugin = (options = {}) => {
146
146
  options.root = root
147
147
  }
148
148
  },
149
- async shouldTransformCachedModule(src, id) {
150
- return options.pattern.test(id)
151
- },
152
149
  async transform(src, id) {
153
150
  if (options.pattern.test(id)) {
154
151
  let frameworkInclude = ""
@@ -193,6 +190,7 @@ const plugin = (options = {}) => {
193
190
  dirname(id),
194
191
  resolveNamespaceOrComponent(options.namespaces, template)
195
192
  )
193
+ this.addWatchFile(file)
196
194
  if (!(template in seen)) {
197
195
  return compileTemplate(template, file, options)
198
196
  .catch(errorHandler(template, false))
package/vite.config.js CHANGED
@@ -17,6 +17,7 @@ export default defineConfig({
17
17
  ),
18
18
  },
19
19
  name: "vite-plugin-twig-drupal",
20
+ formats: ["es"],
20
21
  fileName: (_, entry) => `${entry}.js`,
21
22
  },
22
23
  },
@@ -1,77 +0,0 @@
1
- name: validate
2
- on:
3
- push:
4
- branches:
5
- - 'main'
6
- - 'beta'
7
- pull_request: {}
8
- jobs:
9
- main:
10
- strategy:
11
- matrix:
12
- node: [18, 20]
13
- vite: [4, 5, 6, 7]
14
- runs-on: ubuntu-latest
15
- steps:
16
- - name: ๐Ÿ›‘ Cancel Previous Runs
17
- uses: styfle/cancel-workflow-action@0.9.0
18
-
19
- - name: โฌ‡๏ธ Checkout repo
20
- uses: actions/checkout@v2
21
-
22
- - name: โŽ” Setup node
23
- uses: actions/setup-node@v2
24
- with:
25
- node-version: ${{ matrix.node }}
26
-
27
- - name: ๐Ÿ“ฅ Download deps
28
- uses: bahmutov/npm-install@v1
29
- with:
30
- useLockFile: false
31
-
32
- - name: โšก๏ธ Setup vite
33
- run: npm install vite@${{ matrix.vite }}
34
-
35
- - name: ๐Ÿงน Linting
36
- run: npm run lint
37
-
38
- - name: โœ… Tests
39
- run: npm run test
40
-
41
- release:
42
- needs: main
43
- runs-on: ubuntu-latest
44
- if:
45
- ${{ github.repository == 'larowlan/vite-plugin-twig-drupal' &&
46
- contains('refs/heads/main',github.ref) && github.event_name == 'push' }}
47
- steps:
48
- - name: ๐Ÿ›‘ Cancel Previous Runs
49
- uses: styfle/cancel-workflow-action@0.9.0
50
-
51
- - name: โฌ‡๏ธ Checkout repo
52
- uses: actions/checkout@v2
53
-
54
- - name: โŽ” Setup node
55
- uses: actions/setup-node@v2
56
- with:
57
- node-version: 18
58
-
59
- - name: ๐Ÿ“ฅ Download deps
60
- uses: bahmutov/npm-install@v1
61
- with:
62
- useLockFile: false
63
-
64
- - name: ๐Ÿ— Run build script
65
- run: npm run build
66
-
67
- - name: ๐Ÿš€ Release
68
- uses: cycjimmy/semantic-release-action@v4
69
- with:
70
- semantic_version: 22
71
- branches: |
72
- [
73
- 'main'
74
- ]
75
- env:
76
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}