New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@keystatic/astro

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keystatic/astro - npm Package Compare versions

Comparing version 0.0.0-test-20240116013622 to 0.0.0-test-20241009232117

internal/keystatic-api.js

46

dist/keystatic-astro.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc