@keystatic/astro
Advanced tools
Comparing version 0.0.0-test-20240116013622 to 0.0.0-test-20241009232117
@@ -1,4 +0,2 @@ | ||
import { fileURLToPath } from 'node:url'; | ||
import path from 'node:path'; | ||
import fs from 'node:fs/promises'; | ||
import { mkdirSync, writeFileSync } from 'node:fs'; | ||
@@ -9,3 +7,3 @@ function keystatic() { | ||
hooks: { | ||
'astro:config:setup': async ({ | ||
'astro:config:setup': ({ | ||
injectRoute, | ||
@@ -15,30 +13,32 @@ updateConfig, | ||
}) => { | ||
if (config.output !== 'hybrid') { | ||
throw new Error("Keystatic requires `output: 'hybrid'` in your Astro config"); | ||
if (config.output === 'static') { | ||
throw new Error("Keystatic requires `output: 'hybrid'` or `output: 'server'` in your Astro config"); | ||
} | ||
const vite = { | ||
plugins: [{ | ||
name: 'keystatic', | ||
resolveId(id) { | ||
if (id === 'virtual:keystatic-config') { | ||
return this.resolve('./keystatic.config', './a'); | ||
updateConfig({ | ||
server: config.server.host ? {} : { | ||
host: '127.0.0.1' | ||
}, | ||
vite: { | ||
plugins: [{ | ||
name: 'keystatic', | ||
resolveId(id) { | ||
if (id === 'virtual:keystatic-config') { | ||
return this.resolve('./keystatic.config', './a'); | ||
} | ||
return null; | ||
} | ||
return null; | ||
}], | ||
optimizeDeps: { | ||
entries: ['keystatic.config.*', '.astro/keystatic-imports.js'] | ||
} | ||
}], | ||
optimizeDeps: { | ||
entries: ['keystatic.config.*', '.astro/keystatic-imports.js'] | ||
} | ||
}; | ||
const dotAstroDir = path.join(fileURLToPath(config.root), '.astro'); | ||
await fs.mkdir(dotAstroDir, { | ||
}); | ||
const dotAstroDir = new URL('./.astro/', config.root); | ||
mkdirSync(dotAstroDir, { | ||
recursive: true | ||
}); | ||
await fs.writeFile(path.join(dotAstroDir, 'keystatic-imports.js'), `import "@keystatic/astro/ui"; | ||
writeFileSync(new URL('keystatic-imports.js', dotAstroDir), `import "@keystatic/astro/ui"; | ||
import "@keystatic/astro/api"; | ||
import "@keystatic/core/ui"; | ||
`); | ||
updateConfig({ | ||
vite | ||
}); | ||
injectRoute({ | ||
@@ -45,0 +45,0 @@ // @ts-ignore |
{ | ||
"name": "@keystatic/astro", | ||
"version": "0.0.0-test-20240116013622", | ||
"version": "0.0.0-test-20241009232117", | ||
"license": "MIT", | ||
@@ -23,3 +23,4 @@ "repository": { | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"internal" | ||
], | ||
@@ -29,15 +30,13 @@ "dependencies": { | ||
"@types/react": "^18.2.8", | ||
"cookie": "^0.5.0", | ||
"set-cookie-parser": "^2.5.1" | ||
}, | ||
"devDependencies": { | ||
"@keystatic/core": "0.0.0-test-20240116013622", | ||
"@types/cookie": "^0.5.1", | ||
"@types/set-cookie-parser": "^2.4.2", | ||
"astro": "^4.0.3", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
"react-dom": "^18.2.0", | ||
"@keystatic/core": "^0.0.0-test-20241009232117" | ||
}, | ||
"peerDependencies": { | ||
"@keystatic/core": "0.0.0-test-20240116013622", | ||
"@keystatic/core": "0.0.0-test-20241009232117", | ||
"astro": "2 || 3 || 4", | ||
@@ -44,0 +43,0 @@ "react": "^18.2.0", |
10380
7
5
14
185
+ Added@keystar/ui@0.7.15(transitive)
+ Added@keystatic/core@0.0.0-test-20241009232117(transitive)
+ Added@markdoc/markdoc@0.4.0(transitive)
+ Added@react-aria/landmark@3.0.0-beta.15(transitive)
+ Added@react-aria/tag@3.4.9(transitive)
+ Added@react-aria/toast@3.0.0-beta.15(transitive)
+ Added@react-aria/virtualizer@4.1.1(transitive)
+ Added@react-stately/layout@4.1.1(transitive)
+ Added@react-stately/toast@3.0.0-beta.5(transitive)
+ Added@react-stately/virtualizer@4.2.1(transitive)
+ Added@react-types/actionbar@3.1.12(transitive)
+ Added@toeverything/y-indexeddb@0.10.0-canary.9(transitive)
+ Added@urql/exchange-graphcache@7.2.2(transitive)
+ Addedcookie@1.0.2(transitive)
+ Addedevent-target-shim@6.0.2(transitive)
+ Addedidb@7.1.1(transitive)
+ Addedisomorphic.js@0.2.5(transitive)
+ Addedlib0@0.2.99(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addednanoid@5.0.9(transitive)
+ Addedpartysocket@0.0.22(transitive)
+ Addedsuperstruct@1.0.4(transitive)
+ Addedy-prosemirror@1.2.15(transitive)
+ Addedy-protocols@1.0.6(transitive)
+ Addedy-provider@0.10.0-canary.9(transitive)
+ Addedyjs@13.6.23(transitive)
- Removedcookie@^0.5.0
- Removed@keystar/ui@0.0.0-test-20240116013622(transitive)
- Removed@keystatic/core@0.0.0-test-20240116013622(transitive)
- Removed@markdoc/markdoc@0.3.5(transitive)
- Removed@react-aria/landmark@3.0.0-beta.2(transitive)
- Removed@react-aria/toast@3.0.0-beta.2(transitive)
- Removed@react-aria/virtualizer@3.10.1(transitive)
- Removed@react-stately/layout@3.13.9(transitive)
- Removed@react-stately/toast@3.0.0-beta.1(transitive)
- Removed@react-stately/virtualizer@3.7.1(transitive)
- Removed@types/node@16.11.13(transitive)
- Removed@types/react-dom@18.3.5(transitive)
- Removed@urql/core@4.3.0(transitive)
- Removed@urql/exchange-graphcache@6.5.1(transitive)
- Removedcookie@0.5.0(transitive)
- Removediron-webcrypto@0.10.1(transitive)
- Removedjs-base64@3.7.7(transitive)
- Removedlru-cache@7.18.3(transitive)