mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Update deps
This commit is contained in:
parent
e3f8ec505b
commit
8622b75b29
@ -1,7 +1,6 @@
|
|||||||
import { defineConfig } from "astro/config";
|
import { defineConfig } from "astro/config";
|
||||||
import starlight from "@astrojs/starlight";
|
import starlight from "@astrojs/starlight";
|
||||||
|
|
||||||
import sitemap from "@astrojs/sitemap";
|
|
||||||
import { generateSchema } from "./src/schema_generator";
|
import { generateSchema } from "./src/schema_generator";
|
||||||
|
|
||||||
generateSchema("body_schema.json");
|
generateSchema("body_schema.json");
|
||||||
|
|||||||
@ -7,20 +7,21 @@
|
|||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro",
|
||||||
|
"format": "prettier --write ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/starlight": "^0.5.2",
|
"@astrojs/starlight": "^0.13.1",
|
||||||
"astro": "2.7.0",
|
"astro": "3.6.1",
|
||||||
"sharp": "^0.32.1"
|
"sharp": "^0.32.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@apidevtools/json-schema-ref-parser": "^10.1.0",
|
"@apidevtools/json-schema-ref-parser": "^11.1.0",
|
||||||
"eslint": "^8.45.0",
|
"eslint": "^8.54.0",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.1",
|
||||||
"fast-xml-parser": "^4.2.5",
|
"fast-xml-parser": "^4.3.2",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.1.0",
|
||||||
"prettier-plugin-astro": "^0.11.0",
|
"prettier-plugin-astro": "^0.12.2",
|
||||||
"xml-js": "^1.6.11"
|
"xml-js": "^1.6.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
5706
docs/pnpm-lock.yaml
generated
5706
docs/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
import { defineCollection } from 'astro:content';
|
import { defineCollection } from "astro:content";
|
||||||
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
|
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema";
|
||||||
|
|
||||||
export const collections = {
|
export const collections = {
|
||||||
docs: defineCollection({ schema: docsSchema() }),
|
docs: defineCollection({ schema: docsSchema() }),
|
||||||
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
|
i18n: defineCollection({ type: "data", schema: i18nSchema() })
|
||||||
};
|
};
|
||||||
|
|||||||
@ -26,20 +26,18 @@ by Mobius Digital.
|
|||||||
|
|
||||||
<CardGrid stagger>
|
<CardGrid stagger>
|
||||||
<Card title="Create Planets Through JSON" icon="document">
|
<Card title="Create Planets Through JSON" icon="document">
|
||||||
Use declarative JSON to create custom planets without having to write a line
|
Use declarative JSON to create custom planets without having to write a line of code.
|
||||||
of code.
|
|
||||||
</Card>
|
</Card>
|
||||||
<Card title="Custom Star Systems" icon="star">
|
<Card title="Custom Star Systems" icon="star">
|
||||||
Create solar systems seperate from the base game's with its own planets,
|
Create solar systems seperate from the base game's with its own planets, vessel coordinates,
|
||||||
vessel coordinates, and ship log.
|
and ship log.
|
||||||
</Card>
|
</Card>
|
||||||
<Card title="API" icon="forward-slash">
|
<Card title="API" icon="forward-slash">
|
||||||
Interface with various life cycle events and functions during star system
|
Interface with various life cycle events and functions during star system creation with New
|
||||||
creation with New Horizon's API.
|
Horizon's API.
|
||||||
</Card>
|
</Card>
|
||||||
<Card title="Extendable Configs" icon="puzzle">
|
<Card title="Extendable Configs" icon="puzzle">
|
||||||
Use the `extras` key in JSON files to allow extendable functionality with
|
Use the `extras` key in JSON files to allow extendable functionality with other mods.
|
||||||
other mods.
|
|
||||||
</Card>
|
</Card>
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ description: API reference for New Horizons
|
|||||||
Put this in a C# file somewhere in your mod:
|
Put this in a C# file somewhere in your mod:
|
||||||
|
|
||||||
<!-- Auto update this would be cool -->
|
<!-- Auto update this would be cool -->
|
||||||
|
|
||||||
```cs
|
```cs
|
||||||
public interface INewHorizons
|
public interface INewHorizons
|
||||||
{
|
{
|
||||||
|
|||||||
2
docs/src/env.d.ts
vendored
2
docs/src/env.d.ts
vendored
@ -1,2 +1,2 @@
|
|||||||
/// <reference path="../.astro/types.d.ts" />
|
/// <reference path="../.astro/types.d.ts" />
|
||||||
/// <reference types="astro/client-image" />
|
/// <reference types="astro/client" />
|
||||||
|
|||||||
@ -1,19 +1,17 @@
|
|||||||
import { Schema, SchemaTools } from "./schema_utils";
|
import { Schema, SchemaTools } from "./schema_utils";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
|
|
||||||
|
|
||||||
const addFrontmatter = (content: string, frontmatter: Record<string, boolean | string>) => {
|
const addFrontmatter = (content: string, frontmatter: Record<string, boolean | string>) => {
|
||||||
const entries = Object.entries(frontmatter).map(([key, value]) => `${key}: ${value}`)
|
const entries = Object.entries(frontmatter).map(([key, value]) => `${key}: ${value}`);
|
||||||
|
|
||||||
if (entries.length === 0) {
|
if (entries.length === 0) {
|
||||||
return content
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `---\n${entries.join('\n')}\n---\n\n${content}`
|
return `---\n${entries.join("\n")}\n---\n\n${content}`;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const generateSchema = (fileName: string) => {
|
export const generateSchema = (fileName: string) => {
|
||||||
|
|
||||||
const schema = SchemaTools.readSchema(fileName);
|
const schema = SchemaTools.readSchema(fileName);
|
||||||
|
|
||||||
const dir = `src/content/docs/schemas/${schema.slug}`;
|
const dir = `src/content/docs/schemas/${schema.slug}`;
|
||||||
@ -28,8 +26,7 @@ export const generateSchema = (fileName: string) => {
|
|||||||
editUrl: false
|
editUrl: false
|
||||||
};
|
};
|
||||||
|
|
||||||
const content = `import Schema from "/src/components/Schemas/Schema.astro";\n\n<Schema fileName="${schema.fileName}" />\n`
|
const content = `import Schema from "/src/components/Schemas/Schema.astro";\n\n<Schema fileName="${schema.fileName}" />\n`;
|
||||||
|
|
||||||
fs.writeFileSync(`${dir}/index.mdx`, addFrontmatter(content, frontMatter))
|
|
||||||
|
|
||||||
|
fs.writeFileSync(`${dir}/index.mdx`, addFrontmatter(content, frontMatter));
|
||||||
};
|
};
|
||||||
|
|||||||
@ -167,7 +167,7 @@ export const SchemaTools = {
|
|||||||
type: "JSON",
|
type: "JSON",
|
||||||
val: { title: key, ...val }
|
val: { title: key, ...val }
|
||||||
}
|
}
|
||||||
} as Schema)
|
}) as Schema
|
||||||
);
|
);
|
||||||
case "XML":
|
case "XML":
|
||||||
let node = schema.internalSchema.val;
|
let node = schema.internalSchema.val;
|
||||||
@ -190,7 +190,7 @@ export const SchemaTools = {
|
|||||||
type: "XML",
|
type: "XML",
|
||||||
val: d
|
val: d
|
||||||
}
|
}
|
||||||
} as Schema)
|
}) as Schema
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user