Skip to content

Commit

Permalink
chore(update): remove execa
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuhito committed Dec 29, 2024
1 parent a61dd57 commit e889bb4
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 201 deletions.
Binary file modified bun.lockb
Binary file not shown.
143 changes: 70 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,72 @@
{
"name": "google-font-metadata",
"description": "A metadata generator for Google Fonts.",
"version": "5.2.1",
"author": "Ayuhito <hello@ayuhito.com>",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"bin": {
"gfm": "./dist/cli.mjs"
},
"license": "MIT",
"keywords": [
"fontsource",
"font",
"font family",
"google fonts",
"metadata",
"fonts api",
"unicode range"
],
"dependencies": {
"@octokit/core": "^6.1.2",
"@types/stylis": "^4.2.7",
"cac": "^6.7.14",
"consola": "^3.3.3",
"deepmerge": "^4.3.1",
"dotenv": "^16.4.7",
"execa": "^9.5.2",
"json-stringify-pretty-compact": "^4.0.0",
"linkedom": "^0.18.6",
"p-queue": "^8.0.1",
"pathe": "^1.1.2",
"picocolors": "^1.1.1",
"puppeteer": "^23.11.1",
"stylis": "^4.3.4",
"zod": "^3.24.1"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/node": "^22.10.2",
"c8": "^10.1.3",
"magic-string": "^0.30.17",
"msw": "^2.7.0",
"pkgroll": "^2.6.0",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
},
"scripts": {
"build": "pkgroll --target=node20",
"dev": "pkgroll --target=node20 --watch",
"cli": "bun run ./src/cli.ts",
"test": "vitest",
"test:generate-fixtures": "bun run ./tests/utils/generate-css-fixtures",
"coverage": "vitest --coverage",
"format": "biome format --fix",
"lint": "biome lint --fix",
"prepublish": "npm run format && npm run build"
},
"files": ["dist/*", "data/*"],
"homepage": "https://github.com/fontsource/google-font-metadata",
"repository": {
"type": "git",
"url": "git+https://github.com/fontsource/google-font-metadata"
},
"packageManager": "pnpm@8.3.1",
"trustedDependencies": [
"@biomejs/biome"
]
"name": "google-font-metadata",
"description": "A metadata generator for Google Fonts.",
"version": "5.2.1",
"author": "Ayuhito <hello@ayuhito.com>",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"bin": {
"gfm": "./dist/cli.mjs"
},
"license": "MIT",
"keywords": [
"fontsource",
"font",
"font family",
"google fonts",
"metadata",
"fonts api",
"unicode range"
],
"dependencies": {
"@octokit/core": "^6.1.2",
"@types/stylis": "^4.2.7",
"cac": "^6.7.14",
"consola": "^3.3.3",
"deepmerge": "^4.3.1",
"dotenv": "^16.4.7",
"json-stringify-pretty-compact": "^4.0.0",
"linkedom": "^0.18.6",
"p-queue": "^8.0.1",
"pathe": "^1.1.2",
"picocolors": "^1.1.1",
"puppeteer": "^23.11.1",
"stylis": "^4.3.4",
"zod": "^3.24.1"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@types/node": "^22.10.2",
"c8": "^10.1.3",
"magic-string": "^0.30.17",
"msw": "^2.7.0",
"pkgroll": "^2.6.0",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
},
"scripts": {
"build": "pkgroll --target=node20",
"dev": "pkgroll --target=node20 --watch",
"cli": "bun run ./src/cli.ts",
"test": "vitest",
"test:generate-fixtures": "bun run ./tests/utils/generate-css-fixtures",
"coverage": "vitest --coverage",
"format": "biome format --fix",
"lint": "biome lint --fix",
"prepublish": "npm run format && npm run build"
},
"files": ["dist/*", "data/*"],
"homepage": "https://github.com/fontsource/google-font-metadata",
"repository": {
"type": "git",
"url": "git+https://github.com/fontsource/google-font-metadata"
},
"packageManager": "pnpm@8.3.1",
"trustedDependencies": ["@biomejs/biome"]
}
1 change: 0 additions & 1 deletion src/api-parser-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ const processQueue = async (font: APIResponse, force: boolean) => {
// Queue control
const queue = new PQueue({ concurrency: 18 });

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore - rollup-plugin-dts fails to compile this typing
queue.on('error', (error: Error) => {
consola.error(error);
Expand Down
1 change: 0 additions & 1 deletion src/api-parser-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ const processQueue = async (font: APIResponse, force: boolean) => {
// Queue control
const queue = new PQueue({ concurrency: 18 });

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore - rollup-plugin-dts fails to compile this typing
queue.on('error', (error: Error) => {
consola.error(error);
Expand Down
2 changes: 0 additions & 2 deletions src/axis-gen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-await-in-loop */
import * as fs from 'node:fs/promises';
import { fileURLToPath } from 'node:url';

Expand Down Expand Up @@ -94,7 +93,6 @@ export const parseProto = (textproto: string): AxisDecode => {
return acceptedTags.has(tag);
});

// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
const data = {} as AxisDecode;

for (const line of lines) {
Expand Down
16 changes: 1 addition & 15 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable unicorn/no-process-exit */
import 'dotenv/config';

import { cac } from 'cac';
Expand All @@ -12,12 +11,11 @@ import { parsev2 } from './api-parser-v2';
import { generateAxis } from './axis-gen';
import { parseIcons } from './icons-parser';
import { parseLicenses } from './license';
import { updateDb } from './update-db';
import { validateCLI } from './validate';
import { fetchVariable } from './variable-gen';
import { parseVariable } from './variable-parser';

const cli = cac('google-font-metadata');
const cli = cac('gfm');

cli
.command('generate [key]', 'Fetch parsing metadata for all fonts')
Expand Down Expand Up @@ -154,18 +152,6 @@ cli
}
});

cli
.command('update-db', 'Update metadata db by updating lockfile')
.action(async () => {
try {
await updateDb();
consola.success('Metadata updated!');
} catch (error) {
consola.error(error);
process.exit(1);
}
});

cli.help();
cli.version(version);

Expand Down
1 change: 0 additions & 1 deletion src/icons-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const processQueue = async (icon: APIIconResponse, force: boolean) => {
// Queue control
const queue = new PQueue({ concurrency: 18 });

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore - rollup-plugin-dts fails to compile this typing
queue.on('error', (error: Error) => {
consola.error(error);
Expand Down
4 changes: 2 additions & 2 deletions src/license.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { consola } from 'consola';
import stringify from 'json-stringify-pretty-compact';
import { parseHTML } from 'linkedom';
import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'pathe';
import puppeteer from 'puppeteer';

Expand Down
2 changes: 1 addition & 1 deletion src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import stringify from 'json-stringify-pretty-compact';
import colors from 'picocolors';
import { z, type ZodError } from 'zod';
import { type ZodError, z } from 'zod';

import type { FontObject, FontObjectV2, FontObjectVariable } from './types';
import { isAxesKey } from './types';
Expand Down
92 changes: 0 additions & 92 deletions src/update-db.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/validate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { consola } from 'consola';
import colors from 'picocolors';

import { APIv1, APIv2, APIVariable } from './data';
import { APIVariable, APIv1, APIv2 } from './data';
import { fontObjectValidate, fontObjectVariableValidate } from './schema';
import type { FontObject } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/variable-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const processTable = (tableHTML: string) => {

// Build variable font object
type ResultsObject = Record<string, FontObjectVariableDirect>;
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions

let results = {} as ResultsObject;
for (const [index, id] of fontIds.entries()) {
const variableObject = {
Expand Down
2 changes: 0 additions & 2 deletions src/variable-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ export const fetchCSS = async (url: string) => {

// [key, css]
export const fetchAllCSS = async (links: Links) =>
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
await (Promise.all(
Object.keys(links).map(async (key) => [key, await fetchCSS(links[key])]),
) as Promise<string[][]>); // Additional type assertion needed for pkgroll dts plugin
Expand Down Expand Up @@ -266,7 +265,6 @@ const processQueue = async (font: FontObjectVariableDirect) => {
// Queue control
const queue = new PQueue({ concurrency: 10 });

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore - rollup-plugin-dts fails to compile this typing
queue.on('error', (error: Error) => {
consola.error(error);
Expand Down
1 change: 0 additions & 1 deletion tests/api-parser-v1.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-await-in-loop */
import * as fs from 'node:fs/promises';

import stringify from 'json-stringify-pretty-compact';
Expand Down
Loading

0 comments on commit e889bb4

Please sign in to comment.