Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fixtures/typescript/tests/baselines/reference/* -text whitespace=cr-at-eol
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TypeScript Baseline Lib Generator

Generates `baseline.d.ts`, a TypeScript lib that contains only the JavaScript built-ins that are [Baseline widely available](https://web.dev/baseline). It classifies the `javascript.builtins.*` compat rows from `web-features` and emits the declarations whose `baselineStatus` is `"high"`.
Generates `baseline.d.ts`, a TypeScript lib for TypeScript-declarable JavaScript features that are [Baseline widely available](https://web.dev/baseline). It currently classifies `javascript.builtins.*` and the `arguments` object from `web-features`.

## Using the lib

Expand All @@ -14,18 +14,17 @@ npm install --save-dev typescript-baseline-lib
{
"compilerOptions": {
"noLib": true,
"skipLibCheck": true,
"types": ["typescript-baseline-lib"]
}
}
```

Now only Baseline widely available built-ins type-check. APIs that haven't reached Baseline yet (`Promise.withResolvers`, `Array.fromAsync` until it promotes, and so on) are reported as errors. The end goal is first-class `--lib baseline` support upstream in TypeScript.
Now only the supported Baseline widely available JavaScript surfaces type-check. APIs that haven't reached Baseline yet (`Promise.withResolvers`, `Array.fromAsync` until it promotes, and so on) are reported as errors. The end goal is first-class `--lib baseline` support upstream in TypeScript.

## Current contract

- Target is `baseline` only.
- Scope is `javascript.builtins.*` only.
- Scope is TypeScript-declarable JavaScript surfaces: `javascript.builtins.*` plus the `arguments` object.
- DOM, Web Worker, syntax, grammar, statements, and operators are out of scope.
- Special compat rows are managed in `registry/compat-management.json` with a source URL for each.
- The checked-in dataset, derived, and generated artifacts are overwritten with the rolling latest; history lives in Git.
- The checked-in dataset, derived, and generated artifacts are overwritten with the rolling latest; history lives in Git.
2 changes: 1 addition & 1 deletion deploy/package-registry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const deployGeneratedDirectory = path.join(deployDirectory, "generated");
export const baselinePackage = {
id: "baseline",
name: "typescript-baseline-lib",
description: "Baseline widely available JavaScript built-in declarations for TypeScript.",
description: "Baseline widely available JavaScript declarations for TypeScript.",
initialVersion: "0.0.1",
license: "Apache-2.0",
keywords: [
Expand Down
7 changes: 3 additions & 4 deletions deploy/readmes/baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Generated `baseline` declarations for TypeScript.

This package is produced by the [`TypeScript-Baseline-lib-generator`](https://github.com/3ru/TypeScript-Baseline-lib-generator) repo. It packages the JavaScript built-ins that are [Baseline widely available](https://web.dev/baseline) (`baselineStatus === "high"`) as a single global declaration bundle.
This package is produced by the [`TypeScript-Baseline-lib-generator`](https://github.com/3ru/TypeScript-Baseline-lib-generator) repo. It packages TypeScript-declarable JavaScript features that are [Baseline widely available](https://web.dev/baseline) as a single global declaration bundle.

Current snapshot:

Expand All @@ -26,16 +26,15 @@ npm install --save-dev {{PACKAGE_NAME}}
{
"compilerOptions": {
"noLib": true,
"skipLibCheck": true,
"types": ["{{PACKAGE_NAME}}"]
}
}
```

Now only Baseline widely available built-ins type-check; APIs that haven't reached Baseline yet are reported as errors.
Now only the supported Baseline widely available JavaScript surfaces type-check; APIs that haven't reached Baseline yet are reported as errors.

## Notes

- The public surface is a single `baseline` lib.
- The current scope is `javascript.builtins.*` only.
- The current scope is `javascript.builtins.*` plus the `arguments` object.
- The generated declarations are derived from the npm `typescript` package and preserve the upstream Microsoft license notice inside `baseline.d.ts`.
Loading