forked from foxglove/schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export TS types from main; move generation exports under
internal
(f…
…oxglove#63) **Public-Facing Changes** Moved TypeScript types and enums to the main `@foxglove/schemas` entry point; moved raw schema structures and generation functions to `@foxglove/schemas/internal` entry point. Added `@foxglove/schemas/jsonschema` entry point for JSON Schema. Removed ESM outputs because without full package.json `"exports"` support, importing from `@foxglove/schemas/internal` can only point to one place, not intelligently one of `dist/cjs` or `dist/esm`. This required removing the tsconfig `outDir`, so output files are placed alongside source files. The import syntax is now: ```ts import { CompressedImage } from "@foxglove/schemas"; // TS type or enum import { CompressedImage } from "@foxglove/schemas/jsonschema"; // json schema as POJO import { foxgloveMessageSchemas } from "@foxglove/schemas/internal"; // internal representation of all schemas ``` **Description** Resolves foxglove#41
- Loading branch information
Showing
23 changed files
with
4,797 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This file exists to allow packages to import via `import { Foo } from "@foxglove/schemas/jsonschema"`. | ||
|
||
export * from "../schemas/jsonschema"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,18 @@ | |
"name": "Foxglove Technologies", | ||
"email": "[email protected]" | ||
}, | ||
"module": "dist/esm/src/index.js", | ||
"main": "dist/cjs/src/index.js", | ||
"typings": "dist/esm/src/index.d.ts", | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"main": "schemas/typescript/index.js", | ||
"typings": "schemas/typescript/index.d.ts", | ||
"scripts": { | ||
"prepack": "tsc -b tsconfig.json tsconfig.cjs.json && yarn update-generated-files", | ||
"prepack": "yarn update-generated-files && tsc -p tsconfig.json", | ||
"typecheck": "tsc -p tsconfig.json --noEmit", | ||
"lint:ci": "eslint --report-unused-disable-directives .", | ||
"lint": "eslint --report-unused-disable-directives --fix .", | ||
"test": "jest", | ||
"update-generated-files": "ts-node --files --project tsconfig.cjs.json scripts/updateGeneratedFiles --out-dir schemas --ros-out-dir ros_foxglove_msgs" | ||
"update-generated-files": "ts-node --files --project tsconfig.json scripts/updateGeneratedFiles --out-dir schemas --ros-out-dir ros_foxglove_msgs" | ||
}, | ||
"devDependencies": { | ||
"@foxglove/eslint-plugin": "0.20.0", | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.