[READ-ONLY] Mirror of https://github.com/danielroe/cross-origin-storage. Load shared dependencies from Cross-Origin Storage (COS).
cross-origin-storage
experimental
nuxt
vite
vite-plugin
1import { execSync } from 'node:child_process'
2import { existsSync } from 'node:fs'
3import { fileURLToPath } from 'node:url'
4
5const COS_EXTENSION_REPO = 'https://github.com/web-ai-community/cross-origin-storage-extension'
6
7/**
8 * Clone the Cross-Origin Storage browser extension so the e2e suite can
9 * exercise the real COS cache path.
10 */
11export default function setup(): void {
12 const extensionDir = fileURLToPath(new URL('./.cos-extension', import.meta.url))
13 if (existsSync(extensionDir)) {
14 return
15 }
16 execSync(`git clone --depth 1 ${COS_EXTENSION_REPO} ${extensionDir}`, { stdio: 'inherit' })
17}