Skip to content

Commit

Permalink
provide pinia to extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Jan 22, 2024
1 parent f069ce4 commit a61591c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public-hoist-pattern[]=webdav
# @vue/component-compiler-utils
hoist-pattern[]=sass

# @vue/test-utils (@1.3.0 ?)

# eslint (public so they are picked up by IDEs)
public-hoist-pattern[]=*eslint*

Expand Down
1 change: 1 addition & 0 deletions packages/extension-sdk/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const defineConfig = (overrides = {}) => {
external: [
'vue',
'luxon',
'pinia',
'vue3-gettext',

'@ownclouders/web-client',
Expand Down
7 changes: 5 additions & 2 deletions packages/web-runtime/src/container/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Language } from 'vue3-gettext'
import * as vue from 'vue' // eslint-disable-line
import * as luxon from 'luxon' // eslint-disable-line
import * as vueGettext from 'vue3-gettext' // eslint-disable-line
import * as pinia from 'pinia' // eslint-disable-line
import * as webPkg from '@ownclouders/web-pkg'
import * as webClient from '@ownclouders/web-client'

Expand All @@ -26,6 +27,7 @@ const { requirejs, define } = window as any
// keep in sync with packages/extension-sdk/index.mjs
const injectionMap = {
luxon,
pinia,
vue,
'vue3-gettext': vueGettext,
'@ownclouders/web-pkg': webPkg,
Expand Down Expand Up @@ -96,8 +98,9 @@ export const buildApplication = async ({
} else {
const productionModule = (window as any).WEB_APPS_MAP?.[applicationPath]
if (productionModule) {
applicationScript =
await loadScriptDynamicImport<ClassicApplicationScript>(productionModule)
applicationScript = await loadScriptDynamicImport<ClassicApplicationScript>(
productionModule
)
} else {
throw new RuntimeError(
'cannot load application as only a name (and no path) is given and that name is not known to the application import map'
Expand Down

0 comments on commit a61591c

Please sign in to comment.