From 2e2f513f457ab8bad64c5ebf5379bab9a47ee6dc Mon Sep 17 00:00:00 2001 From: roll Date: Tue, 2 Sep 2025 12:09:40 +0100 Subject: [PATCH 1/3] Renamed dpkit to @dpkit/all --- .changeset/eight-wasps-watch.md | 5 + CONTRIBUTING.md | 6 +- {dpkit => all}/CHANGELOG.md | 0 {dpkit => all}/README.md | 0 {dpkit => all}/dialect/index.ts | 0 {dpkit => all}/dialect/infer.ts | 0 {dpkit => all}/index.ts | 0 {dpkit => all}/package.json | 2 +- {dpkit => all}/package/index.ts | 0 {dpkit => all}/package/infer.ts | 0 {dpkit => all}/package/load.ts | 0 {dpkit => all}/package/save.ts | 0 {dpkit => all}/package/validate.ts | 0 {dpkit => all}/plugin.ts | 0 {dpkit => all}/resource/index.ts | 0 {dpkit => all}/resource/infer.ts | 0 {dpkit => all}/resource/validate.ts | 0 {dpkit => all}/table/index.ts | 0 {dpkit => all}/table/infer.ts | 0 {dpkit => all}/table/load.ts | 0 {dpkit => all}/table/read.ts | 0 {dpkit => all}/table/save.ts | 0 {dpkit => all}/table/validate.ts | 0 {cli => all}/tsconfig.json | 0 {dpkit => all}/typedoc.json | 0 cli/CHANGELOG.md | 36 ---- cli/README.md | 3 - cli/commander.d.ts | 3 - cli/commands/dialect/errors.tsx | 62 ------ cli/commands/dialect/index.ts | 15 -- cli/commands/dialect/infer.tsx | 34 ---- cli/commands/dialect/show.tsx | 52 ----- cli/commands/dialect/validate.tsx | 63 ------ cli/commands/file/copy.ts | 41 ---- cli/commands/file/errors.tsx | 41 ---- cli/commands/file/index.ts | 15 -- cli/commands/file/stats.tsx | 42 ---- cli/commands/file/validate.tsx | 41 ---- cli/commands/package/archive.ts | 31 --- cli/commands/package/copy.ts | 31 --- cli/commands/package/errors.tsx | 29 --- cli/commands/package/index.ts | 21 -- cli/commands/package/infer.tsx | 35 ---- cli/commands/package/publish/ckan.ts | 59 ------ cli/commands/package/publish/github.ts | 52 ----- cli/commands/package/publish/index.ts | 13 -- cli/commands/package/publish/zenodo.ts | 45 ----- cli/commands/package/show.tsx | 25 --- cli/commands/package/validate.tsx | 35 ---- cli/commands/resource/errors.tsx | 37 ---- cli/commands/resource/index.ts | 15 -- cli/commands/resource/infer.tsx | 42 ---- cli/commands/resource/show.tsx | 44 ----- cli/commands/resource/validate.tsx | 37 ---- cli/commands/schema/errors.tsx | 62 ------ cli/commands/schema/index.ts | 15 -- cli/commands/schema/infer.tsx | 44 ----- cli/commands/schema/show.tsx | 52 ----- cli/commands/schema/validate.tsx | 63 ------ cli/commands/table/convert.tsx | 91 --------- cli/commands/table/errors.tsx | 56 ------ cli/commands/table/explore.tsx | 49 ----- cli/commands/table/index.ts | 21 -- cli/commands/table/query.tsx | 39 ---- cli/commands/table/script.tsx | 52 ----- cli/commands/table/stats.tsx | 54 ------ cli/commands/table/validate.tsx | 40 ---- cli/components/DataGrid.tsx | 96 ---------- cli/components/DialectGrid.tsx | 11 -- cli/components/PackageGrid.tsx | 18 -- cli/components/ReportGrid.tsx | 46 ----- cli/components/ResourceGrid.tsx | 11 -- cli/components/SchemaGrid.tsx | 15 -- cli/components/TableGrid.tsx | 155 --------------- cli/entrypoints/dev.cmd | 3 - cli/entrypoints/dev.ts | 3 - cli/entrypoints/run.cmd | 3 - cli/entrypoints/run.ts | 3 - cli/helpers/dialect.ts | 163 ---------------- cli/helpers/help.ts | 6 - cli/helpers/object.ts | 3 - cli/helpers/resource.ts | 42 ---- cli/helpers/session.ts | 100 ---------- cli/main.ts | 30 --- cli/package.json | 53 ----- cli/params/ckan.ts | 18 -- cli/params/dialect.ts | 181 ------------------ cli/params/file.ts | 12 -- cli/params/github.ts | 16 -- cli/params/index.ts | 7 - cli/params/json.ts | 3 - cli/params/package.ts | 16 -- cli/params/path.ts | 43 ----- cli/params/resource.ts | 6 - cli/params/zenodo.ts | 11 -- cli/program.ts | 22 --- cli/scripts/compile.ts | 24 --- docs/astro.config.ts | 2 +- docs/content/docs/guides/csv.md | 2 +- docs/content/docs/guides/ods.md | 16 +- docs/content/docs/guides/visidata.md | 2 +- docs/content/docs/guides/xlsx.md | 18 +- docs/content/docs/index.md | 14 +- docs/content/docs/overview/getting-started.md | 156 --------------- docs/package.json | 2 +- dpkit/tsconfig.json | 3 - pnpm-workspace.yaml | 3 +- 107 files changed, 38 insertions(+), 2950 deletions(-) create mode 100644 .changeset/eight-wasps-watch.md rename {dpkit => all}/CHANGELOG.md (100%) rename {dpkit => all}/README.md (100%) rename {dpkit => all}/dialect/index.ts (100%) rename {dpkit => all}/dialect/infer.ts (100%) rename {dpkit => all}/index.ts (100%) rename {dpkit => all}/package.json (97%) rename {dpkit => all}/package/index.ts (100%) rename {dpkit => all}/package/infer.ts (100%) rename {dpkit => all}/package/load.ts (100%) rename {dpkit => all}/package/save.ts (100%) rename {dpkit => all}/package/validate.ts (100%) rename {dpkit => all}/plugin.ts (100%) rename {dpkit => all}/resource/index.ts (100%) rename {dpkit => all}/resource/infer.ts (100%) rename {dpkit => all}/resource/validate.ts (100%) rename {dpkit => all}/table/index.ts (100%) rename {dpkit => all}/table/infer.ts (100%) rename {dpkit => all}/table/load.ts (100%) rename {dpkit => all}/table/read.ts (100%) rename {dpkit => all}/table/save.ts (100%) rename {dpkit => all}/table/validate.ts (100%) rename {cli => all}/tsconfig.json (100%) rename {dpkit => all}/typedoc.json (100%) delete mode 100644 cli/CHANGELOG.md delete mode 100644 cli/README.md delete mode 100644 cli/commander.d.ts delete mode 100644 cli/commands/dialect/errors.tsx delete mode 100644 cli/commands/dialect/index.ts delete mode 100644 cli/commands/dialect/infer.tsx delete mode 100644 cli/commands/dialect/show.tsx delete mode 100644 cli/commands/dialect/validate.tsx delete mode 100644 cli/commands/file/copy.ts delete mode 100644 cli/commands/file/errors.tsx delete mode 100644 cli/commands/file/index.ts delete mode 100644 cli/commands/file/stats.tsx delete mode 100644 cli/commands/file/validate.tsx delete mode 100644 cli/commands/package/archive.ts delete mode 100644 cli/commands/package/copy.ts delete mode 100644 cli/commands/package/errors.tsx delete mode 100644 cli/commands/package/index.ts delete mode 100644 cli/commands/package/infer.tsx delete mode 100644 cli/commands/package/publish/ckan.ts delete mode 100644 cli/commands/package/publish/github.ts delete mode 100644 cli/commands/package/publish/index.ts delete mode 100644 cli/commands/package/publish/zenodo.ts delete mode 100644 cli/commands/package/show.tsx delete mode 100644 cli/commands/package/validate.tsx delete mode 100644 cli/commands/resource/errors.tsx delete mode 100644 cli/commands/resource/index.ts delete mode 100644 cli/commands/resource/infer.tsx delete mode 100644 cli/commands/resource/show.tsx delete mode 100644 cli/commands/resource/validate.tsx delete mode 100644 cli/commands/schema/errors.tsx delete mode 100644 cli/commands/schema/index.ts delete mode 100644 cli/commands/schema/infer.tsx delete mode 100644 cli/commands/schema/show.tsx delete mode 100644 cli/commands/schema/validate.tsx delete mode 100644 cli/commands/table/convert.tsx delete mode 100644 cli/commands/table/errors.tsx delete mode 100644 cli/commands/table/explore.tsx delete mode 100644 cli/commands/table/index.ts delete mode 100644 cli/commands/table/query.tsx delete mode 100644 cli/commands/table/script.tsx delete mode 100644 cli/commands/table/stats.tsx delete mode 100644 cli/commands/table/validate.tsx delete mode 100644 cli/components/DataGrid.tsx delete mode 100644 cli/components/DialectGrid.tsx delete mode 100644 cli/components/PackageGrid.tsx delete mode 100644 cli/components/ReportGrid.tsx delete mode 100644 cli/components/ResourceGrid.tsx delete mode 100644 cli/components/SchemaGrid.tsx delete mode 100644 cli/components/TableGrid.tsx delete mode 100644 cli/entrypoints/dev.cmd delete mode 100755 cli/entrypoints/dev.ts delete mode 100644 cli/entrypoints/run.cmd delete mode 100755 cli/entrypoints/run.ts delete mode 100644 cli/helpers/dialect.ts delete mode 100644 cli/helpers/help.ts delete mode 100644 cli/helpers/object.ts delete mode 100644 cli/helpers/resource.ts delete mode 100644 cli/helpers/session.ts delete mode 100644 cli/main.ts delete mode 100644 cli/package.json delete mode 100644 cli/params/ckan.ts delete mode 100644 cli/params/dialect.ts delete mode 100644 cli/params/file.ts delete mode 100644 cli/params/github.ts delete mode 100644 cli/params/index.ts delete mode 100644 cli/params/json.ts delete mode 100644 cli/params/package.ts delete mode 100644 cli/params/path.ts delete mode 100644 cli/params/resource.ts delete mode 100644 cli/params/zenodo.ts delete mode 100644 cli/program.ts delete mode 100644 cli/scripts/compile.ts delete mode 100644 docs/content/docs/overview/getting-started.md delete mode 100644 dpkit/tsconfig.json diff --git a/.changeset/eight-wasps-watch.md b/.changeset/eight-wasps-watch.md new file mode 100644 index 00000000..fb58285b --- /dev/null +++ b/.changeset/eight-wasps-watch.md @@ -0,0 +1,5 @@ +--- +"@dpkit/all": minor +--- + +Renamed dpkit to @dpkit/all diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67c6c799..01baa0f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ Project is a monorepo with the following packages: - `@dpkit/table`: Table-related functionality - `@dpkit/cli`: Command-line interface for running tasks - `@dpkit/`: Domain-specific functionality -- `dpkit`: All-in-one package that re-exports all functionality +- `@dpkit/all`: All-in-one package that re-exports all functionality ## Development Environment @@ -27,8 +27,8 @@ Project is a monorepo with the following packages: 1. Clone the repository ```bash - git clone https://github.com/yourusername/dpkit.ts.git dpkit - cd dpkit + git clone https://github.com/yourusername/dpkit-typescript.ts.git dpkit-typescript + cd dpkit-typescript ``` 2. Install dependencies diff --git a/dpkit/CHANGELOG.md b/all/CHANGELOG.md similarity index 100% rename from dpkit/CHANGELOG.md rename to all/CHANGELOG.md diff --git a/dpkit/README.md b/all/README.md similarity index 100% rename from dpkit/README.md rename to all/README.md diff --git a/dpkit/dialect/index.ts b/all/dialect/index.ts similarity index 100% rename from dpkit/dialect/index.ts rename to all/dialect/index.ts diff --git a/dpkit/dialect/infer.ts b/all/dialect/infer.ts similarity index 100% rename from dpkit/dialect/infer.ts rename to all/dialect/infer.ts diff --git a/dpkit/index.ts b/all/index.ts similarity index 100% rename from dpkit/index.ts rename to all/index.ts diff --git a/dpkit/package.json b/all/package.json similarity index 97% rename from dpkit/package.json rename to all/package.json index e2335ab1..6be1fe6e 100644 --- a/dpkit/package.json +++ b/all/package.json @@ -1,5 +1,5 @@ { - "name": "dpkit", + "name": "@dpkit/all", "type": "module", "version": "0.8.0", "exports": "./build/index.js", diff --git a/dpkit/package/index.ts b/all/package/index.ts similarity index 100% rename from dpkit/package/index.ts rename to all/package/index.ts diff --git a/dpkit/package/infer.ts b/all/package/infer.ts similarity index 100% rename from dpkit/package/infer.ts rename to all/package/infer.ts diff --git a/dpkit/package/load.ts b/all/package/load.ts similarity index 100% rename from dpkit/package/load.ts rename to all/package/load.ts diff --git a/dpkit/package/save.ts b/all/package/save.ts similarity index 100% rename from dpkit/package/save.ts rename to all/package/save.ts diff --git a/dpkit/package/validate.ts b/all/package/validate.ts similarity index 100% rename from dpkit/package/validate.ts rename to all/package/validate.ts diff --git a/dpkit/plugin.ts b/all/plugin.ts similarity index 100% rename from dpkit/plugin.ts rename to all/plugin.ts diff --git a/dpkit/resource/index.ts b/all/resource/index.ts similarity index 100% rename from dpkit/resource/index.ts rename to all/resource/index.ts diff --git a/dpkit/resource/infer.ts b/all/resource/infer.ts similarity index 100% rename from dpkit/resource/infer.ts rename to all/resource/infer.ts diff --git a/dpkit/resource/validate.ts b/all/resource/validate.ts similarity index 100% rename from dpkit/resource/validate.ts rename to all/resource/validate.ts diff --git a/dpkit/table/index.ts b/all/table/index.ts similarity index 100% rename from dpkit/table/index.ts rename to all/table/index.ts diff --git a/dpkit/table/infer.ts b/all/table/infer.ts similarity index 100% rename from dpkit/table/infer.ts rename to all/table/infer.ts diff --git a/dpkit/table/load.ts b/all/table/load.ts similarity index 100% rename from dpkit/table/load.ts rename to all/table/load.ts diff --git a/dpkit/table/read.ts b/all/table/read.ts similarity index 100% rename from dpkit/table/read.ts rename to all/table/read.ts diff --git a/dpkit/table/save.ts b/all/table/save.ts similarity index 100% rename from dpkit/table/save.ts rename to all/table/save.ts diff --git a/dpkit/table/validate.ts b/all/table/validate.ts similarity index 100% rename from dpkit/table/validate.ts rename to all/table/validate.ts diff --git a/cli/tsconfig.json b/all/tsconfig.json similarity index 100% rename from cli/tsconfig.json rename to all/tsconfig.json diff --git a/dpkit/typedoc.json b/all/typedoc.json similarity index 100% rename from dpkit/typedoc.json rename to all/typedoc.json diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md deleted file mode 100644 index 13ed317d..00000000 --- a/cli/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -# @dpkit/cli - -## 0.4.1 - -### Patch Changes - -- Updated dependencies [e150cb8] - - dpkit@0.8.0 - -## 0.4.0 - -### Minor Changes - -- 084ea52: Improved CLI implementation - -### Patch Changes - -- Updated dependencies [084ea52] - - dpkit@0.7.0 - -## 0.3.0 - -### Minor Changes - -- 313a275: Added Json/Jsonl/Arrow/Parquet support; Bootstrapped CLI - -### Patch Changes - -- Updated dependencies [313a275] - - dpkit@0.6.0 - -## 0.2.0 - -### Minor Changes - -- edfde49: General framework improvements diff --git a/cli/README.md b/cli/README.md deleted file mode 100644 index cd813a7f..00000000 --- a/cli/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @dpkit/cli - -dpkit is a fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames. It supports various formats like CSV, JSON, and Parquet and integrates with data platforms such as CKAN, Zenodo, and GitHub. For more information, please visit the [documentation portal](https://dpkit.datist.io). diff --git a/cli/commander.d.ts b/cli/commander.d.ts deleted file mode 100644 index abd5017f..00000000 --- a/cli/commander.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module "commander" { - export * from "@commander-js/extra-typings" -} diff --git a/cli/commands/dialect/errors.tsx b/cli/commands/dialect/errors.tsx deleted file mode 100644 index 5a5195c3..00000000 --- a/cli/commands/dialect/errors.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { Command } from "commander" -import { loadDescriptor, validateDialect } from "dpkit" -import type { Descriptor } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const errorsDialectCommand = new Command("errors") - .configureHelp(helpConfiguration) - .description("Show errors for a table dialect from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Dialect errors", - json: options.json, - }) - - let descriptor: Descriptor | undefined - - if (!path) { - const resource = await selectResource(session, options) - - if (!resource.dialect) { - Session.terminate("Dialect is not available") - } - - if (typeof resource.dialect !== "string") { - descriptor = resource.dialect as Descriptor - } else { - path = resource.dialect - } - } - - if (!descriptor) { - const result = await session.task( - "Loading dialect", - // @ts-ignore - loadDescriptor(path), - ) - - descriptor = result.descriptor - } - - const report = await session.task( - "Finding errors", - validateDialect(descriptor), - ) - - if (report.valid) { - session.success("Dialect is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/dialect/index.ts b/cli/commands/dialect/index.ts deleted file mode 100644 index 43e27fcf..00000000 --- a/cli/commands/dialect/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../helpers/help.ts" -import { errorsDialectCommand } from "./errors.tsx" -import { inferDialectCommand } from "./infer.tsx" -import { showDialectCommand } from "./show.tsx" -import { validateDialectCommand } from "./validate.tsx" - -export const dialectCommand = new Command("dialect") - .configureHelp(helpConfiguration) - .description("Table Dialect related commands") - - .addCommand(errorsDialectCommand) - .addCommand(inferDialectCommand) - .addCommand(showDialectCommand) - .addCommand(validateDialectCommand) diff --git a/cli/commands/dialect/infer.tsx b/cli/commands/dialect/infer.tsx deleted file mode 100644 index f263b443..00000000 --- a/cli/commands/dialect/infer.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Command } from "commander" -import { inferDialect } from "dpkit" -import React from "react" -import { DialectGrid } from "../../components/DialectGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { isEmptyObject } from "../../helpers/object.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const inferDialectCommand = new Command("infer") - .configureHelp(helpConfiguration) - .description("Infer a table dialect from a table") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Infer dialect", - json: options.json, - }) - - const resource = path ? { path } : await selectResource(session, options) - - const dialect = await session.task("Loading sample", inferDialect(resource)) - if (isEmptyObject(dialect)) { - Session.terminate("Could not infer dialect") - } - - await session.render(dialect, ) - }) diff --git a/cli/commands/dialect/show.tsx b/cli/commands/dialect/show.tsx deleted file mode 100644 index eb802049..00000000 --- a/cli/commands/dialect/show.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Command } from "commander" -import { loadDialect } from "dpkit" -import type { Dialect } from "dpkit" -import React from "react" -import { DialectGrid } from "../../components/DialectGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { isEmptyObject } from "../../helpers/object.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const showDialectCommand = new Command("show") - .configureHelp(helpConfiguration) - .description("Show a table dialect from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Show dialect", - json: options.json, - }) - - let dialect: Dialect | undefined - - if (!path) { - const resource = await selectResource(session, options) - if (!resource.dialect) { - Session.terminate("Dialect is not available") - } - - if (typeof resource.dialect !== "string") { - dialect = resource.dialect - } else { - path = resource.dialect - } - } - - if (!dialect) { - // @ts-ignore - dialect = await session.task("Loading dialect", loadDialect(path)) - } - - if (isEmptyObject(dialect)) { - Session.terminate("Dialect is not available") - } - - await session.render(dialect, ) - }) diff --git a/cli/commands/dialect/validate.tsx b/cli/commands/dialect/validate.tsx deleted file mode 100644 index 43e23466..00000000 --- a/cli/commands/dialect/validate.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { Command } from "commander" -import { loadDescriptor, validateDialect } from "dpkit" -import type { Descriptor } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const validateDialectCommand = new Command("validate") - .configureHelp(helpConfiguration) - .description("Validate a table dialect from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate dialect", - json: options.json, - }) - - let descriptor: Descriptor | undefined - - if (!path) { - const resource = await selectResource(session, options) - - if (!resource.dialect) { - Session.terminate("Dialect is not available") - } - - if (typeof resource.dialect !== "string") { - descriptor = resource.dialect as Descriptor - } else { - path = resource.dialect - } - } - - if (!descriptor) { - const result = await session.task( - "Loading dialect", - // @ts-ignore - loadDescriptor(path), - ) - - descriptor = result.descriptor - } - - const report = await session.task( - "Validating dialect", - // @ts-ignore - validateDialect(descriptor), - ) - - if (report.valid) { - session.success("Dialect is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/file/copy.ts b/cli/commands/file/copy.ts deleted file mode 100644 index 98fcc798..00000000 --- a/cli/commands/file/copy.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Command } from "commander" -import { copyFile } from "dpkit" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const copyFileCommand = new Command("copy") - .configureHelp(helpConfiguration) - .description("Copy a local or remote file to a local path") - - .addArgument(params.positionalFilePath) - .addOption(params.toPath.makeOptionMandatory()) - .addOption(params.fromPackage) - .addOption(params.fromResource) - - .action(async (path, options) => { - const session = Session.create({ - title: "Copy file", - }) - - if (!path) { - const resource = await selectResource(session, options) - - if (typeof resource.path !== "string") { - Session.terminate("Only single file resources are supported") - } - - path = resource.path - } - - await session.task( - "Copying file", - copyFile({ - sourcePath: path, - targetPath: options.toPath, - }), - ) - - session.success(`File from "${path}" copied to "${options.toPath}"`) - }) diff --git a/cli/commands/file/errors.tsx b/cli/commands/file/errors.tsx deleted file mode 100644 index dd47a6b7..00000000 --- a/cli/commands/file/errors.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { Command } from "commander" -import { validateFile } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const errorsFileCommand = new Command("errors") - .configureHelp(helpConfiguration) - .description("Show errors for a file from a local or remote path") - - .addArgument(params.requiredPositionalFilePath) - .addOption(params.bytes) - .addOption(params.hash) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "File errors", - json: options.json, - }) - - if (!options.bytes && !options.hash) { - Session.terminate("You must specify either --bytes or --hash") - } - - const report = await session.task( - "Finding errors", - validateFile(path, { - bytes: options.bytes ? Number.parseInt(options.bytes) : undefined, - hash: options.hash, - }), - ) - - if (report.valid) { - session.success("File is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/file/index.ts b/cli/commands/file/index.ts deleted file mode 100644 index d41f3c94..00000000 --- a/cli/commands/file/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../helpers/help.ts" -import { copyFileCommand } from "./copy.ts" -import { errorsFileCommand } from "./errors.tsx" -import { statsFileCommand } from "./stats.tsx" -import { validateFileCommand } from "./validate.tsx" - -export const fileCommand = new Command("file") - .configureHelp(helpConfiguration) - .description("File related commands") - - .addCommand(copyFileCommand) - .addCommand(errorsFileCommand) - .addCommand(statsFileCommand) - .addCommand(validateFileCommand) diff --git a/cli/commands/file/stats.tsx b/cli/commands/file/stats.tsx deleted file mode 100644 index d7402339..00000000 --- a/cli/commands/file/stats.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Command } from "commander" -import { describeFile } from "dpkit" -import React from "react" -import { DataGrid } from "../../components/DataGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const statsFileCommand = new Command("stats") - .configureHelp(helpConfiguration) - .description("Show stats for a local or remote file") - - .addArgument(params.positionalFilePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.hashType) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "File stats", - json: options.json, - }) - - if (!path) { - const resource = await selectResource(session, options) - - if (typeof resource.path !== "string") { - Session.terminate("Only single file resources are supported") - } - - path = resource.path - } - - const stats = await session.task( - "Calculating stats", - describeFile(path, { hashType: options.hashType }), - ) - - session.render(stats, ) - }) diff --git a/cli/commands/file/validate.tsx b/cli/commands/file/validate.tsx deleted file mode 100644 index 72cb756d..00000000 --- a/cli/commands/file/validate.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { Command } from "commander" -import { validateFile } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const validateFileCommand = new Command("validate") - .configureHelp(helpConfiguration) - .description("Validate a file from a local or remote path") - - .addArgument(params.requiredPositionalFilePath) - .addOption(params.bytes) - .addOption(params.hash) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate file", - json: options.json, - }) - - if (!options.bytes && !options.hash) { - Session.terminate("You must specify either --bytes or --hash") - } - - const report = await session.task( - "Validating file", - validateFile(path, { - bytes: options.bytes ? Number.parseInt(options.bytes) : undefined, - hash: options.hash, - }), - ) - - if (report.valid) { - session.success("File is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/package/archive.ts b/cli/commands/package/archive.ts deleted file mode 100644 index 439ca926..00000000 --- a/cli/commands/package/archive.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Command } from "commander" -import { loadPackage, savePackageToZip } from "dpkit" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const archivePackageCommand = new Command("archive") - .configureHelp(helpConfiguration) - .description("Archive a local or remote Data Package to a local zip file") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.toArchive.makeOptionMandatory()) - .addOption(params.withRemote) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate package", - }) - - const dp = await session.task("Loading package", loadPackage(path)) - - session.task( - "Archiving package", - savePackageToZip(dp, { - archivePath: options.toArchive, - withRemote: options.withRemote, - }), - ) - - session.success(`Package from "${path}" archived to "${options.toArchive}"`) - }) diff --git a/cli/commands/package/copy.ts b/cli/commands/package/copy.ts deleted file mode 100644 index 9d2d6d2c..00000000 --- a/cli/commands/package/copy.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Command } from "commander" -import { loadPackage, savePackageToFolder } from "dpkit" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const copyPackageCommand = new Command("copy") - .configureHelp(helpConfiguration) - .description("Copy a local or remote Data Package to a local folder") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.toFolder.makeOptionMandatory()) - .addOption(params.withRemote) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate package", - }) - - const dp = await session.task("Loading package", loadPackage(path)) - - await session.task( - "Copying package", - savePackageToFolder(dp, { - folderPath: options.toFolder, - withRemote: options.withRemote, - }), - ) - - session.success(`Package from "${path}" copied to "${options.toFolder}"`) - }) diff --git a/cli/commands/package/errors.tsx b/cli/commands/package/errors.tsx deleted file mode 100644 index 9eedb797..00000000 --- a/cli/commands/package/errors.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Command } from "commander" -import { validatePackage } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const errorsPackageCommand = new Command("errors") - .configureHelp(helpConfiguration) - .description("Show errors for a data package from a local or remote path") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Package errors", - json: options.json, - }) - - const report = await session.task("Finding errors", validatePackage(path)) - - if (report.valid) { - session.success("Package is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/package/index.ts b/cli/commands/package/index.ts deleted file mode 100644 index ec040217..00000000 --- a/cli/commands/package/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../helpers/help.ts" -import { archivePackageCommand } from "./archive.ts" -import { copyPackageCommand } from "./copy.ts" -import { errorsPackageCommand } from "./errors.tsx" -import { inferPackageCommand } from "./infer.tsx" -import { publishPackageCommand } from "./publish/index.ts" -import { showPackageCommand } from "./show.tsx" -import { validatePackageCommand } from "./validate.tsx" - -export const packageCommand = new Command("package") - .configureHelp(helpConfiguration) - .description("Data Package related commands") - - .addCommand(archivePackageCommand) - .addCommand(copyPackageCommand) - .addCommand(errorsPackageCommand) - .addCommand(inferPackageCommand) - .addCommand(showPackageCommand) - .addCommand(publishPackageCommand) - .addCommand(validatePackageCommand) diff --git a/cli/commands/package/infer.tsx b/cli/commands/package/infer.tsx deleted file mode 100644 index 9a1d21a0..00000000 --- a/cli/commands/package/infer.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { Command } from "commander" -import { inferPackage } from "dpkit" -import React from "react" -import { PackageGrid } from "../../components/PackageGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const inferPackageCommand = new Command("infer") - .configureHelp(helpConfiguration) - .description("Infer a data package from local or remote file paths") - - .addArgument(params.positionalFilePaths) - .addOption(params.json) - - .action(async (paths, options) => { - const session = Session.create({ - title: "Infer resource", - json: options.json, - }) - - const sourcePackage = { - resources: paths.map(path => ({ path })), - } - - const targetPackage = await session.task( - "Inferring package", - inferPackage(sourcePackage), - ) - - await session.render( - targetPackage, - , - ) - }) diff --git a/cli/commands/package/publish/ckan.ts b/cli/commands/package/publish/ckan.ts deleted file mode 100644 index 19c14ddc..00000000 --- a/cli/commands/package/publish/ckan.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { Option } from "commander" -import { Command } from "commander" -import { loadPackage, savePackageToCkan } from "dpkit" -import { helpConfiguration } from "../../../helpers/help.ts" -import { Session } from "../../../helpers/session.ts" -import * as params from "../../../params/index.ts" - -export const toCkanApiKey = new Option( - "--to-api-key ", - "API key for CKAN API", -) - -export const toCkanUrl = new Option( - "--to-ckan-url ", - "Base CKAN url to publish to", -) - -export const toCkanOwnerOrg = new Option( - "--to-owner-org ", - "Owner organization for the CKAN dataset", -) - -export const toCkanDatasetName = new Option( - "--to-dataset-name ", - "Name for the CKAN dataset", -) - -export const ckanPublishPackageCommand = new Command("ckan") - .configureHelp(helpConfiguration) - .description("Publish a data package from a local or remote path to CKAN") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.withRemote) - - .optionsGroup("CKAN") - .addOption(toCkanApiKey.makeOptionMandatory()) - .addOption(toCkanUrl.makeOptionMandatory()) - .addOption(toCkanOwnerOrg.makeOptionMandatory()) - .addOption(toCkanDatasetName.makeOptionMandatory()) - - .action(async (path, options) => { - const session = Session.create({ - title: "Publish package", - }) - - const dp = await session.task("Loading package", loadPackage(path)) - - const result = await session.task( - "Publishing package", - savePackageToCkan(dp, { - ckanUrl: options.toCkanUrl, - apiKey: options.toApiKey, - ownerOrg: options.toOwnerOrg, - datasetName: options.toDatasetName, - }), - ) - - session.success(`Package from "${path}" published to "${result.path}"`) - }) diff --git a/cli/commands/package/publish/github.ts b/cli/commands/package/publish/github.ts deleted file mode 100644 index 3117109a..00000000 --- a/cli/commands/package/publish/github.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Option } from "commander" -import { Command } from "commander" -import { loadPackage, savePackageToGithub } from "dpkit" -import { helpConfiguration } from "../../../helpers/help.ts" -import { Session } from "../../../helpers/session.ts" -import * as params from "../../../params/index.ts" - -export const toGithubApiKey = new Option( - "--to-api-key ", - "API key for GitHub API", -) - -export const toGithubRepo = new Option( - "--to-repo ", - "GitHub repository name", -) - -export const toGithubOrg = new Option( - "--to-org ", - "GitHub organization (optional, defaults to user repositories)", -) - -export const githubPublishPackageCommand = new Command("github") - .configureHelp(helpConfiguration) - .description("Publish a data package from a local or remote path to GitHub") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.withRemote) - - .optionsGroup("GitHub") - .addOption(toGithubApiKey.makeOptionMandatory()) - .addOption(toGithubRepo.makeOptionMandatory()) - .addOption(toGithubOrg) - - .action(async (path, options) => { - const session = Session.create({ - title: "Publish package", - }) - - const dp = await session.task("Loading package", loadPackage(path)) - - const result = await session.task( - "Publishing package", - savePackageToGithub(dp, { - apiKey: options.toApiKey, - repo: options.toRepo, - org: options.toOrg, - }), - ) - - session.success(`Package from "${path}" published to "${result.path}"`) - }) diff --git a/cli/commands/package/publish/index.ts b/cli/commands/package/publish/index.ts deleted file mode 100644 index 4a3311e7..00000000 --- a/cli/commands/package/publish/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../../helpers/help.ts" -import { ckanPublishPackageCommand } from "./ckan.ts" -import { githubPublishPackageCommand } from "./github.ts" -import { zenodoPublishPackageCommand } from "./zenodo.ts" - -export const publishPackageCommand = new Command("publish") - .configureHelp(helpConfiguration) - .description("Publish data packages to various platforms") - - .addCommand(ckanPublishPackageCommand) - .addCommand(githubPublishPackageCommand) - .addCommand(zenodoPublishPackageCommand) diff --git a/cli/commands/package/publish/zenodo.ts b/cli/commands/package/publish/zenodo.ts deleted file mode 100644 index 674f1a3c..00000000 --- a/cli/commands/package/publish/zenodo.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Option } from "commander" -import { Command } from "commander" -import { loadPackage, savePackageToZenodo } from "dpkit" -import { helpConfiguration } from "../../../helpers/help.ts" -import { Session } from "../../../helpers/session.ts" -import * as params from "../../../params/index.ts" - -export const toZenodoApiKey = new Option( - "--to-api-key ", - "API key for Zenodo API", -) - -export const toZenodoSandbox = new Option( - "--to-sandbox", - "Use Zenodo sandbox environment", -).default(false) - -export const zenodoPublishPackageCommand = new Command("zenodo") - .configureHelp(helpConfiguration) - .description("Publish a data package from a local or remote path to Zenodo") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.withRemote) - - .optionsGroup("Zenodo") - .addOption(toZenodoApiKey.makeOptionMandatory()) - .addOption(toZenodoSandbox) - - .action(async (path, options) => { - const session = Session.create({ - title: "Publish package", - }) - - const dp = await session.task("Loading package", loadPackage(path)) - - const result = await session.task( - "Publishing package", - savePackageToZenodo(dp, { - apiKey: options.toApiKey, - sandbox: options.toSandbox, - }), - ) - - session.success(`Package from "${path}" published to "${result.path}"`) - }) diff --git a/cli/commands/package/show.tsx b/cli/commands/package/show.tsx deleted file mode 100644 index 8bedc204..00000000 --- a/cli/commands/package/show.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Command } from "commander" -import { loadPackage } from "dpkit" -import React from "react" -import { PackageGrid } from "../../components/PackageGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const showPackageCommand = new Command("show") - .configureHelp(helpConfiguration) - .description("Show a Data Package descriptor") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Show package", - json: options.json, - }) - - const dp = await session.task("Loading package", loadPackage(path)) - - await session.render(dp, ) - }) diff --git a/cli/commands/package/validate.tsx b/cli/commands/package/validate.tsx deleted file mode 100644 index 9f0bf413..00000000 --- a/cli/commands/package/validate.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { Command } from "commander" -import { validatePackage } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const validatePackageCommand = new Command("validate") - .configureHelp(helpConfiguration) - .description("Validate a data package from a local or remote path") - - .addArgument(params.positionalDescriptorPath) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate package", - json: options.json, - }) - - const report = await session.task( - "Validating package", - validatePackage(path), - ) - - if (report.valid) { - session.success("Package is valid") - } - - session.render( - report, - , - ) - }) diff --git a/cli/commands/resource/errors.tsx b/cli/commands/resource/errors.tsx deleted file mode 100644 index 5ad7da42..00000000 --- a/cli/commands/resource/errors.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Command } from "commander" -import { validateResource } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const errorsResourceCommand = new Command("errors") - .configureHelp(helpConfiguration) - .description("Show errors for a data resource from a local or remote path") - - .addArgument(params.optionalPositionalDescriptorPath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Resource errors", - json: options.json, - }) - - const descriptor = path ? path : await selectResource(session, options) - - const report = await session.task( - "Finding errors", - validateResource(descriptor), - ) - - if (report.valid) { - session.success("Resource is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/resource/index.ts b/cli/commands/resource/index.ts deleted file mode 100644 index c2e66d69..00000000 --- a/cli/commands/resource/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../helpers/help.ts" -import { errorsResourceCommand } from "./errors.tsx" -import { inferResourceCommand } from "./infer.tsx" -import { showResourceCommand } from "./show.tsx" -import { validateResourceCommand } from "./validate.tsx" - -export const resourceCommand = new Command("resource") - .configureHelp(helpConfiguration) - .description("Data Resource related commands") - - .addCommand(errorsResourceCommand) - .addCommand(inferResourceCommand) - .addCommand(showResourceCommand) - .addCommand(validateResourceCommand) diff --git a/cli/commands/resource/infer.tsx b/cli/commands/resource/infer.tsx deleted file mode 100644 index e2f35cd9..00000000 --- a/cli/commands/resource/infer.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Command } from "commander" -import { inferResource } from "dpkit" -import React from "react" -import { ResourceGrid } from "../../components/ResourceGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { isEmptyObject } from "../../helpers/object.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const inferResourceCommand = new Command("infer") - .configureHelp(helpConfiguration) - .description("Infer a data resource from a table") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Infer resource", - json: options.json, - }) - - const resource = path ? { path } : await selectResource(session, options) - - const result = await session.task( - "Inferring resource", - inferResource(resource), - ) - - if (isEmptyObject(result)) { - Session.terminate("Could not infer resource") - } - - await session.render( - result, - // @ts-ignore - , - ) - }) diff --git a/cli/commands/resource/show.tsx b/cli/commands/resource/show.tsx deleted file mode 100644 index 43b336c4..00000000 --- a/cli/commands/resource/show.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { Command } from "commander" -import { loadResourceDescriptor } from "dpkit" -import type { Resource } from "dpkit" -import React from "react" -import { ResourceGrid } from "../../components/ResourceGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { isEmptyObject } from "../../helpers/object.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const showResourceCommand = new Command("show") - .configureHelp(helpConfiguration) - .description("Show a data resource from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Show resource", - json: options.json, - }) - - let resource: Resource | undefined - - if (!path) { - resource = await selectResource(session, options) - } else { - // @ts-ignore - resource = await session.task( - "Loading resource", - loadResourceDescriptor(path), - ) - } - - if (isEmptyObject(resource)) { - Session.terminate("Resource is not available") - } - - await session.render(resource, ) - }) diff --git a/cli/commands/resource/validate.tsx b/cli/commands/resource/validate.tsx deleted file mode 100644 index b3ae7795..00000000 --- a/cli/commands/resource/validate.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Command } from "commander" -import { validateResource } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const validateResourceCommand = new Command("validate") - .configureHelp(helpConfiguration) - .description("Validate a data resource from a local or remote path") - - .addArgument(params.optionalPositionalDescriptorPath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate resource", - json: options.json, - }) - - const descriptor = path ? path : await selectResource(session, options) - - const report = await session.task( - "Validating resource", - validateResource(descriptor), - ) - - if (report.valid) { - session.success("Resource is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/schema/errors.tsx b/cli/commands/schema/errors.tsx deleted file mode 100644 index 5955e83c..00000000 --- a/cli/commands/schema/errors.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { Command } from "commander" -import { loadDescriptor, validateSchema } from "dpkit" -import type { Descriptor } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const errorsSchemaCommand = new Command("errors") - .configureHelp(helpConfiguration) - .description("Show errors for a table schema from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Schema errors", - json: options.json, - }) - - let descriptor: Descriptor | undefined - - if (!path) { - const resource = await selectResource(session, options) - - if (!resource.schema) { - Session.terminate("Schema is not available") - } - - if (typeof resource.schema !== "string") { - descriptor = resource.schema as unknown as Descriptor - } else { - path = resource.schema - } - } - - if (!descriptor) { - const result = await session.task( - "Loading schema", - // @ts-ignore - loadDescriptor(path), - ) - - descriptor = result.descriptor - } - - const report = await session.task( - "Validating schema", - validateSchema(descriptor), - ) - - if (report.valid) { - session.success("Schema is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/schema/index.ts b/cli/commands/schema/index.ts deleted file mode 100644 index 200f757c..00000000 --- a/cli/commands/schema/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../helpers/help.ts" -import { errorsSchemaCommand } from "./errors.tsx" -import { inferSchemaCommand } from "./infer.tsx" -import { showSchemaCommand } from "./show.tsx" -import { validateSchemaCommand } from "./validate.tsx" - -export const schemaCommand = new Command("schema") - .configureHelp(helpConfiguration) - .description("Table Schema related commands") - - .addCommand(errorsSchemaCommand) - .addCommand(inferSchemaCommand) - .addCommand(showSchemaCommand) - .addCommand(validateSchemaCommand) diff --git a/cli/commands/schema/infer.tsx b/cli/commands/schema/infer.tsx deleted file mode 100644 index a6680aaf..00000000 --- a/cli/commands/schema/infer.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { Command } from "commander" -import { inferSchema, loadTable } from "dpkit" -import React from "react" -import { SchemaGrid } from "../../components/SchemaGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { isEmptyObject } from "../../helpers/object.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const inferSchemaCommand = new Command("infer") - .configureHelp(helpConfiguration) - .description("Infer a table schema from a table") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Infer schema", - json: options.json, - }) - - const resource = path ? { path } : await selectResource(session, options) - - const table = await session.task("Loading table", loadTable(resource)) - - const inferredSchema = await session.task( - "Inferring schema", - inferSchema(table), - ) - - if (isEmptyObject(inferredSchema)) { - Session.terminate("Could not infer schema") - } - - await session.render( - inferredSchema, - // @ts-ignore - , - ) - }) diff --git a/cli/commands/schema/show.tsx b/cli/commands/schema/show.tsx deleted file mode 100644 index 50963339..00000000 --- a/cli/commands/schema/show.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Command } from "commander" -import { loadSchema } from "dpkit" -import type { Schema } from "dpkit" -import React from "react" -import { SchemaGrid } from "../../components/SchemaGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { isEmptyObject } from "../../helpers/object.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const showSchemaCommand = new Command("show") - .configureHelp(helpConfiguration) - .description("Show a table schema from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Show schema", - json: options.json, - }) - - let schema: Schema | undefined - - if (!path) { - const resource = await selectResource(session, options) - if (!resource.schema) { - Session.terminate("Schema is not available") - } - - if (typeof resource.schema !== "string") { - schema = resource.schema - } else { - path = resource.schema - } - } - - if (!schema) { - // @ts-ignore - schema = await session.task("Loading schema", loadSchema(path)) - } - - if (isEmptyObject(schema)) { - Session.terminate("Schema is not available") - } - - await session.render(schema, ) - }) diff --git a/cli/commands/schema/validate.tsx b/cli/commands/schema/validate.tsx deleted file mode 100644 index e8d773c2..00000000 --- a/cli/commands/schema/validate.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { Command } from "commander" -import { loadDescriptor, validateSchema } from "dpkit" -import type { Descriptor } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const validateSchemaCommand = new Command("validate") - .configureHelp(helpConfiguration) - .description("Validate a table schema from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate schema", - json: options.json, - }) - - let descriptor: Descriptor | undefined - - if (!path) { - const resource = await selectResource(session, options) - - if (!resource.schema) { - Session.terminate("Schema is not available") - } - - if (typeof resource.schema !== "string") { - descriptor = resource.schema as unknown as Descriptor - } else { - path = resource.schema - } - } - - if (!descriptor) { - const result = await session.task( - "Loading descriptor", - // @ts-ignore - loadDescriptor(path), - ) - - descriptor = result.descriptor - } - - const report = await session.task( - "Validating descriptor", - // @ts-ignore - validateSchema(descriptor), - ) - - if (report.valid) { - session.success("Schema is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/table/convert.tsx b/cli/commands/table/convert.tsx deleted file mode 100644 index 6a6a4e7d..00000000 --- a/cli/commands/table/convert.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { Command } from "commander" -import { getTempFilePath, loadFile } from "dpkit" -import { readTable, saveTable } from "dpkit" -import { createDialectFromOptions } from "../../helpers/dialect.ts" -import { createToDialectFromOptions } from "../../helpers/dialect.ts" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const convertTableCommand = new Command("convert") - .configureHelp(helpConfiguration) - .description( - "Convert a table from a local or remote source path to a target path", - ) - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.toPath) - .addOption(params.toFormat) - - .optionsGroup("Table Dialect") - .addOption(params.delimiter) - .addOption(params.header) - .addOption(params.headerRows) - .addOption(params.headerJoin) - .addOption(params.commentRows) - .addOption(params.commentChar) - .addOption(params.quoteChar) - .addOption(params.doubleQuote) - .addOption(params.escapeChar) - .addOption(params.nullSequence) - .addOption(params.skipInitialSpace) - .addOption(params.property) - .addOption(params.itemType) - .addOption(params.itemKeys) - .addOption(params.sheetNumber) - .addOption(params.sheetName) - .addOption(params.table) - - .optionsGroup("Table Dialect (output)") - .addOption(params.toDelimiter) - .addOption(params.toHeader) - .addOption(params.toHeaderRows) - .addOption(params.toHeaderJoin) - .addOption(params.toCommentRows) - .addOption(params.toCommentChar) - .addOption(params.toQuoteChar) - .addOption(params.toDoubleQuote) - .addOption(params.toEscapeChar) - .addOption(params.toNullSequence) - .addOption(params.toSkipInitialSpace) - .addOption(params.toProperty) - .addOption(params.toItemType) - .addOption(params.toItemKeys) - .addOption(params.toSheetNumber) - .addOption(params.toSheetName) - .addOption(params.toTable) - - .action(async (path, options) => { - const session = Session.create({ - title: "Table errors", - }) - - const resource = path - ? { path, dialect: createDialectFromOptions(options) } - : await selectResource(session, options) - - const table = await session.task("Loading table", readTable(resource)) - - const toPath = options.toPath ?? getTempFilePath() - const toDialect = createToDialectFromOptions(options) - - await session.task( - "Saving table", - saveTable(table, { - path: toPath, - format: options.toFormat, - dialect: toDialect, - }), - ) - - if (!options.toPath) { - const buffer = await loadFile(toPath) - console.log(buffer.toString().trim()) - return - } - - console.log(`Converted table from ${path} to ${options.toPath}`) - }) diff --git a/cli/commands/table/errors.tsx b/cli/commands/table/errors.tsx deleted file mode 100644 index abdefeed..00000000 --- a/cli/commands/table/errors.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { Command } from "commander" -import { validateTable } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { createDialectFromOptions } from "../../helpers/dialect.ts" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const errorsTableCommand = new Command("errors") - .configureHelp(helpConfiguration) - .description("Validate a table from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .optionsGroup("Table Dialect") - .addOption(params.delimiter) - .addOption(params.header) - .addOption(params.headerRows) - .addOption(params.headerJoin) - .addOption(params.commentRows) - .addOption(params.commentChar) - .addOption(params.quoteChar) - .addOption(params.doubleQuote) - .addOption(params.escapeChar) - .addOption(params.nullSequence) - .addOption(params.skipInitialSpace) - .addOption(params.property) - .addOption(params.itemType) - .addOption(params.itemKeys) - .addOption(params.sheetNumber) - .addOption(params.sheetName) - .addOption(params.table) - - .action(async (path, options) => { - const session = Session.create({ - title: "Table errors", - json: options.json, - }) - - const resource = path - ? { path, dialect: createDialectFromOptions(options) } - : await selectResource(session, options) - - const report = await session.task("Finding errors", validateTable(resource)) - - if (report.valid) { - session.success("Table is valid") - } - - session.render(report, ) - }) diff --git a/cli/commands/table/explore.tsx b/cli/commands/table/explore.tsx deleted file mode 100644 index 32dc70d8..00000000 --- a/cli/commands/table/explore.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { Command } from "commander" -import { readTable } from "dpkit" -import React from "react" -import { TableGrid } from "../../components/TableGrid.tsx" -import { createDialectFromOptions } from "../../helpers/dialect.ts" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const exploreTableCommand = new Command("explore") - .configureHelp(helpConfiguration) - .description("Explore a table from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - - .optionsGroup("Table Dialect") - .addOption(params.delimiter) - .addOption(params.header) - .addOption(params.headerRows) - .addOption(params.headerJoin) - .addOption(params.commentRows) - .addOption(params.commentChar) - .addOption(params.quoteChar) - .addOption(params.doubleQuote) - .addOption(params.escapeChar) - .addOption(params.nullSequence) - .addOption(params.skipInitialSpace) - .addOption(params.property) - .addOption(params.itemType) - .addOption(params.itemKeys) - .addOption(params.sheetNumber) - .addOption(params.sheetName) - .addOption(params.table) - - .action(async (path, options) => { - const session = Session.create({ - title: "Explore table", - }) - - const resource = path - ? { path, dialect: createDialectFromOptions(options) } - : await selectResource(session, options) - - const table = await session.task("Loading table", readTable(resource)) - await session.render(table, ) - }) diff --git a/cli/commands/table/index.ts b/cli/commands/table/index.ts deleted file mode 100644 index a56294e3..00000000 --- a/cli/commands/table/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../helpers/help.ts" -import { convertTableCommand } from "./convert.tsx" -import { errorsTableCommand } from "./errors.tsx" -import { exploreTableCommand } from "./explore.tsx" -import { queryTableCommand } from "./query.tsx" -import { scriptTableCommand } from "./script.tsx" -import { statsTableCommand } from "./stats.tsx" -import { validateTableCommand } from "./validate.tsx" - -export const tableCommand = new Command("table") - .configureHelp(helpConfiguration) - .description("Table related commands") - - .addCommand(convertTableCommand) - .addCommand(errorsTableCommand) - .addCommand(exploreTableCommand) - .addCommand(queryTableCommand) - .addCommand(scriptTableCommand) - .addCommand(statsTableCommand) - .addCommand(validateTableCommand) diff --git a/cli/commands/table/query.tsx b/cli/commands/table/query.tsx deleted file mode 100644 index 6886c660..00000000 --- a/cli/commands/table/query.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Command } from "commander" -import { helpConfiguration } from "../../helpers/help.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const queryTableCommand = new Command("query") - .configureHelp(helpConfiguration) - .description( - "Start a querying session for a table from a local or remote path", - ) - .addArgument(params.positionalTablePath) - - .optionsGroup("Table Dialect") - .addOption(params.delimiter) - .addOption(params.header) - .addOption(params.headerRows) - .addOption(params.headerJoin) - .addOption(params.commentRows) - .addOption(params.commentChar) - .addOption(params.quoteChar) - .addOption(params.doubleQuote) - .addOption(params.escapeChar) - .addOption(params.nullSequence) - .addOption(params.skipInitialSpace) - .addOption(params.property) - .addOption(params.itemType) - .addOption(params.itemKeys) - .addOption(params.sheetNumber) - .addOption(params.sheetName) - .addOption(params.table) - - .action(async (_path, _options) => { - // @ts-ignore - const session = Session.create({ - title: "Query table", - }) - - Session.terminate("Query command not implemented yet") - }) diff --git a/cli/commands/table/script.tsx b/cli/commands/table/script.tsx deleted file mode 100644 index d6df4b0f..00000000 --- a/cli/commands/table/script.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import repl from "node:repl" -import { Command } from "commander" -import { readTable } from "dpkit" -import { createDialectFromOptions } from "../../helpers/dialect.ts" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const scriptTableCommand = new Command("script") - .configureHelp(helpConfiguration) - .description( - "Start a scripting session for a table from a local or remote path", - ) - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - - .optionsGroup("Table Dialect") - .addOption(params.delimiter) - .addOption(params.header) - .addOption(params.headerRows) - .addOption(params.headerJoin) - .addOption(params.commentRows) - .addOption(params.commentChar) - .addOption(params.quoteChar) - .addOption(params.doubleQuote) - .addOption(params.escapeChar) - .addOption(params.nullSequence) - .addOption(params.skipInitialSpace) - .addOption(params.property) - .addOption(params.itemType) - .addOption(params.itemKeys) - .addOption(params.sheetNumber) - .addOption(params.sheetName) - .addOption(params.table) - - .action(async (path, options) => { - const session = Session.create({ - title: "Explore table", - }) - - const resource = path - ? { path, dialect: createDialectFromOptions(options) } - : await selectResource(session, options) - - const table = await session.task("Loading table", readTable(resource)) - - const replSession = repl.start({ prompt: "dp> " }) - replSession.context.table = table - }) diff --git a/cli/commands/table/stats.tsx b/cli/commands/table/stats.tsx deleted file mode 100644 index e85a5827..00000000 --- a/cli/commands/table/stats.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Command } from "commander" -import { readTable } from "dpkit" -import React from "react" -import { DataGrid } from "../../components/DataGrid.tsx" -import { createDialectFromOptions } from "../../helpers/dialect.ts" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const statsTableCommand = new Command("stats") - .configureHelp(helpConfiguration) - .description("Show stats for a table from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .optionsGroup("Table Dialect") - .addOption(params.delimiter) - .addOption(params.header) - .addOption(params.headerRows) - .addOption(params.headerJoin) - .addOption(params.commentRows) - .addOption(params.commentChar) - .addOption(params.quoteChar) - .addOption(params.doubleQuote) - .addOption(params.escapeChar) - .addOption(params.nullSequence) - .addOption(params.skipInitialSpace) - .addOption(params.property) - .addOption(params.itemType) - .addOption(params.itemKeys) - .addOption(params.sheetNumber) - .addOption(params.sheetName) - .addOption(params.table) - .action(async (path, options) => { - const session = Session.create({ - title: "Table stats", - json: options.json, - }) - - const resource = path - ? { path, dialect: createDialectFromOptions(options) } - : await selectResource(session, options) - - const table = await session.task("Loading table", readTable(resource)) - const df = await session.task("Calculating stats", table.collect()) - - const stats = df.describe().toRecords() - - session.render(stats, ) - }) diff --git a/cli/commands/table/validate.tsx b/cli/commands/table/validate.tsx deleted file mode 100644 index c2323cad..00000000 --- a/cli/commands/table/validate.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { Command } from "commander" -import { validateTable } from "dpkit" -import React from "react" -import { ReportGrid } from "../../components/ReportGrid.tsx" -import { createDialectFromOptions } from "../../helpers/dialect.ts" -import { helpConfiguration } from "../../helpers/help.ts" -import { selectResource } from "../../helpers/resource.ts" -import { Session } from "../../helpers/session.ts" -import * as params from "../../params/index.ts" - -export const validateTableCommand = new Command("validate") - .configureHelp(helpConfiguration) - .description("Validate a table from a local or remote path") - - .addArgument(params.positionalTablePath) - .addOption(params.fromPackage) - .addOption(params.fromResource) - .addOption(params.json) - - .action(async (path, options) => { - const session = Session.create({ - title: "Validate Table", - json: options.json, - }) - - const resource = path - ? { path, dialect: createDialectFromOptions(options) } - : await selectResource(session, options) - - const report = await session.task( - "Validating table", - validateTable(resource), - ) - - if (report.valid) { - session.success("Table is valid") - } - - session.render(report, ) - }) diff --git a/cli/components/DataGrid.tsx b/cli/components/DataGrid.tsx deleted file mode 100644 index c504248f..00000000 --- a/cli/components/DataGrid.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { Box, Text } from "ink" -import React from "react" - -// TODO: Accept column names as an option -// TODO: Autocalculate geometry (e.g. row height etc) - -const MIN_COLUMN_WIDTH = 15 -export type Order = { col: number; dir: "asc" | "desc" } - -export function DataGrid(props: { - data: Record[] - col?: number - order?: Order - rowHeight?: number - borderColor?: "green" | "red" -}) { - const { data, col, order, rowHeight, borderColor = "green" } = props - - // TODO: fix $schema related cludge - const colNames = Object.keys(data[0] ?? {}).filter(name => name !== "$schema") - - // TODO: fix type related cludge - if (colNames.includes("type")) { - colNames.splice(colNames.indexOf("type"), 1) - colNames.unshift("type") - } - - // TODO: fix resource related cludge - if (colNames.includes("resource")) { - colNames.splice(colNames.indexOf("resource"), 1) - colNames.unshift("resource") - } - - const colWidth = Math.min( - process.stdout.columns / colNames.length, - MIN_COLUMN_WIDTH, - ) - - const tableWidth = colNames.length * colWidth - - const selectIndex = col ? col - 1 : -1 - const orderIndex = order?.col ? order?.col - 1 : -1 - const orderSign = order?.dir === "desc" ? " â–²" : " â–¼" - - return ( - - - {colNames.map((name, index) => ( - - - {name} - {index === orderIndex ? orderSign : " "} - - - ))} - - - {data.map((row, rowIndex) => ( - - {colNames.map((name, index) => ( - - {(row[name] ?? "").toString()} - - ))} - - ))} - - ) -} diff --git a/cli/components/DialectGrid.tsx b/cli/components/DialectGrid.tsx deleted file mode 100644 index 8995c4b7..00000000 --- a/cli/components/DialectGrid.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import type { Dialect } from "dpkit" -import React from "react" -import { DataGrid } from "./DataGrid.tsx" - -// TODO: Support non-visible chars like TAB and CR - -export function DialectGrid(props: { dialect: Dialect }) { - const data = [props.dialect] - - return -} diff --git a/cli/components/PackageGrid.tsx b/cli/components/PackageGrid.tsx deleted file mode 100644 index 7c52f552..00000000 --- a/cli/components/PackageGrid.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import type { Package } from "dpkit" -import React from "react" -import { DataGrid } from "./DataGrid.tsx" - -// TODO: Support showing other package/resource properties - -export function PackageGrid(props: { dataPackage: Package }) { - const data = [ - Object.fromEntries( - props.dataPackage.resources.map(resource => [ - resource.name, - resource.path, - ]), - ), - ] - - return -} diff --git a/cli/components/ReportGrid.tsx b/cli/components/ReportGrid.tsx deleted file mode 100644 index b897a668..00000000 --- a/cli/components/ReportGrid.tsx +++ /dev/null @@ -1,46 +0,0 @@ -//import type { TableError } from "dpkit" -import { countBy } from "es-toolkit" -import { DataFrame } from "nodejs-polars" -import React from "react" -import { DataGrid } from "./DataGrid.tsx" -import { TableGrid } from "./TableGrid.tsx" - -// TODO: Improve implementation (esp. typing) - -export function ReportGrid(props: { - report: { valid: boolean; errors: Record[] } - groupBy?: "type" | "resource/type" -}) { - const { report, groupBy } = props - - if (report.valid) { - return null - } - - if (groupBy === "resource/type") { - const groups = countBy(report.errors, error => - [error.resource ?? "", error.type].join("/"), - ) - - const data = Object.entries(groups).map(([resourceType, count]) => ({ - resource: resourceType.split("/")[0], - type: resourceType.split("/")[1], - count, - })) - - return - } - - if (groupBy === "type") { - const groups = countBy(report.errors, error => error.type) - const data = Object.entries(groups).map(([error, count]) => ({ - error, - count, - })) - - return - } - - const table = DataFrame(report.errors).lazy() - return -} diff --git a/cli/components/ResourceGrid.tsx b/cli/components/ResourceGrid.tsx deleted file mode 100644 index cb218225..00000000 --- a/cli/components/ResourceGrid.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import type { Resource } from "dpkit" -import React from "react" -import { DataGrid } from "./DataGrid.tsx" - -// TODO: Support better display of resource properties - -export function ResourceGrid(props: { resource: Resource }) { - const data = [props.resource] - - return -} diff --git a/cli/components/SchemaGrid.tsx b/cli/components/SchemaGrid.tsx deleted file mode 100644 index ec5d302e..00000000 --- a/cli/components/SchemaGrid.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import type { Schema } from "dpkit" -import React from "react" -import { DataGrid } from "./DataGrid.tsx" - -// TODO: Support showing other schema/field properties - -export function SchemaGrid(props: { schema: Schema }) { - const data = [ - Object.fromEntries( - props.schema.fields.map(field => [field.name, field.type]), - ), - ] - - return -} diff --git a/cli/components/TableGrid.tsx b/cli/components/TableGrid.tsx deleted file mode 100644 index 954a6640..00000000 --- a/cli/components/TableGrid.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import type { Table } from "dpkit" -import { useApp, useInput } from "ink" -import { Box, Text } from "ink" -import { useEffect, useState } from "react" -import React from "react" -import type { Order } from "./DataGrid.tsx" -import { DataGrid } from "./DataGrid.tsx" - -const PAGE_SIZE = 10 -type Data = Record[] - -export function TableGrid(props: { - table: Table - borderColor?: "green" | "red" -}) { - const { table, borderColor } = props - - const { exit } = useApp() - const [col, setCol] = useState(0) - const [page, setPage] = useState(1) - const [order, setOrder] = useState() - const [data, setData] = useState([]) - - const handleColChange = async (col: number) => { - if (col === 0) return - if (col > table.columns.length) return - - setCol(col) - } - - const handleOrderChange = async (order?: Order) => { - setOrder(order) - - if (order) { - handlePageChange(1, order) - } - } - - const handlePageChange = async (page: number, order?: Order) => { - if (page === 0) return - - let ldf = table - if (order) { - const name = table.columns[order.col - 1] - if (name) { - ldf = ldf.sort(name, order.dir === "desc") - } - } - - const offset = (page - 1) * PAGE_SIZE - const df = await ldf.slice(offset, PAGE_SIZE).collect() - const data = df.toRecords() - - if (data.length) { - setPage(page) - setData(data) - } - } - - useEffect(() => { - handlePageChange(1) - }, [table]) - - useInput((input, key) => { - if (key.escape || input === "q") { - exit() - } - - if (key.upArrow || input === "k") { - handlePageChange(page - 1) - } - - if (key.downArrow || input === "j") { - handlePageChange(page + 1) - } - - if (key.leftArrow || input === "h") { - handleColChange(col - 1) - } - - if (key.rightArrow || input === "l") { - handleColChange(col + 1) - } - - if (key.return || input === "o") { - let nextOrder: Order | undefined = { col, dir: "desc" } - - if (order?.col === col) { - if (order?.dir === "desc") nextOrder = { col, dir: "asc" } - if (order?.dir === "asc") nextOrder = undefined - } - - handleOrderChange(nextOrder) - } - }) - - return ( - - - - - ) -} - -function Help() { - const { exit } = useApp() - const [isOpen, setIsOpen] = useState(false) - - useInput((input, key) => { - if (key.escape || input === "q") { - exit() - } - - if (input === "d") { - setIsOpen(!isOpen) - } - }) - - if (!isOpen) { - return ( - - - {", "} - - - ) - } - - return ( - - Table Usage - - - - - - - - ) -} - -function HelpItem(props: { button: string; description: string }) { - return ( - - press {props.button}{" "} - {props.description} - - ) -} diff --git a/cli/entrypoints/dev.cmd b/cli/entrypoints/dev.cmd deleted file mode 100644 index 8ae2b12c..00000000 --- a/cli/entrypoints/dev.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -node "%~dp0\dev" %* diff --git a/cli/entrypoints/dev.ts b/cli/entrypoints/dev.ts deleted file mode 100755 index 5a47c26e..00000000 --- a/cli/entrypoints/dev.ts +++ /dev/null @@ -1,3 +0,0 @@ -#!cli/node_modules/.bin/tsx - -await import("../main.ts") diff --git a/cli/entrypoints/run.cmd b/cli/entrypoints/run.cmd deleted file mode 100644 index 968fc307..00000000 --- a/cli/entrypoints/run.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -node "%~dp0\run" %* diff --git a/cli/entrypoints/run.ts b/cli/entrypoints/run.ts deleted file mode 100755 index 9dc8de9e..00000000 --- a/cli/entrypoints/run.ts +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -await import("../main.ts") diff --git a/cli/helpers/dialect.ts b/cli/helpers/dialect.ts deleted file mode 100644 index 47660411..00000000 --- a/cli/helpers/dialect.ts +++ /dev/null @@ -1,163 +0,0 @@ -import type { Dialect } from "dpkit" - -// TODO: Find a better way to construct dialects - -export function createDialectFromOptions(options: any) { - let dialect: Dialect | undefined - - if (options.delimiter) { - dialect = { ...dialect, delimiter: options.delimiter } - } - - if (options.header === false) { - dialect = { ...dialect, header: options.header } - } - - if (options.headerRows) { - dialect = { - ...dialect, - headerRows: options.headerRows.split(",").map(Number), - } - } - - if (options.headerJoin) { - dialect = { ...dialect, headerJoin: options.headerJoin } - } - - if (options.commentRows) { - dialect = { - ...dialect, - commentRows: options.commentRows.split(",").map(Number), - } - } - - if (options.commentChar) { - dialect = { ...dialect, commentChar: options.commentChar } - } - - if (options.quoteChar) { - dialect = { ...dialect, quoteChar: options.quoteChar } - } - - if (options.doubleQuote) { - dialect = { ...dialect, doubleQuote: options.doubleQuote } - } - - if (options.escapeChar) { - dialect = { ...dialect, escapeChar: options.escapeChar } - } - - if (options.nullSequence) { - dialect = { ...dialect, nullSequence: options.nullSequence } - } - - if (options.skipInitialSpace) { - dialect = { ...dialect, skipInitialSpace: options.skipInitialSpace } - } - - if (options.property) { - dialect = { ...dialect, property: options.property } - } - - if (options.itemType) { - dialect = { ...dialect, itemType: options.itemType } - } - - if (options.itemKeys) { - dialect = { ...dialect, itemKeys: options.itemKeys.split(",") } - } - - if (options.sheetNumber) { - dialect = { ...dialect, sheetNumber: options.sheetNumber } - } - - if (options.sheetName) { - dialect = { ...dialect, sheetName: options.sheetName } - } - - if (options.table) { - dialect = { ...dialect, table: options.table } - } - - return dialect -} - -export function createToDialectFromOptions(options: any) { - let dialect: Dialect | undefined - - if (options.toDelimiter) { - dialect = { ...dialect, delimiter: options.toDelimiter } - } - - if (options.toHeader === false) { - dialect = { ...dialect, header: options.toHeader } - } - - if (options.toHeaderRows) { - dialect = { - ...dialect, - headerRows: options.toHeaderRows.split(",").map(Number), - } - } - - if (options.toHeaderJoin) { - dialect = { ...dialect, headerJoin: options.toHeaderJoin } - } - - if (options.toCommentRows) { - dialect = { - ...dialect, - commentRows: options.toCommentRows.split(",").map(Number), - } - } - - if (options.toCommentChar) { - dialect = { ...dialect, commentChar: options.toCommentChar } - } - - if (options.toQuoteChar) { - dialect = { ...dialect, quoteChar: options.toQuoteChar } - } - - if (options.toDoubleQuote) { - dialect = { ...dialect, doubleQuote: options.toDoubleQuote } - } - - if (options.toEscapeChar) { - dialect = { ...dialect, escapeChar: options.toEscapeChar } - } - - if (options.toNullSequence) { - dialect = { ...dialect, nullSequence: options.toNullSequence } - } - - if (options.toSkipInitialSpace) { - dialect = { ...dialect, skipInitialSpace: options.toSkipInitialSpace } - } - - if (options.toProperty) { - dialect = { ...dialect, property: options.toProperty } - } - - if (options.toItemType) { - dialect = { ...dialect, itemType: options.toItemType } - } - - if (options.toItemKeys) { - dialect = { ...dialect, itemKeys: options.toItemKeys.split(",") } - } - - if (options.toSheetNumber) { - dialect = { ...dialect, sheetNumber: options.toSheetNumber } - } - - if (options.toSheetName) { - dialect = { ...dialect, sheetName: options.toSheetName } - } - - if (options.toTable) { - dialect = { ...dialect, table: options.toTable } - } - - return dialect -} diff --git a/cli/helpers/help.ts b/cli/helpers/help.ts deleted file mode 100644 index 68a955cf..00000000 --- a/cli/helpers/help.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { HelpConfiguration } from "commander" -import pc from "picocolors" - -export const helpConfiguration: HelpConfiguration = { - styleTitle: str => pc.bold(str.toUpperCase().replace(":", "")), -} diff --git a/cli/helpers/object.ts b/cli/helpers/object.ts deleted file mode 100644 index ea92287e..00000000 --- a/cli/helpers/object.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function isEmptyObject(obj: Record): boolean { - return Object.keys(obj).length === 0 -} diff --git a/cli/helpers/resource.ts b/cli/helpers/resource.ts deleted file mode 100644 index 3fd0714c..00000000 --- a/cli/helpers/resource.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { loadPackage } from "dpkit" -import { Session } from "./session.ts" - -export async function selectResource( - session: Session, - options: { package?: string; resource?: string }, -) { - if (!options.package) { - Session.terminate("Please provide a path argument or a package option") - } - - const dataPackage = await session.task( - "Loading package", - loadPackage(options.package), - ) - - const resourceName = - options.resource ?? - (await session.select({ - message: "Select resource", - options: dataPackage.resources.map(resource => ({ - label: resource.name, - value: resource.name, - })), - })) - - const resource = dataPackage.resources.find( - resource => resource.name === resourceName, - ) - - if (!resource) { - if (typeof resourceName !== "string") { - Session.terminate("Resource selection cancelled") - } - - Session.terminate( - `Resource "${resourceName}" is not found in the provided data package`, - ) - } - - return resource -} diff --git a/cli/helpers/session.ts b/cli/helpers/session.ts deleted file mode 100644 index b8e6496f..00000000 --- a/cli/helpers/session.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { setImmediate } from "node:timers/promises" -import { spinner } from "@clack/prompts" -import { intro, log, outro, select } from "@clack/prompts" -import type { SelectOptions } from "@clack/prompts" -import exitHook from "exit-hook" -import { render } from "ink" -import pc from "picocolors" -import type React from "react" - -export class Session { - title: string - - static create(options: { title: string; json?: boolean }) { - const session = options.json - ? new JsonSession(options) - : new Session(options) - - session.start() - return session - } - - static terminate(message: string): never { - log.error(message) - process.exit(1) - } - - constructor(options: { title: string }) { - this.title = options.title - } - start() { - intro(pc.bold(this.title)) - this.#enableExitHook() - } - - success(message: string) { - log.success(message) - } - - error(message: string) { - log.error(message) - } - - async select(options: SelectOptions) { - return await select(options) - } - - async task(message: string, promise: Promise) { - // TODO: Consider spinner's onCancel or other solution when @clack/prompts@1.0 is released - // We disable/enable the exit hook to friend it with spinner's "Cancel" event - const loader = spinner() - - this.#disableExitHook?.() - loader.start(message) - - const result = await promise - - loader.stop(message) - this.#enableExitHook() - - return result - } - - async render(_object: any, node: React.ReactNode) { - // Without waiting for the next tick after clack prompts, - // ink render will be immidiately terminated - await setImmediate() - - const app = render(node) - await app.waitUntilExit() - } - - #disableExitHook?: ReturnType - #enableExitHook() { - this.#disableExitHook = exitHook(() => this.#handleExit()) - } - - #handleExit() { - outro( - `Problems? ${pc.underline(pc.cyan("https://github.com/datisthq/dpkit/issues"))}`, - ) - } -} - -export class JsonSession extends Session { - start = () => {} - success = () => {} - error = () => {} - - async select(_options: SelectOptions): Promise { - Session.terminate("Selection is not supported in JSON mode") - } - - async render(object: any, _node: React.ReactNode) { - console.log(JSON.stringify(object, null, 2)) - } - - async task(_message: string, promise: Promise) { - return await promise - } -} diff --git a/cli/main.ts b/cli/main.ts deleted file mode 100644 index 2cfaf5eb..00000000 --- a/cli/main.ts +++ /dev/null @@ -1,30 +0,0 @@ -// TODO: Support tab completion when @bombsh/tab is released -//import tab from "@bombsh/tab/commander" -import { program } from "commander" -import { dialectCommand } from "./commands/dialect/index.ts" -import { fileCommand } from "./commands/file/index.ts" -import { packageCommand } from "./commands/package/index.ts" -import { resourceCommand } from "./commands/resource/index.ts" -import { schemaCommand } from "./commands/schema/index.ts" -import { tableCommand } from "./commands/table/index.ts" -import { helpConfiguration } from "./helpers/help.ts" -import metadata from "./package.json" with { type: "json" } - -const main = program - .name("dp") - .description( - "Fast data management CLI built on top of the Data Package standard and Polars DataFrames", - ) - - .version(metadata.version, "-v, --version") - .configureHelp(helpConfiguration) - - .addCommand(packageCommand) - .addCommand(resourceCommand) - .addCommand(dialectCommand) - .addCommand(schemaCommand) - .addCommand(tableCommand) - .addCommand(fileCommand) - -//tab(main) -main.parse() diff --git a/cli/package.json b/cli/package.json deleted file mode 100644 index e8b2e6b4..00000000 --- a/cli/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "@dpkit/cli", - "type": "module", - "version": "0.4.1", - "bin": { - "dp": "./build/entrypoints/run.js" - }, - "license": "MIT", - "author": "Evgeny Karev", - "repository": "https://github.com/datisthq/dpkit", - "description": "Fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames", - "keywords": [ - "data", - "polars", - "dataframe", - "datapackage", - "tableschema", - "typescript", - "validation", - "quality", - "fair", - "cli" - ], - "scripts": { - "build": "tsc && pnpm build:copy && pnpm build:mode", - "build:copy": "cp entrypoints/*.cmd build/entrypoints && cp package.json build", - "build:mode": "chmod +x ./build/entrypoints/*.js", - "compile": "node ./scripts/compile.ts", - "dev": "node ./scripts/dev.ts", - "run": "node ./scripts/run.ts" - }, - "dependencies": { - "@clack/prompts": "^0.11.0", - "@commander-js/extra-typings": "^14.0.0", - "@inkjs/ui": "^2.0.0", - "commander": "^14.0.0", - "dpkit": "workspace:*", - "es-toolkit": "^1.39.10", - "exit-hook": "^4.0.0", - "ink": "^6.1.0", - "ink-select-input": "^6.2.0", - "nodejs-polars": "^0.21.0", - "picocolors": "^1.1.1", - "react": "^19.1.1", - "tiny-invariant": "^1.3.3", - "ts-extras": "^0.14.0" - }, - "devDependencies": { - "@types/node": "24.2.0", - "@types/react": "19.1.9", - "tsx": "4.20.3" - } -} diff --git a/cli/params/ckan.ts b/cli/params/ckan.ts deleted file mode 100644 index cb8ff119..00000000 --- a/cli/params/ckan.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Option } from "commander" - -export const toCkanApiKey = new Option( - "--to-ckan-api-key ", - "API key for CKAN API", -) - -export const toCkanUrl = new Option("--to-ckan-url ", "CKAN URL") - -export const toCkanOwnerOrg = new Option( - "--to-ckan-owner-org ", - "Owner organization for the CKAN dataset", -) - -export const toCkanDatasetName = new Option( - "--to-ckan-dataset-name ", - "Name for the CKAN dataset", -) diff --git a/cli/params/dialect.ts b/cli/params/dialect.ts deleted file mode 100644 index 919195ae..00000000 --- a/cli/params/dialect.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { Option } from "commander" - -export const header = new Option( - "--header", - "whether the file includes a header row with field names", -).default(true) - -export const headerRows = new Option( - "--header-rows ", - "comma-separated row numbers (zero-based) that are considered header rows", -) - -export const headerJoin = new Option( - "--header-join ", - "character used to join multi-line headers", -) - -export const commentRows = new Option( - "--comment-rows ", - "comma-separated rows to be excluded from the data (zero-based)", -) - -export const commentChar = new Option( - "--comment-char ", - "character sequence denoting the start of a comment line", -) - -export const delimiter = new Option( - "--delimiter ", - "character used to separate fields in the data", -) - -export const lineTerminator = new Option( - "--line-terminator ", - "character sequence used to terminate rows", -) - -export const quoteChar = new Option( - "--quote-char ", - "character used to quote fields", -) - -export const doubleQuote = new Option( - "--double-quote", - "whether a sequence of two quote characters represents a single quote", -) - -export const escapeChar = new Option( - "--escape-char ", - "character used to escape the delimiter or quote characters", -) - -export const nullSequence = new Option( - "--null-sequence ", - "character sequence representing null or missing values in the data", -) - -export const skipInitialSpace = new Option( - "--skip-initial-space", - "whether to ignore whitespace immediately following the delimiter", -) - -export const property = new Option( - "--property ", - "for JSON data, the property name containing the data array", -) - -export const itemType = new Option( - "--item-type ", - "the type of data item in the source", -).choices(["array", "object"]) - -export const itemKeys = new Option( - "--item-keys ", - "comma-separated object properties to extract as values (for object-based data items)", -) - -export const sheetNumber = new Option( - "--sheet-number ", - "for spreadsheet data, the sheet number to read (zero-based)", -).argParser(Number.parseInt) - -export const sheetName = new Option( - "--sheet-name ", - "for spreadsheet data, the sheet name to read", -) - -export const table = new Option( - "--table ", - "for database sources, the table name to read", -) - -export const toHeader = new Option( - "--to-header", - "whether the file includes a header row with field names", -).default(true) - -export const toHeaderRows = new Option( - "--to-header-rows ", - "comma-separated row numbers (zero-based) that are considered header rows", -) - -export const toHeaderJoin = new Option( - "--to-header-join ", - "character used to join multi-line headers", -) - -export const toCommentRows = new Option( - "--to-comment-rows ", - "comma-separated rows to be excluded from the data (zero-based)", -) - -export const toCommentChar = new Option( - "--to-comment-char ", - "character sequence denoting the start of a comment line", -) - -export const toDelimiter = new Option( - "--to-delimiter ", - "character used to separate fields in the data", -) - -export const toLineTerminator = new Option( - "--to-line-terminator ", - "character sequence used to terminate rows", -) - -export const toQuoteChar = new Option( - "--to-quote-char ", - "character used to quote fields", -) - -export const toDoubleQuote = new Option( - "--to-double-quote", - "whether a sequence of two quote characters represents a single quote", -) - -export const toEscapeChar = new Option( - "--to-escape-char ", - "character used to escape the delimiter or quote characters", -) - -export const toNullSequence = new Option( - "--to-null-sequence ", - "character sequence representing null or missing values in the data", -) - -export const toSkipInitialSpace = new Option( - "--to-skip-initial-space", - "whether to ignore whitespace immediately following the delimiter", -) - -export const toProperty = new Option( - "--to-property ", - "for JSON data, the property name containing the data array", -) - -export const toItemType = new Option( - "--to-item-type ", - "the type of data item in the source", -).choices(["array", "object"]) - -export const toItemKeys = new Option( - "--to-item-keys ", - "comma-separated object properties to extract as values (for object-based data items)", -) - -export const toSheetNumber = new Option( - "--to-sheet-number ", - "for spreadsheet data, the sheet number to read (zero-based)", -).argParser(Number.parseInt) - -export const toSheetName = new Option( - "--to-sheet-name ", - "for spreadsheet data, the sheet name to read", -) - -export const toTable = new Option( - "--to-table ", - "for database sources, the table name to read", -) diff --git a/cli/params/file.ts b/cli/params/file.ts deleted file mode 100644 index 4db3d8a6..00000000 --- a/cli/params/file.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Option } from "commander" - -export const hashType = new Option("--hash-type ", "hash type") - .choices(["md5", "sha1", "sha256", "sha512"]) - .default("sha256") - -export const bytes = new Option( - "--bytes ", - "expected file size in bytes", -) - -export const hash = new Option("--hash ", "expected file hash") diff --git a/cli/params/github.ts b/cli/params/github.ts deleted file mode 100644 index 63a81e3f..00000000 --- a/cli/params/github.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Option } from "commander" - -export const toGithubApiKey = new Option( - "--to-github-api-key ", - "API key for GitHub API", -) - -export const toGithubRepo = new Option( - "--to-github-repo ", - "GitHub repository name", -) - -export const toGithubOrg = new Option( - "--to-github-org ", - "GitHub organization (optional, defaults to user repositories)", -) diff --git a/cli/params/index.ts b/cli/params/index.ts deleted file mode 100644 index 010f53cb..00000000 --- a/cli/params/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./ckan.ts" -export * from "./dialect.ts" -export * from "./file.ts" -export * from "./json.ts" -export * from "./package.ts" -export * from "./path.ts" -export * from "./resource.ts" diff --git a/cli/params/json.ts b/cli/params/json.ts deleted file mode 100644 index 7d770164..00000000 --- a/cli/params/json.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Option } from "commander" - -export const json = new Option("-j, --json", "output as JSON") diff --git a/cli/params/package.ts b/cli/params/package.ts deleted file mode 100644 index 17d88458..00000000 --- a/cli/params/package.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Option } from "commander" - -export const withRemote = new Option( - "--with-remote", - "include remote resources", -) - -export const fromPackage = new Option( - "-p --package ", - "package to select resource from", -) - -export const fromResource = new Option( - "-r --resource ", - "resource in provided package", -) diff --git a/cli/params/path.ts b/cli/params/path.ts deleted file mode 100644 index 132334b9..00000000 --- a/cli/params/path.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Argument, Option } from "commander" - -export const optionalPositionalDescriptorPath = new Argument( - "[path]", - "local or remote path to the descriptor", -) - -export const positionalDescriptorPath = new Argument( - "", - "local or remote path to the descriptor", -) - -export const positionalTablePath = new Argument( - "[path]", - "local or remote path to the table", -) - -export const positionalFilePath = new Argument( - "[path]", - "local or remote path to the file", -) - -export const requiredPositionalFilePath = new Argument( - "", - "local or remote path to the file", -) - -export const positionalFilePaths = new Argument( - "", - "local paths to files", -) - -export const toPath = new Option("--to-path ", "a local output path") - -export const toFolder = new Option( - "--to-folder ", - "a local output folder path", -) - -export const toArchive = new Option( - "--to-archive ", - "a local output zip file path", -) diff --git a/cli/params/resource.ts b/cli/params/resource.ts deleted file mode 100644 index 915f1292..00000000 --- a/cli/params/resource.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Option } from "commander" - -export const toFormat = new Option( - "--to-format ", - "output resource format", -) diff --git a/cli/params/zenodo.ts b/cli/params/zenodo.ts deleted file mode 100644 index fb2f6a49..00000000 --- a/cli/params/zenodo.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Option } from "commander" - -export const toZenodoApiKey = new Option( - "--to-zenodo-api-key ", - "API key for Zenodo API", -) - -export const toZenodoSandbox = new Option( - "--to-zenodo-sandbox", - "Use Zenodo sandbox environment", -).default(false) diff --git a/cli/program.ts b/cli/program.ts deleted file mode 100644 index 8d0d0823..00000000 --- a/cli/program.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { styleText } from "node:util" -import { program } from "commander" -import { dialectCommand } from "./commands/dialect/index.js" -import { packageCommand } from "./commands/package/index.js" -import { tableCommand } from "./commands/table/index.js" -import metadata from "./package.json" with { type: "json" } - -const root = program - .name("dp") - .description( - "Fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames", - ) - .version(metadata.version) - .configureHelp({ - styleTitle: str => styleText("bold", str.toUpperCase().slice(0, -1)), - }) - -root.addCommand(packageCommand) -root.addCommand(tableCommand) -root.addCommand(dialectCommand) - -root.parse() diff --git a/cli/scripts/compile.ts b/cli/scripts/compile.ts deleted file mode 100644 index b7db5709..00000000 --- a/cli/scripts/compile.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { execa } from "execa" -import metadata from "../package.json" with { type: "json" } -const $ = execa({ preferLocal: true, stdout: ["inherit"] }) - -// Cleanup - -await $`rm -rf compile` -await $`mkdir compile` - -// Prepare dependencies - -await $` -pnpm deploy compile ---legacy ---production ---filter cli ---config.node-linker=hoisted -` - -// Compile application - -await $({ - cwd: "compile", -})`deno compile --allow-all --no-check --output build/dp-${metadata.version}-x86_64-unknown-linux-gnu main.ts` diff --git a/docs/astro.config.ts b/docs/astro.config.ts index 5ed1cf79..c3c47973 100644 --- a/docs/astro.config.ts +++ b/docs/astro.config.ts @@ -7,7 +7,7 @@ import starlightScrollToTop from "starlight-scroll-to-top" import starlightTypeDoc from "starlight-typedoc" const PACKAGES = { - dpkit: "../dpkit", + "@dpkit/all": "../all", "@dpkit/arrow": "../arrow", "@dpkit/camtrap": "../camtrap", "@dpkit/ckan": "../ckan", diff --git a/docs/content/docs/guides/csv.md b/docs/content/docs/guides/csv.md index d8e4bf48..8c855c6e 100644 --- a/docs/content/docs/guides/csv.md +++ b/docs/content/docs/guides/csv.md @@ -21,7 +21,7 @@ For having both loading and processing of CSV files, the [dpkit](https://github. The CSV plugin automatically handles `.csv` and `.tsv` files when using dpkit: ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" const table = await readTable({path: "table.csv"}) // the field types will be automatically inferred diff --git a/docs/content/docs/guides/ods.md b/docs/content/docs/guides/ods.md index 663c5666..52b4a745 100644 --- a/docs/content/docs/guides/ods.md +++ b/docs/content/docs/guides/ods.md @@ -20,7 +20,7 @@ For complete loading and processing of ODS files, the [dpkit](https://github.com The ODS plugin automatically handles `.ods` files when using dpkit: ```typescript -import { readTable, saveTable } from "dpkit" +import { readTable, saveTable } from "@dpkit/all" const table = await readTable({path: "table.ods"}) // the field types will be automatically inferred @@ -38,7 +38,7 @@ The ouput of `readTable` is a Polars LazyDataFrame, allowing you to use all of t ::: ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // Load a simple ODS file const table = await readTable({ path: "data.ods" }) @@ -65,7 +65,7 @@ df.describe() ### Saving ODS Files ```typescript -import { saveTable } from "dpkit" +import { saveTable } from "@dpkit/all" // Save with default options await saveTable(table, { path: "output.ods" }) @@ -84,7 +84,7 @@ await saveTable(table, { ### Sheet Selection ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // Select by sheet number (1-indexed) const table = await readTable({ @@ -106,7 +106,7 @@ const table = await readTable({ ### Multi-Header Row Processing ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // ODS with multiple header rows: // Year | 2023 | 2023 | 2024 | 2024 @@ -126,7 +126,7 @@ const table = await readTable({ ### Comment Row Handling ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // ODS with comment rows const table = await readTable({ @@ -149,7 +149,7 @@ const table = await readTable({ ### Remote File Loading ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // Load from URL const table = await readTable({ @@ -168,7 +168,7 @@ const table = await readTable({ ### Header Options ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // No header row (use generated column names) const table = await readTable({ diff --git a/docs/content/docs/guides/visidata.md b/docs/content/docs/guides/visidata.md index 0d5a8f92..a856861c 100644 --- a/docs/content/docs/guides/visidata.md +++ b/docs/content/docs/guides/visidata.md @@ -9,7 +9,7 @@ sidebar: ## Installation -- [Install dpkit CLI](../../cli/installation) +- [Install dpkit CLI](https://dpkit.dev/overview/getting-started/) - [Install VisiData](https://www.visidata.org/install/) ## Usage diff --git a/docs/content/docs/guides/xlsx.md b/docs/content/docs/guides/xlsx.md index 2e61466b..6efd4393 100644 --- a/docs/content/docs/guides/xlsx.md +++ b/docs/content/docs/guides/xlsx.md @@ -20,7 +20,7 @@ For complete loading and processing of XLSX files, the [dpkit](https://github.co The XLSX plugin automatically handles `.xlsx` files when using dpkit: ```typescript -import { readTable, saveTable } from "dpkit" +import { readTable, saveTable } from "@dpkit/all" const table = await readTable({path: "table.xlsx"}) // the field types will be automatically inferred @@ -38,7 +38,7 @@ The ouput of `readTable` is a Polars LazyDataFrame, allowing you to use all of t ::: ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // Load a simple XLSX file const table = await readTable({ path: "data.xlsx" }) @@ -65,7 +65,7 @@ df.describe() ### Saving XLSX Files ```typescript -import { saveTable } from "dpkit" +import { saveTable } from "@dpkit/all" // Save with default options await saveTable(table, { path: "output.xlsx" }) @@ -84,7 +84,7 @@ await saveTable(table, { ### Sheet Selection ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // Select by sheet number (1-indexed) const table = await readTable({ @@ -106,7 +106,7 @@ const table = await readTable({ ### Multi-Header Row Processing ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // XLSX with multiple header rows: // Year | 2023 | 2023 | 2024 | 2024 @@ -126,7 +126,7 @@ const table = await readTable({ ### Comment Row Handling ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // XLSX with comment rows const table = await readTable({ @@ -149,7 +149,7 @@ const table = await readTable({ ### Remote File Loading ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // Load from URL const table = await readTable({ @@ -168,7 +168,7 @@ const table = await readTable({ ### Header Options ```typescript -import { readTable } from "dpkit" +import { readTable } from "@dpkit/all" // No header row (use generated column names) const table = await readTable({ @@ -186,4 +186,4 @@ const table = await readTable({ headerRows: [3] // Use third row as header } }) -``` \ No newline at end of file +``` diff --git a/docs/content/docs/index.md b/docs/content/docs/index.md index 7d84818e..68797ee6 100644 --- a/docs/content/docs/index.md +++ b/docs/content/docs/index.md @@ -35,7 +35,7 @@ The documentation uses `npm` command to install packages. If you are using other The framework can be installed as one package: ```bash -npm install dpkit +npm install @dpkit/all ``` Or cherry-picked from individual packages: @@ -63,7 +63,7 @@ dpkit is built with type safety in mind. It uses TypeScript to provide type defi Loading a Camtrap DP package from Zenodo merging system Zenodo metadata into a user data package and validating its metadata: ```ts -import { loadPackage } from "dpkit" +import { loadPackage } from "@dpkit/all" const { dataPackage } = await loadPackage("https://zenodo.org/records/10053903") @@ -79,7 +79,7 @@ console.log(dataPackage) Example of using a Data Package extension in type-safe manner. Not supported properties will indicate type errors in your IDE: ```ts -import { loadPackage, assertCamtrapPackage } from "dpkit" +import { loadPackage, assertCamtrapPackage } from "@dpkit/all" const { dataPackage } = await loadPackage("https://raw.githubusercontent.com/tdwg/camtrap-dp/refs/tags/1.0.1/example/datapackage.json") @@ -94,7 +94,7 @@ console.log(camtrapPackage.bibliographicCitation) Validating an in-memory package descriptor: ```ts -import { validatePackageDescriptor } from "dpkit" +import { validatePackageDescriptor } from "@dpkit/all" const { valid, errors } = await validatePackageDescriptor({ name: "package" }) @@ -121,7 +121,7 @@ import { loadPackageFromZip, savePackageToZip, getTempFilePath, -} from "dpkit" +} from "@dpkit/all" const archivePath = getTempFilePath() const sourcePath = await loadPackageDescriptor( @@ -136,7 +136,7 @@ console.log(targetPackage) Reading a CSV table: ```ts -import { loadTable } from "dpkit" +import { loadTable } from "@dpkit/all" const table = await loadTable({ path: "data.csv" }) @@ -153,4 +153,4 @@ const table = await loadTable({ ## Reference -See **API Reference** of each individual package for more details. Note, that `dpkit` package re-exports most of the functionality. +See **API Reference** of each individual package for more details. Note, that `@dpkit/all` package re-exports most of the functionality. diff --git a/docs/content/docs/overview/getting-started.md b/docs/content/docs/overview/getting-started.md deleted file mode 100644 index 7d84818e..00000000 --- a/docs/content/docs/overview/getting-started.md +++ /dev/null @@ -1,156 +0,0 @@ ---- -title: dpkit TypeScript -sidebar: - order: 1 - label: Getting Started ---- - -This guide will help you get started with dpkit. If you are new to the core framework's tecnhologies, please take a look at the [Data Package standard](https://datapackage.org/) and [Polars DataFrames](https://pola.rs/) documentation. - -## Runtimes - -:::tip -- It is possible to use dpkit in [Jupyter Notebooks](/guides/jupyter)! -::: - -dpkit and all its packages support all the prominent TypeScript runtimes: - -- **Node.js v22+** -- **Deno v2+** -- **Bun v1+** - -The core package `@dpkit/core` additionally supports browser environments: - -- **Edge v92+** -- **Chrome v92+** -- **Firefox v90+** -- and others - -## Installation - -:::note -The documentation uses `npm` command to install packages. If you are using other package managers, please adjust the commands accordingly. -::: - -The framework can be installed as one package: - -```bash -npm install dpkit -``` - -Or cherry-picked from individual packages: - -```bash -npm install @dpkit/core @dpkit/zenodo -``` - -Or the core package can be just imported in browsers using NPM CDNs: - -```js -import { loadPackageDescriptor } from "https://esm.sh/@dpkit/core" -``` - -## TypeScript - -:::tip -Use **Node.js v24+** to be able to run TypeScript files directly with the `node` binary like `node my-data-script.ts` -::: - -dpkit is built with type safety in mind. It uses TypeScript to provide type definitions for all packages and to enforce type safety throughout the framework. It's highly reccomended to setup a TypeScript aware environment to work with the project. - -## Examples - -Loading a Camtrap DP package from Zenodo merging system Zenodo metadata into a user data package and validating its metadata: - -```ts -import { loadPackage } from "dpkit" - -const { dataPackage } = await loadPackage("https://zenodo.org/records/10053903") - -console.log(dataPackage) -//{ -// id: 'https://doi.org/10.5281/zenodo.10053903', -// profile: 'tabular-data-package', -// ... -//} - -``` - -Example of using a Data Package extension in type-safe manner. Not supported properties will indicate type errors in your IDE: - -```ts -import { loadPackage, assertCamtrapPackage } from "dpkit" - -const { dataPackage } = await loadPackage("https://raw.githubusercontent.com/tdwg/camtrap-dp/refs/tags/1.0.1/example/datapackage.json") - -const camtrapPackage = await assertCamtrapPackage(dataPackage) - -console.log(camtrapPackage.project.title) -// Management of Invasive Coypu and muskrAt in Europe -console.log(camtrapPackage.bibliographicCitation) -// Desmet P, Neukermans A, Van der beeck D, Cartuyvels E (2022)... -``` - -Validating an in-memory package descriptor: - -```ts -import { validatePackageDescriptor } from "dpkit" - -const { valid, errors } = await validatePackageDescriptor({ name: "package" }) - -console.log(valid) -// false -console.log(errors) -//[ -// { -// instancePath: '', -// schemaPath: '#/required', -// keyword: 'required', -// params: { missingProperty: 'resources' }, -// message: "must have required property 'resources'", -// type: 'descriptor' -// } -//] -``` - -Loading a package from a remote descriptor and saving it locally as a zip archive, and then using it as a local data package: - -```ts -import { - loadPackageDescriptor, - loadPackageFromZip, - savePackageToZip, - getTempFilePath, -} from "dpkit" - -const archivePath = getTempFilePath() -const sourcePath = await loadPackageDescriptor( - "https://raw.githubusercontent.com/roll/currency-codes/refs/heads/master/datapackage.json", -) - -await savePackageToZip(sourcePackage, { archivePath }) -const targetPackage = await loadPackageFromZip(archivePath) -console.log(targetPackage) -``` - -Reading a CSV table: - -```ts -import { loadTable } from "dpkit" - -const table = await loadTable({ path: "data.csv" }) - -// Load with custom dialect -const table = await loadTable({ - path: "data.csv", - dialect: { - delimiter: ";", - header: true, - skipInitialSpace: true - } -}) -``` - -## Reference - -See **API Reference** of each individual package for more details. Note, that `dpkit` package re-exports most of the functionality. diff --git a/docs/package.json b/docs/package.json index 4c6bc5ec..21b35b20 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,8 +9,8 @@ }, "devDependencies": { "@astrojs/starlight": "0.35.2", + "@dpkit/all": "workspace:*", "astro": "5.12.9", - "dpkit": "workspace:*", "nodejs-polars": "0.21.0", "sharp": "0.34.2", "starlight-changelogs": "0.1.1", diff --git a/dpkit/tsconfig.json b/dpkit/tsconfig.json deleted file mode 100644 index 3c43903c..00000000 --- a/dpkit/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../tsconfig.json" -} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 24b6f845..73f80eb2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,15 +1,14 @@ dangerouslyAllowAllBuilds: true packages: + - all - arrow - camtrap - ckan - - cli - core - csv - datahub - db - docs - - dpkit - file - folder - github From 09e2bc1bc1f7d4930e4b1e2233b2f51416737454 Mon Sep 17 00:00:00 2001 From: roll Date: Tue, 2 Sep 2025 12:11:06 +0100 Subject: [PATCH 2/3] Updated readme/changelog --- all/CHANGELOG.md | 2 +- all/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/all/CHANGELOG.md b/all/CHANGELOG.md index 8e12f730..e29a9c00 100644 --- a/all/CHANGELOG.md +++ b/all/CHANGELOG.md @@ -1,4 +1,4 @@ -# dpkit +# @dpkit/all ## 0.8.0 diff --git a/all/README.md b/all/README.md index 6f6cc6eb..476f8355 100644 --- a/all/README.md +++ b/all/README.md @@ -1,3 +1,3 @@ -# dpkit +# @dpkit/all dpkit is a fast TypeScript data management framework built on top of the Data Package standard and Polars DataFrames. It supports various formats like CSV, JSON, and Parquet and integrates with data platforms such as CKAN, Zenodo, and GitHub. For more information, please visit the [documentation portal](https://dpkit.datist.io). From 3f517e425cdfc5b4b517f60e0c3e55ea161de3da Mon Sep 17 00:00:00 2001 From: roll Date: Tue, 2 Sep 2025 12:12:41 +0100 Subject: [PATCH 3/3] Updated lockfile --- pnpm-lock.yaml | 537 ++++++------------------------------------------- 1 file changed, 61 insertions(+), 476 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dcd346fb..ce4e3f8b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,6 +45,60 @@ importers: specifier: 3.1.4 version: 3.1.4(@types/debug@4.1.12)(@types/node@24.2.0)(@vitest/ui@3.1.4)(tsx@4.20.3)(yaml@2.8.1) + all: + dependencies: + '@dpkit/arrow': + specifier: workspace:* + version: link:../arrow + '@dpkit/camtrap': + specifier: workspace:* + version: link:../camtrap + '@dpkit/ckan': + specifier: workspace:* + version: link:../ckan + '@dpkit/core': + specifier: workspace:* + version: link:../core + '@dpkit/csv': + specifier: workspace:* + version: link:../csv + '@dpkit/datahub': + specifier: workspace:* + version: link:../datahub + '@dpkit/file': + specifier: workspace:* + version: link:../file + '@dpkit/folder': + specifier: workspace:* + version: link:../folder + '@dpkit/github': + specifier: workspace:* + version: link:../github + '@dpkit/inline': + specifier: workspace:* + version: link:../inline + '@dpkit/json': + specifier: workspace:* + version: link:../json + '@dpkit/ods': + specifier: workspace:* + version: link:../ods + '@dpkit/parquet': + specifier: workspace:* + version: link:../parquet + '@dpkit/table': + specifier: workspace:* + version: link:../table + '@dpkit/xlsx': + specifier: workspace:* + version: link:../xlsx + '@dpkit/zenodo': + specifier: workspace:* + version: link:../zenodo + '@dpkit/zip': + specifier: workspace:* + version: link:../zip + arrow: dependencies: '@dpkit/core': @@ -86,61 +140,6 @@ importers: specifier: workspace:* version: link:../test - cli: - dependencies: - '@clack/prompts': - specifier: ^0.11.0 - version: 0.11.0 - '@commander-js/extra-typings': - specifier: ^14.0.0 - version: 14.0.0(commander@14.0.0) - '@inkjs/ui': - specifier: ^2.0.0 - version: 2.0.0(ink@6.1.0(@types/react@19.1.9)(react@19.1.1)) - commander: - specifier: ^14.0.0 - version: 14.0.0 - dpkit: - specifier: workspace:* - version: link:../dpkit - es-toolkit: - specifier: ^1.39.10 - version: 1.39.10 - exit-hook: - specifier: ^4.0.0 - version: 4.0.0 - ink: - specifier: ^6.1.0 - version: 6.1.0(@types/react@19.1.9)(react@19.1.1) - ink-select-input: - specifier: ^6.2.0 - version: 6.2.0(ink@6.1.0(@types/react@19.1.9)(react@19.1.1))(react@19.1.1) - nodejs-polars: - specifier: ^0.21.0 - version: 0.21.0 - picocolors: - specifier: ^1.1.1 - version: 1.1.1 - react: - specifier: ^19.1.1 - version: 19.1.1 - tiny-invariant: - specifier: ^1.3.3 - version: 1.3.3 - ts-extras: - specifier: ^0.14.0 - version: 0.14.0 - devDependencies: - '@types/node': - specifier: 24.2.0 - version: 24.2.0 - '@types/react': - specifier: 19.1.9 - version: 19.1.9 - tsx: - specifier: 4.20.3 - version: 4.20.3 - core: dependencies: '@sindresorhus/slugify': @@ -195,12 +194,12 @@ importers: '@astrojs/starlight': specifier: 0.35.2 version: 0.35.2(astro@5.12.9(@types/node@24.2.0)(rollup@4.46.2)(tsx@4.20.3)(typescript@5.9.2)(yaml@2.8.1)) + '@dpkit/all': + specifier: workspace:* + version: link:../all astro: specifier: 5.12.9 version: 5.12.9(@types/node@24.2.0)(rollup@4.46.2)(tsx@4.20.3)(typescript@5.9.2)(yaml@2.8.1) - dpkit: - specifier: workspace:* - version: link:../dpkit nodejs-polars: specifier: 0.21.0 version: 0.21.0 @@ -226,60 +225,6 @@ importers: specifier: 4.8.0 version: 4.8.0(typedoc@0.28.9(typescript@5.9.2)) - dpkit: - dependencies: - '@dpkit/arrow': - specifier: workspace:* - version: link:../arrow - '@dpkit/camtrap': - specifier: workspace:* - version: link:../camtrap - '@dpkit/ckan': - specifier: workspace:* - version: link:../ckan - '@dpkit/core': - specifier: workspace:* - version: link:../core - '@dpkit/csv': - specifier: workspace:* - version: link:../csv - '@dpkit/datahub': - specifier: workspace:* - version: link:../datahub - '@dpkit/file': - specifier: workspace:* - version: link:../file - '@dpkit/folder': - specifier: workspace:* - version: link:../folder - '@dpkit/github': - specifier: workspace:* - version: link:../github - '@dpkit/inline': - specifier: workspace:* - version: link:../inline - '@dpkit/json': - specifier: workspace:* - version: link:../json - '@dpkit/ods': - specifier: workspace:* - version: link:../ods - '@dpkit/parquet': - specifier: workspace:* - version: link:../parquet - '@dpkit/table': - specifier: workspace:* - version: link:../table - '@dpkit/xlsx': - specifier: workspace:* - version: link:../xlsx - '@dpkit/zenodo': - specifier: workspace:* - version: link:../zenodo - '@dpkit/zip': - specifier: workspace:* - version: link:../zip - file: dependencies: '@dpkit/core': @@ -490,10 +435,6 @@ importers: packages: - '@alcalzone/ansi-tokenize@0.1.3': - resolution: {integrity: sha512-3yWxPTq3UQ/FY9p1ErPxIyfT64elWaMvM9lIHnaqpyft63tkxodF5aUElYHrdisWve5cETkh1+KBw1yJuW0aRw==} - engines: {node: '>=14.13.1'} - '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -670,17 +611,6 @@ packages: '@changesets/write@0.4.0': resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} - '@clack/core@0.5.0': - resolution: {integrity: sha512-p3y0FIOwaYRUPRcMO7+dlmLh8PSRcrjuTndsiA0WAFbWES0mLZlrjVoBRZ9DzkPFJZG6KGkJmoEAY0ZcVWTkow==} - - '@clack/prompts@0.11.0': - resolution: {integrity: sha512-pMN5FcrEw9hUkZA4f+zLlzivQSeQf5dRGJjSUbvVYDLvpKCdQx5OaknvKzgbtXOizhP+SJJJjqEbOe55uKKfAw==} - - '@commander-js/extra-typings@14.0.0': - resolution: {integrity: sha512-hIn0ncNaJRLkZrxBIp5AsW/eXEHNKYQBh0aPdoUqNgD+Io3NIykQqpKFyKcuasZhicGaEZJX/JBSIkZ4e5x8Dg==} - peerDependencies: - commander: ~14.0.0 - '@ctrl/tinycolor@4.1.0': resolution: {integrity: sha512-WyOx8cJQ+FQus4Mm4uPIZA64gbk3Wxh0so5Lcii0aJifqwoVOlfFtorjLE0Hen4OYyHZMXDWqMmaQemBhgxFRQ==} engines: {node: '>=14'} @@ -1086,12 +1016,6 @@ packages: cpu: [x64] os: [win32] - '@inkjs/ui@2.0.0': - resolution: {integrity: sha512-5+8fJmwtF9UvikzLfph9sA+LS+l37Ij/szQltkuXLOAXwNkBX9innfzh4pLGXIB59vKEQUtc6D4qGvhD7h3pAg==} - engines: {node: '>=18'} - peerDependencies: - ink: '>=5' - '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1473,9 +1397,6 @@ packages: '@types/node@24.2.0': resolution: {integrity: sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==} - '@types/react@19.1.9': - resolution: {integrity: sha512-WmdoynAX8Stew/36uTSVMcLJJ1KRh6L3IZRx1PZ7qJtBqT3dYTgyDTx8H1qoRghErydW7xw9mSJ3wS//tCRpFA==} - '@types/sax@1.2.7': resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} @@ -1567,10 +1488,6 @@ packages: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} - ansi-escapes@7.0.0: - resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} - engines: {node: '>=18'} - ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1632,10 +1549,6 @@ packages: engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'} hasBin: true - auto-bind@5.0.1: - resolution: {integrity: sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -1769,18 +1682,6 @@ packages: resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} engines: {node: '>=10'} - cli-cursor@4.0.0: - resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - cli-spinners@3.2.0: - resolution: {integrity: sha512-pXftdQloMZzjCr3pCTIRniDcys6dDzgpgVhAHHk6TKBDbRuP1MkuetTF5KSv4YUutbOPa7+7ZrAJ2kVtbMqyXA==} - engines: {node: '>=18.20'} - - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - clone@2.1.2: resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} engines: {node: '>=0.8'} @@ -1789,10 +1690,6 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - code-excerpt@4.0.0: - resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -1813,10 +1710,6 @@ packages: comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} - commander@14.0.0: - resolution: {integrity: sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==} - engines: {node: '>=20'} - common-ancestor-path@1.0.1: resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} @@ -1828,10 +1721,6 @@ packages: resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} engines: {node: '>= 0.6'} - convert-to-spaces@2.0.1: - resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - cookie-es@1.2.2: resolution: {integrity: sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==} @@ -1876,9 +1765,6 @@ packages: engines: {node: '>=4'} hasBin: true - csstype@3.1.3: - resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - csv-sniffer@0.1.1: resolution: {integrity: sha512-HMFcKMGCaJNBtkEk1RYZxngODTx0gQnN5x494fWJizua2mdoM1h/LRooZQMkxx5RRHNP0mowlTw9xiS7QhXt/g==} @@ -1906,10 +1792,6 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - define-data-property@1.1.4: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} @@ -2015,10 +1897,6 @@ packages: resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} - environment@1.1.0: - resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} - engines: {node: '>=18'} - es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -2034,9 +1912,6 @@ packages: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} - es-toolkit@1.39.10: - resolution: {integrity: sha512-E0iGnTtbDhkeczB0T+mxmoVlT4YNweEKBLq7oaU4p11mecdsZpNWOglI4895Vh4usbQ+LsJiuLuI2L0Vdmfm2w==} - esast-util-from-estree@2.0.0: resolution: {integrity: sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==} @@ -2055,10 +1930,6 @@ packages: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} - engines: {node: '>=8'} - escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} @@ -2393,33 +2264,9 @@ packages: import-meta-resolve@4.1.0: resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - ink-select-input@6.2.0: - resolution: {integrity: sha512-304fZXxkpYxJ9si5lxRCaX01GNlmPBgOZumXXRnPYbHW/iI31cgQynqk2tRypGLOF1cMIwPUzL2LSm6q4I5rQQ==} - engines: {node: '>=18'} - peerDependencies: - ink: '>=5.0.0' - react: '>=18.0.0' - - ink@6.1.0: - resolution: {integrity: sha512-YQ+lbMD79y3FBAJXXZnuRajLEgaMFp102361eY5NrBIEVCi9oFo7gNZU4z2LBWlcjZFiTt7jetlkIbKCCH4KJA==} - engines: {node: '>=20'} - peerDependencies: - '@types/react': '>=19.0.0' - react: '>=19.0.0' - react-devtools-core: ^4.19.1 - peerDependenciesMeta: - '@types/react': - optional: true - react-devtools-core: - optional: true - inline-style-parser@0.2.4: resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==} @@ -2459,14 +2306,6 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-fullwidth-code-point@5.0.0: - resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} - engines: {node: '>=18'} - is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2474,11 +2313,6 @@ packages: is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} - is-in-ci@1.0.0: - resolution: {integrity: sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==} - engines: {node: '>=18'} - hasBin: true - is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -2546,9 +2380,6 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -2601,10 +2432,6 @@ packages: longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - loupe@3.2.0: resolution: {integrity: sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw==} @@ -2839,10 +2666,6 @@ packages: engines: {node: '>=4'} hasBin: true - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} @@ -3002,10 +2825,6 @@ packages: resolution: {integrity: sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==} engines: {node: '>= 0.8'} - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} - engines: {node: '>=6'} - oniguruma-parser@0.12.1: resolution: {integrity: sha512-8Unqkvk1RYc6yq2WBYRj4hdnsAxVze8i7iPfQr8e4uSP3tRv0rpZcbGUDvxfQQcdwHt/e9PrMvGCsa8OqG9X3w==} @@ -3084,10 +2903,6 @@ packages: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} - patch-console@2.0.0: - resolution: {integrity: sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -3210,16 +3025,6 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} - react-reconciler@0.32.0: - resolution: {integrity: sha512-2NPMOzgTlG0ZWdIf3qG+dcbLSoAc/uLfOwckc3ofy5sSK0pLJqnQLpUFxvGcN2rlXSjnVtGeeFLNimCQEj5gOQ==} - engines: {node: '>=0.10.0'} - peerDependencies: - react: ^19.1.0 - - react@19.1.1: - resolution: {integrity: sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==} - engines: {node: '>=0.10.0'} - read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} @@ -3308,10 +3113,6 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - restore-cursor@4.0.0: - resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - restructure@3.0.2: resolution: {integrity: sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==} @@ -3354,12 +3155,6 @@ packages: sax@1.4.1: resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - - scheduler@0.26.0: - resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==} - semver@7.7.2: resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} engines: {node: '>=10'} @@ -3417,9 +3212,6 @@ packages: siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} @@ -3447,14 +3239,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - slice-ansi@7.1.0: - resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} - engines: {node: '>=18'} - slugify@1.6.6: resolution: {integrity: sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==} engines: {node: '>=8.0.0'} @@ -3480,10 +3264,6 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} - stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -3613,10 +3393,6 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - to-rotated@1.0.0: - resolution: {integrity: sha512-KsEID8AfgUy+pxVRLsWp0VzCa69wxzUDZnzGbyIST/bcgcrMvTYoFBX/QORH4YApoD89EDuUovx4BTdpOn319Q==} - engines: {node: '>=18'} - toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} @@ -3634,10 +3410,6 @@ packages: trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} - ts-extras@0.14.0: - resolution: {integrity: sha512-hxaLXbdiDxTAMES3MLwdQhIY7B8+ZaS9GXht9aEIv1dVi2lB8C6syN6UmkCjdXpNzk/aBi3fOs/4NV9bo5+PtQ==} - engines: {node: '>=18'} - tsconfck@3.1.6: resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==} engines: {node: ^18 || >=20} @@ -3972,18 +3744,6 @@ packages: resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} engines: {node: '>=18'} - ws@8.18.3: - resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz: resolution: {tarball: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz} version: 0.20.3 @@ -4021,9 +3781,6 @@ packages: resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==} engines: {node: '>=18'} - yoga-layout@3.2.1: - resolution: {integrity: sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ==} - zod-to-json-schema@3.24.6: resolution: {integrity: sha512-h/z3PKvcTcTetyjl1fkj79MHNEjm+HpD6NXheWjzOekY7kV+lwDYnHw+ivHkijnCSMz1yJaWBD9vu/Fcmk+vEg==} peerDependencies: @@ -4043,11 +3800,6 @@ packages: snapshots: - '@alcalzone/ansi-tokenize@0.1.3': - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.12 @@ -4363,21 +4115,6 @@ snapshots: human-id: 4.1.1 prettier: 2.8.8 - '@clack/core@0.5.0': - dependencies: - picocolors: 1.1.1 - sisteransi: 1.0.5 - - '@clack/prompts@0.11.0': - dependencies: - '@clack/core': 0.5.0 - picocolors: 1.1.1 - sisteransi: 1.0.5 - - '@commander-js/extra-typings@14.0.0(commander@14.0.0)': - dependencies: - commander: 14.0.0 - '@ctrl/tinycolor@4.1.0': {} '@emnapi/core@1.4.5': @@ -4663,14 +4400,6 @@ snapshots: '@img/sharp-win32-x64@0.34.2': optional: true - '@inkjs/ui@2.0.0(ink@6.1.0(@types/react@19.1.9)(react@19.1.1))': - dependencies: - chalk: 5.5.0 - cli-spinners: 3.2.0 - deepmerge: 4.3.1 - figures: 6.1.0 - ink: 6.1.0(@types/react@19.1.9)(react@19.1.1) - '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -5064,10 +4793,6 @@ snapshots: dependencies: undici-types: 7.10.0 - '@types/react@19.1.9': - dependencies: - csstype: 3.1.3 - '@types/sax@1.2.7': dependencies: '@types/node': 24.2.0 @@ -5187,10 +4912,6 @@ snapshots: ansi-colors@4.1.3: {} - ansi-escapes@7.0.0: - dependencies: - environment: 1.1.0 - ansi-regex@5.0.1: {} ansi-regex@6.1.0: {} @@ -5332,8 +5053,6 @@ snapshots: - uploadthing - yaml - auto-bind@5.0.1: {} - axobject-query@4.1.0: {} bail@2.0.2: {} @@ -5462,25 +5181,10 @@ snapshots: cli-boxes@3.0.0: {} - cli-cursor@4.0.0: - dependencies: - restore-cursor: 4.0.0 - - cli-spinners@3.2.0: {} - - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - clone@2.1.2: {} clsx@2.1.1: {} - code-excerpt@4.0.0: - dependencies: - convert-to-spaces: 2.0.1 - collapse-white-space@2.1.0: {} color-convert@2.0.1: @@ -5501,8 +5205,6 @@ snapshots: comma-separated-tokens@2.0.3: {} - commander@14.0.0: {} - common-ancestor-path@1.0.1: {} content-disposition@0.5.4: @@ -5511,8 +5213,6 @@ snapshots: content-type@1.0.5: {} - convert-to-spaces@2.0.1: {} - cookie-es@1.2.2: {} cookie-signature@1.0.6: {} @@ -5555,8 +5255,6 @@ snapshots: cssesc@3.0.0: {} - csstype@3.1.3: {} - csv-sniffer@0.1.1: {} debug@2.6.9: @@ -5573,8 +5271,6 @@ snapshots: deep-eql@5.0.2: {} - deepmerge@4.3.1: {} - define-data-property@1.1.4: dependencies: es-define-property: 1.0.1 @@ -5654,8 +5350,6 @@ snapshots: entities@6.0.1: {} - environment@1.1.0: {} - es-define-property@1.0.1: {} es-errors@1.3.0: {} @@ -5666,8 +5360,6 @@ snapshots: dependencies: es-errors: 1.3.0 - es-toolkit@1.39.10: {} - esast-util-from-estree@2.0.0: dependencies: '@types/estree-jsx': 1.0.5 @@ -5715,8 +5407,6 @@ snapshots: escape-string-regexp@1.0.5: {} - escape-string-regexp@2.0.0: {} - escape-string-regexp@5.0.0: {} esprima@4.0.1: {} @@ -5962,6 +5652,7 @@ snapshots: get-tsconfig@4.10.1: dependencies: resolve-pkg-maps: 1.0.0 + optional: true github-slugger@2.0.0: {} @@ -6256,50 +5947,8 @@ snapshots: import-meta-resolve@4.1.0: {} - indent-string@5.0.0: {} - inherits@2.0.4: {} - ink-select-input@6.2.0(ink@6.1.0(@types/react@19.1.9)(react@19.1.1))(react@19.1.1): - dependencies: - figures: 6.1.0 - ink: 6.1.0(@types/react@19.1.9)(react@19.1.1) - react: 19.1.1 - to-rotated: 1.0.0 - - ink@6.1.0(@types/react@19.1.9)(react@19.1.1): - dependencies: - '@alcalzone/ansi-tokenize': 0.1.3 - ansi-escapes: 7.0.0 - ansi-styles: 6.2.1 - auto-bind: 5.0.1 - chalk: 5.5.0 - cli-boxes: 3.0.0 - cli-cursor: 4.0.0 - cli-truncate: 4.0.0 - code-excerpt: 4.0.0 - es-toolkit: 1.39.10 - indent-string: 5.0.0 - is-in-ci: 1.0.0 - patch-console: 2.0.0 - react: 19.1.1 - react-reconciler: 0.32.0(react@19.1.1) - scheduler: 0.23.2 - signal-exit: 3.0.7 - slice-ansi: 7.1.0 - stack-utils: 2.0.6 - string-width: 7.2.0 - type-fest: 4.41.0 - widest-line: 5.0.0 - wrap-ansi: 9.0.0 - ws: 8.18.3 - yoga-layout: 3.2.1 - optionalDependencies: - '@types/react': 19.1.9 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - inline-style-parser@0.2.4: {} ipaddr.js@1.9.1: {} @@ -6325,20 +5974,12 @@ snapshots: is-fullwidth-code-point@3.0.0: {} - is-fullwidth-code-point@4.0.0: {} - - is-fullwidth-code-point@5.0.0: - dependencies: - get-east-asian-width: 1.3.0 - is-glob@4.0.3: dependencies: is-extglob: 2.1.1 is-hexadecimal@2.0.1: {} - is-in-ci@1.0.0: {} - is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 @@ -6398,8 +6039,6 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - js-tokens@4.0.0: {} - js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -6445,10 +6084,6 @@ snapshots: longest-streak@3.1.0: {} - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - loupe@3.2.0: {} lru-cache@10.4.3: {} @@ -6966,8 +6601,6 @@ snapshots: mime@1.6.0: {} - mimic-fn@2.1.0: {} - minimatch@9.0.5: dependencies: brace-expansion: 2.0.2 @@ -7084,10 +6717,6 @@ snapshots: on-headers@1.1.0: {} - onetime@5.1.2: - dependencies: - mimic-fn: 2.1.0 - oniguruma-parser@0.12.1: {} oniguruma-to-es@4.3.3: @@ -7172,8 +6801,6 @@ snapshots: parseurl@1.3.3: {} - patch-console@2.0.0: {} - path-exists@4.0.0: {} path-key@3.1.1: {} @@ -7268,13 +6895,6 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 - react-reconciler@0.32.0(react@19.1.1): - dependencies: - react: 19.1.1 - scheduler: 0.26.0 - - react@19.1.1: {} - read-yaml-file@1.1.0: dependencies: graceful-fs: 4.2.11 @@ -7428,12 +7048,8 @@ snapshots: resolve-from@5.0.0: {} - resolve-pkg-maps@1.0.0: {} - - restore-cursor@4.0.0: - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 + resolve-pkg-maps@1.0.0: + optional: true restructure@3.0.2: {} @@ -7504,12 +7120,6 @@ snapshots: sax@1.4.1: {} - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - - scheduler@0.26.0: {} - semver@7.7.2: {} send@0.19.0: @@ -7645,8 +7255,6 @@ snapshots: siginfo@2.0.0: {} - signal-exit@3.0.7: {} - signal-exit@4.1.0: {} simple-invariant@2.0.1: {} @@ -7672,16 +7280,6 @@ snapshots: slash@3.0.0: {} - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - slice-ansi@7.1.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 5.0.0 - slugify@1.6.6: {} smol-toml@1.4.1: {} @@ -7699,10 +7297,6 @@ snapshots: sprintf-js@1.0.3: {} - stack-utils@2.0.6: - dependencies: - escape-string-regexp: 2.0.0 - stackback@0.0.2: {} starlight-changelogs@0.1.1(@astrojs/starlight@0.35.2(astro@5.12.9(@types/node@24.2.0)(rollup@4.46.2)(tsx@4.20.3)(typescript@5.9.2)(yaml@2.8.1)))(astro@5.12.9(@types/node@24.2.0)(rollup@4.46.2)(tsx@4.20.3)(typescript@5.9.2)(yaml@2.8.1)): @@ -7828,8 +7422,6 @@ snapshots: dependencies: is-number: 7.0.0 - to-rotated@1.0.0: {} - toidentifier@1.0.1: {} totalist@3.0.1: {} @@ -7840,10 +7432,6 @@ snapshots: trough@2.2.0: {} - ts-extras@0.14.0: - dependencies: - type-fest: 4.41.0 - tsconfck@3.1.6(typescript@5.9.2): optionalDependencies: typescript: 5.9.2 @@ -7856,6 +7444,7 @@ snapshots: get-tsconfig: 4.10.1 optionalDependencies: fsevents: 2.3.3 + optional: true type-fest@1.4.0: {} @@ -8138,8 +7727,6 @@ snapshots: string-width: 7.2.0 strip-ansi: 7.1.0 - ws@8.18.3: {} - xlsx@https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz: {} xxhash-wasm@1.1.0: {} @@ -8166,8 +7753,6 @@ snapshots: yoctocolors@2.1.1: {} - yoga-layout@3.2.1: {} - zod-to-json-schema@3.24.6(zod@3.25.76): dependencies: zod: 3.25.76