mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
9219d5e1c0
commit
2a8580c251
1 changed files with 9 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { globby as glob } from 'globby';
|
import { globby as glob } from 'globby';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { readFile } from 'node:fs/promises'
|
import { readFile } from 'node:fs/promises';
|
||||||
|
|
||||||
const baseUrl = new URL('https://github.com/withastro/astro/blob/main/');
|
const baseUrl = new URL('https://github.com/withastro/astro/blob/main/');
|
||||||
|
|
||||||
|
@ -57,12 +57,14 @@ function singularlize(text) {
|
||||||
const packageMap = new Map();
|
const packageMap = new Map();
|
||||||
async function generatePackageMap() {
|
async function generatePackageMap() {
|
||||||
const packageRoot = new URL('../../packages/', import.meta.url);
|
const packageRoot = new URL('../../packages/', import.meta.url);
|
||||||
const packages = await glob(['*/package.json', '*/*/package.json'], { cwd: fileURLToPath(packageRoot) })
|
const packages = await glob(['*/package.json', '*/*/package.json'], { cwd: fileURLToPath(packageRoot) });
|
||||||
await Promise.all(packages.map(async (pkg) => {
|
await Promise.all(
|
||||||
const pkgFile = fileURLToPath(new URL(pkg, packageRoot));
|
packages.map(async (pkg) => {
|
||||||
const content = await readFile(pkgFile).then(res => JSON.parse(res.toString()))
|
const pkgFile = fileURLToPath(new URL(pkg, packageRoot));
|
||||||
packageMap.set(content.name, `./packages/${pkg.replace('/package.json', '')}`);
|
const content = await readFile(pkgFile).then((res) => JSON.parse(res.toString()));
|
||||||
}))
|
packageMap.set(content.name, `./packages/${pkg.replace('/package.json', '')}`);
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
|
|
Loading…
Reference in a new issue