yarn updated to 4.11, prep for refactoring
This commit is contained in:
parent
a5fcc7b5e9
commit
9b2ec20636
11 changed files with 21561 additions and 447 deletions
2
.env.development
Normal file
2
.env.development
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
VERSION_FILE_PATH="./versions.json"
|
||||||
|
BASE_URL="localhost:4321"
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -27,4 +27,7 @@ modules/
|
||||||
modules_old/
|
modules_old/
|
||||||
|
|
||||||
# env
|
# env
|
||||||
.env*
|
.env.production
|
||||||
|
|
||||||
|
# module archive
|
||||||
|
*.tar.gz
|
||||||
|
|
|
||||||
18556
.pnp.cjs
generated
Executable file
18556
.pnp.cjs
generated
Executable file
File diff suppressed because one or more lines are too long
2126
.pnp.loader.mjs
generated
Normal file
2126
.pnp.loader.mjs
generated
Normal file
File diff suppressed because it is too large
Load diff
4
.vim/coc-settings.json
Normal file
4
.vim/coc-settings.json
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"workspace.workspaceFolderCheckCwd": false,
|
||||||
|
"tsserver.tsdk": ".yarn/sdks/typescript/lib"
|
||||||
|
}
|
||||||
1
.yarnrc.yml
Normal file
1
.yarnrc.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
nodeLinker: pnp
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"formatWithErrors": true,
|
"formatWithErrors": true,
|
||||||
25
package.json
25
package.json
|
|
@ -11,17 +11,16 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ark-ui/solid": "^3.5.0",
|
"@ark-ui/solid": "^3.5.0",
|
||||||
"@astrojs/check": "^0.9.4",
|
"@astrojs/check": "0.9.5",
|
||||||
"@astrojs/markdown-remark": "^6.3.1",
|
"@astrojs/markdown-remark": "6.3.8",
|
||||||
"@astrojs/mdx": "^4.2.6",
|
"@astrojs/mdx": "4.3.10",
|
||||||
"@astrojs/sitemap": "^3.4.0",
|
"@astrojs/sitemap": "3.6.0",
|
||||||
"@astrojs/solid-js": "^5.0.10",
|
"@astrojs/solid-js": "5.1.3",
|
||||||
"@fontsource-variable/rubik": "^5.1.0",
|
"@fontsource-variable/rubik": "^5.1.0",
|
||||||
"@hbsnow/rehype-sectionize": "^1.0.7",
|
"@hbsnow/rehype-sectionize": "^1.0.7",
|
||||||
"@pagefind/default-ui": "^1.1.1",
|
"@pagefind/default-ui": "^1.1.1",
|
||||||
"@shikijs/rehype": "^3.4.2",
|
"@shikijs/rehype": "^3.4.2",
|
||||||
"@types/node": "^20.14.11",
|
"astro": "5.15.5",
|
||||||
"astro": "^5.7.13",
|
|
||||||
"astro-breadcrumbs": "^3.3.1",
|
"astro-breadcrumbs": "^3.3.1",
|
||||||
"astro-icon": "^1.1.5",
|
"astro-icon": "^1.1.5",
|
||||||
"hast": "^1.0.0",
|
"hast": "^1.0.0",
|
||||||
|
|
@ -29,14 +28,18 @@
|
||||||
"remark-github-blockquote-alert": "^1.2.1",
|
"remark-github-blockquote-alert": "^1.2.1",
|
||||||
"solid-devtools": "^0.30.1",
|
"solid-devtools": "^0.30.1",
|
||||||
"solid-js": "^1.8.18",
|
"solid-js": "^1.8.18",
|
||||||
"typescript": "^5.5.3",
|
|
||||||
"unified": "^11.0.5",
|
"unified": "^11.0.5",
|
||||||
"unist-util-visit": "^5.0.0"
|
"unist-util-visit": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/ts-plugin": "^1.10.3",
|
"@astrojs/ts-plugin": "1.10.5",
|
||||||
|
"@babel/core": "^7.28.5",
|
||||||
|
"@babel/plugin-syntax-typescript": "^7.27.1",
|
||||||
"@biomejs/biome": "^1.8.3",
|
"@biomejs/biome": "^1.8.3",
|
||||||
"pagefind": "^1.1.1"
|
"@types/babel__core": "^7",
|
||||||
|
"@types/node": "^20.14.11",
|
||||||
|
"pagefind": "^1.1.1",
|
||||||
|
"typescript": "^5.9.3"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@4.5.0"
|
"packageManager": "yarn@4.11.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
0
src/config/io/envEntry.ts
Normal file
0
src/config/io/envEntry.ts
Normal file
|
|
@ -3,10 +3,13 @@ import path from "node:path";
|
||||||
|
|
||||||
import type { VersionsData, ModuleData } from "./types";
|
import type { VersionsData, ModuleData } from "./types";
|
||||||
|
|
||||||
async function readModulesData(basePath: string): Promise<ModuleData[]> {
|
async function readModulesData(
|
||||||
|
basePath: string
|
||||||
|
): Promise<ModuleData[]> {
|
||||||
const moduleDirs = await fs.readdir(basePath);
|
const moduleDirs = await fs.readdir(basePath);
|
||||||
|
|
||||||
const modules = await Promise.all(moduleDirs.map(async moduleDir => {
|
const modules = await Promise.all(
|
||||||
|
moduleDirs.map(async moduleDir => {
|
||||||
const modulePath = path.join(basePath, moduleDir);
|
const modulePath = path.join(basePath, moduleDir);
|
||||||
|
|
||||||
const indexPromise = async () => {
|
const indexPromise = async () => {
|
||||||
|
|
@ -15,22 +18,28 @@ async function readModulesData(basePath: string): Promise<ModuleData[]> {
|
||||||
return JSON.parse(indexContent);
|
return JSON.parse(indexContent);
|
||||||
};
|
};
|
||||||
|
|
||||||
const typeNames = (await fs.readdir(modulePath)).filter(name => name !== "index.json");
|
const typeNames = (await fs.readdir(modulePath)).filter(
|
||||||
|
name => name !== "index.json"
|
||||||
|
);
|
||||||
const typePromises = typeNames.map(async fileName => {
|
const typePromises = typeNames.map(async fileName => {
|
||||||
const typePath = path.join(modulePath, fileName);
|
const typePath = path.join(modulePath, fileName);
|
||||||
const fileContent = await fs.readFile(typePath, "utf8");
|
const fileContent = await fs.readFile(typePath, "utf8");
|
||||||
return JSON.parse(fileContent);
|
return JSON.parse(fileContent);
|
||||||
});
|
});
|
||||||
|
|
||||||
const [index, ...types] = await Promise.all([indexPromise(), ...typePromises]);
|
const [index, ...types] = await Promise.all([
|
||||||
|
indexPromise(),
|
||||||
|
...typePromises,
|
||||||
|
]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: index.name,
|
name: index.name,
|
||||||
description: index.description,
|
description: index.description,
|
||||||
details: index.details,
|
details: index.details,
|
||||||
types,
|
types,
|
||||||
}
|
};
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
return modules;
|
return modules;
|
||||||
}
|
}
|
||||||
|
|
@ -44,19 +53,31 @@ async function readVersionsData(): Promise<VersionsData> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resolvedPath = path.join(process.cwd(), versionsPath);
|
||||||
|
console.log(resolvedPath);
|
||||||
const content = await fs.readFile(versionsPath, "utf8");
|
const content = await fs.readFile(versionsPath, "utf8");
|
||||||
const data = JSON.parse(content);
|
const data = JSON.parse(content);
|
||||||
|
|
||||||
const versions = await Promise.all(data.versions.map(async (d: { name: string, changelog?: string, types: any }) => ({
|
const versions = await Promise.all(
|
||||||
|
data.versions.map(
|
||||||
|
async (d: {
|
||||||
|
name: string;
|
||||||
|
changelog?: string;
|
||||||
|
types: any;
|
||||||
|
}) => ({
|
||||||
name: d.name,
|
name: d.name,
|
||||||
changelog: d.changelog ? await fs.readFile(d.changelog, "utf8") : undefined,
|
changelog: d.changelog
|
||||||
|
? await fs.readFile(d.changelog, "utf8")
|
||||||
|
: undefined,
|
||||||
modules: await readModulesData(d.types),
|
modules: await readModulesData(d.types),
|
||||||
})));
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
versions,
|
versions,
|
||||||
default: data.default,
|
default: data.default,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let globalVersionsData: Promise<VersionsData>;
|
let globalVersionsData: Promise<VersionsData>;
|
||||||
|
|
@ -71,5 +92,6 @@ export function getVersionsData(): Promise<VersionsData> {
|
||||||
|
|
||||||
export async function getModulesData(): Promise<ModuleData[]> {
|
export async function getModulesData(): Promise<ModuleData[]> {
|
||||||
const versions = await getVersionsData();
|
const versions = await getVersionsData();
|
||||||
return versions.versions.find(v => v.name === versions.default)!.modules;
|
return versions.versions.find(v => v.name === versions.default)!
|
||||||
|
.modules;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue