Repository navigation
Conversation
The flags of all flags files with one source can be imported from
flags:<source>, e.g. `import { summerSale } from 'flags:self'`, as well
as from their file. writeFlagsFileSources writes .flags/<source>.ts with
re-exports of each file, .flags/aliases.json for the framework plugins,
and flags/generated.d.ts with the type of each flag from its file. A key
in two files of one source fails a build. The dev servers write the
modules again after each change of a flags file.
Co-Authored-By: Claude <noreply@anthropic.com>
formatFlagsFile of flags/tooling formats a flags file and keeps its comments. `flags format [paths...] [--check]` formats the files in place or checks them in CI. `flags format --stdin` is for editors: Zed uses it as the external formatter of the language Flags, because an extension of Zed can not give a formatter without a language server. Co-Authored-By: Claude <noreply@anthropic.com>
…declaration files always
Flags files:
- `flag <name> { key: "…" }`: the name is the export which the code
imports, `key` is the key in the flag management system (the default is
the name). A flag can set its own `source`. Two flags with the same key
and source are an error (DuplicateKey). The grammars of Tree-sitter, Zed
and VS Code follow.
Types:
- The SDK writes the declaration file of each flags file (`app.d.flags.ts`)
also when tsconfig.json has the content mapper. Editors with an older
TypeScript (e.g. vtsls of Zed) read it, and TypeScript 7.1 with
--runExternalCode still uses the content mapper.
- `writeFlagsFileDeclaration` of flags/tooling writes one file if it
changed. The loaders of Next.js and Vite and flags/register use it.
`usesContentMapper` is gone.
- SPEC: the empty environment of the content mapper comes from
node_modules/.bin/tsc of TypeScript 7.1 beta on Node.js 22
(process.execve without env), not from TypeScript.
Example examples/standard/node-flags-files: a plain Node.js server with
src/app.flags, `node --import flags/register`, and the content mapper of
TypeScript 7.1 beta (type-check:content-mapper, needs Node.js 24).
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This branch was successfully deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.