@opencloud-eu/extension-sdk 4.2.0 → 4.3.0

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.
Files changed (2) hide show
  1. package/index.mjs +1 -33
  2. package/package.json +2 -2
package/index.mjs CHANGED
@@ -79,37 +79,6 @@ const manifestPlugin = () => {
79
79
  }
80
80
  }
81
81
 
82
- // UPSTREAM: https://github.com/vitejs/vite/pull/20861
83
- // We are trying to upstream this plugin, it can be removed once the PR above or an alternative approach has been merged
84
- // TL;DR of the issue: vite uses the require variable for certain features but doesn't ensure it's injected into AMD modules
85
- // thus the global require variable is used which does not have the correct base path set, so relative imports
86
- // with ?url or ?worker break
87
- const completeAmdWrapPlugin = () => {
88
- const AmdWrapRE = /\bdefine\((?:\s*\[([^\]]*)\],)?\s*(?:\(\s*)?function\s*\(([^)]*)\)\s*\{/
89
-
90
- return {
91
- name: 'vite:force-amd-wrap-require',
92
- enforce: 'pre',
93
- renderChunk(code, _chunk, opts) {
94
- if (opts.format !== 'amd') return
95
-
96
- return {
97
- code: code.replace(AmdWrapRE, (_, deps, params) => {
98
- if (deps?.includes(`"require"`) || deps?.includes(`'require'`)) {
99
- return `define([${deps}], (function(${params}) {`
100
- }
101
-
102
- const newDeps = deps ? `"require", ${deps}` : '"require"'
103
- const newParams = params.trim() ? `require, ${params}` : 'require'
104
-
105
- return `define([${newDeps}], (function(${newParams}) {`
106
- }),
107
- map: null // no need to generate sourcemap as no mapping exists for the wrapper
108
- }
109
- }
110
- }
111
- }
112
-
113
82
  export const defineConfig = (overrides = {}) => {
114
83
  return ({ mode }) => {
115
84
  const isProduction = mode === 'production'
@@ -163,7 +132,6 @@ export const defineConfig = (overrides = {}) => {
163
132
  }
164
133
  },
165
134
  plugins: [
166
- completeAmdWrapPlugin(),
167
135
  vue({
168
136
  // set to true when switching to esm
169
137
  customElement: false,
@@ -189,7 +157,7 @@ export const defineConfig = (overrides = {}) => {
189
157
  '**/.{idea,git,cache,output,temp}/**',
190
158
  '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
191
159
  '.pnpm-store/*',
192
- 'e2e/**'
160
+ '**/e2e/**'
193
161
  ],
194
162
  coverage: {
195
163
  provider: 'v8',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencloud-eu/extension-sdk",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "OpenCloud Web Extension SDK",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "index.mjs",
@@ -18,6 +18,6 @@
18
18
  "@vitejs/plugin-vue": "^6.0.0"
19
19
  },
20
20
  "peerDependencies": {
21
- "vite": "^5 || ^6.0.0 || ^7.0.0"
21
+ "vite": "^7.2.0"
22
22
  }
23
23
  }