@wtf/project-docs 2.3.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/.generated +16 -13
- package/api/@wtf/project-astro/README.md +42 -25
- package/api/@wtf/project-astro/config/README.md +9 -1
- package/api/@wtf/project-astro/config/functions/baseConfig.md +10 -6
- package/api/@wtf/project-astro/config/functions/baseOf.md +5 -5
- package/api/@wtf/project-astro/config/functions/siteOf.md +5 -5
- package/api/@wtf/project-astro/config/type-aliases/BaseOptions.md +21 -19
- package/api/@wtf/project-astro/config/type-aliases/Env.md +3 -3
- package/api/@wtf/project-astro/errors/classes/BrokenLinksError.md +5 -5
- package/api/@wtf/project-astro/errors/classes/InvalidRedirectError.md +6 -6
- package/api/@wtf/project-astro/errors/classes/RedirectedLinksError.md +5 -5
- package/api/@wtf/project-astro/errors/classes/SiteError.md +4 -4
- package/api/@wtf/project-astro/index/README.md +3 -1
- package/api/@wtf/project-astro/index/type-aliases/AstroPlatform.md +15 -0
- package/api/@wtf/project-astro/index/type-aliases/BrokenLink.md +3 -3
- package/api/@wtf/project-astro/index/type-aliases/IgnoredLine.md +4 -4
- package/api/@wtf/project-astro/index/type-aliases/RedirectInput.md +2 -2
- package/api/@wtf/project-astro/index/type-aliases/RedirectMatch.md +3 -3
- package/api/@wtf/project-astro/index/type-aliases/RedirectRule.md +5 -5
- package/api/@wtf/project-astro/index/type-aliases/RedirectStatus.md +1 -1
- package/api/@wtf/project-astro/index/type-aliases/RedirectedLink.md +2 -2
- package/api/@wtf/project-astro/index/type-aliases/Redirects.md +3 -3
- package/api/@wtf/project-astro/links/README.md +4 -0
- package/api/@wtf/project-astro/links/functions/brokenLinksIn.md +1 -1
- package/api/@wtf/project-astro/links/functions/links.md +15 -6
- package/api/@wtf/project-astro/links/functions/redirectedLinksIn.md +1 -1
- package/api/@wtf/project-astro/links/type-aliases/LinksOptions.md +23 -0
- package/api/@wtf/project-astro/links/variables/LINKS.md +1 -1
- package/api/@wtf/project-astro/pages/functions/fixSearchUrlsIn.md +1 -1
- package/api/@wtf/project-astro/pages/functions/moveConflictingPages.md +1 -1
- package/api/@wtf/project-astro/pages/functions/pages.md +9 -6
- package/api/@wtf/project-astro/pages/functions/prefixedLocaleOf.md +1 -1
- package/api/@wtf/project-astro/pages/functions/redirectBaseToLocaleIn.md +1 -1
- package/api/@wtf/project-astro/pages/functions/slashFolderLinksIn.md +1 -1
- package/api/@wtf/project-astro/pages/type-aliases/I18n.md +1 -1
- package/api/@wtf/project-astro/pages/type-aliases/PagesOptions.md +2 -2
- package/api/@wtf/project-astro/pages/variables/PAGES.md +1 -1
- package/api/@wtf/project-astro/preview/README.md +7 -4
- package/api/@wtf/project-astro/preview/functions/files.md +1 -1
- package/api/@wtf/project-astro/preview/functions/listen.md +1 -1
- package/api/@wtf/project-astro/preview/functions/notFound.md +1 -1
- package/api/@wtf/project-astro/preview/functions/pagesOf.md +1 -1
- package/api/@wtf/project-astro/preview/functions/previewOf.md +6 -5
- package/api/@wtf/project-astro/preview/type-aliases/FilesOptions.md +2 -2
- package/api/@wtf/project-astro/preview/type-aliases/Handler.md +1 -1
- package/api/@wtf/project-astro/preview/type-aliases/ListenOptions.md +4 -4
- package/api/@wtf/project-astro/preview/type-aliases/Listening.md +5 -5
- package/api/@wtf/project-astro/preview/type-aliases/Pages.md +3 -3
- package/api/@wtf/project-astro/preview/type-aliases/Preview.md +4 -4
- package/api/@wtf/project-astro/preview/type-aliases/PreviewOptions.md +8 -7
- package/api/@wtf/project-astro/redirects/functions/formatRedirects.md +1 -1
- package/api/@wtf/project-astro/redirects/functions/matchRedirect.md +1 -1
- package/api/@wtf/project-astro/redirects/functions/parseRedirects.md +1 -1
- package/api/@wtf/project-astro/redirects/variables/MAX_PARTS.md +1 -1
- package/api/@wtf/project-astro/redirects/variables/MAX_RULES.md +1 -1
- package/api/@wtf/project-astro/redirects/variables/MAX_SIZE.md +1 -1
- package/api/@wtf/project-astro/schema/README.md +7 -3
- package/api/@wtf/project-astro/schema/functions/astroSchemaWith.md +3 -3
- package/api/@wtf/project-astro/schema/type-aliases/AstroSection.md +11 -0
- package/api/@wtf/project-astro/schema/type-aliases/JsonSchema.md +12 -12
- package/api/@wtf/project-astro/schema/type-aliases/OptionsSchema.md +1 -1
- package/api/@wtf/project-astro/schema/variables/astroProperties.md +4 -3
- package/api/@wtf/project-astro/schema/variables/astroSchema.md +5 -5
- package/api/@wtf/project-config/README.md +44 -27
- package/api/@wtf/project-config/define/functions/defineConfig.md +1 -1
- package/api/@wtf/project-config/env/README.md +5 -4
- package/api/@wtf/project-config/env/functions/envNameOf.md +1 -1
- package/api/@wtf/project-config/env/functions/envPrefixOf.md +1 -1
- package/api/@wtf/project-config/env/functions/jsonSchemaOf.md +1 -1
- package/api/@wtf/project-config/env/functions/variablesOf.md +1 -1
- package/api/@wtf/project-config/env/functions/withEnvironment.md +1 -1
- package/api/@wtf/project-config/env/type-aliases/Environment.md +1 -1
- package/api/@wtf/project-config/env/type-aliases/EnvironmentValue.md +3 -3
- package/api/@wtf/project-config/env/type-aliases/WithEnvironment.md +3 -3
- package/api/@wtf/project-config/errors/classes/ConfigError.md +4 -4
- package/api/@wtf/project-config/errors/classes/ConfigFileMismatchError.md +6 -6
- package/api/@wtf/project-config/errors/classes/ConfigInCodeError.md +5 -5
- package/api/@wtf/project-config/errors/classes/ConfigPathError.md +5 -5
- package/api/@wtf/project-config/errors/classes/EnvPlaceholderUnsetError.md +6 -6
- package/api/@wtf/project-config/errors/classes/InvalidConfigFileError.md +5 -5
- package/api/@wtf/project-config/errors/classes/InvalidSectionError.md +7 -7
- package/api/@wtf/project-config/errors/classes/NamedError.md +15 -11
- package/api/@wtf/project-config/errors/classes/NoConfigFileError.md +5 -5
- package/api/@wtf/project-config/errors/classes/NoConfigValueError.md +6 -6
- package/api/@wtf/project-config/errors/classes/SyncConfigInCodeError.md +5 -5
- package/api/@wtf/project-config/errors/classes/SyncSchemaError.md +5 -5
- package/api/@wtf/project-config/errors/classes/UnwritableConfigFileError.md +5 -5
- package/api/@wtf/project-config/errors/type-aliases/NamedErrorCode.md +1 -1
- package/api/@wtf/project-config/errors/type-aliases/NamedErrorDetails.md +46 -10
- package/api/@wtf/project-config/index/type-aliases/ConfigDefaults.md +3 -3
- package/api/@wtf/project-config/index/type-aliases/ConfigEnvironment.md +4 -4
- package/api/@wtf/project-config/index/type-aliases/ConfigIssue.md +3 -3
- package/api/@wtf/project-config/index/type-aliases/ConfigNames.md +4 -4
- package/api/@wtf/project-config/index/type-aliases/ConfigPath.md +1 -1
- package/api/@wtf/project-config/index/type-aliases/ConfigPlatform.md +3 -3
- package/api/@wtf/project-config/index/type-aliases/ConfigSection.md +1 -1
- package/api/@wtf/project-config/index/type-aliases/ConfigSource.md +3 -3
- package/api/@wtf/project-config/index/type-aliases/ConfigSyncPlatform.md +5 -5
- package/api/@wtf/project-config/index/type-aliases/ConfigWrite.md +10 -10
- package/api/@wtf/project-config/index/type-aliases/ImportModule.md +1 -1
- package/api/@wtf/project-config/index/type-aliases/JsonSchema.md +1 -1
- package/api/@wtf/project-config/index/type-aliases/LocatedConfig.md +4 -4
- package/api/@wtf/project-config/index/type-aliases/NamespaceConfig.md +2 -2
- package/api/@wtf/project-config/index/type-aliases/ResolvedConfig.md +9 -9
- package/api/@wtf/project-config/index/type-aliases/SectionSchema.md +1 -1
- package/api/@wtf/project-config/index/type-aliases/SectionsOf.md +1 -1
- package/api/@wtf/project-config/index/type-aliases/SyncFiles.md +3 -3
- package/api/@wtf/project-config/index/type-aliases/ValidateSection.md +1 -1
- package/api/@wtf/project-config/load/README.md +12 -5
- package/api/@wtf/project-config/load/functions/ignoredWarning.md +1 -1
- package/api/@wtf/project-config/load/functions/importFileModule.md +1 -1
- package/api/@wtf/project-config/load/functions/loadConfig.md +10 -11
- package/api/@wtf/project-config/load/functions/loadConfigSync.md +4 -4
- package/api/@wtf/project-config/load/type-aliases/LoadLayers.md +5 -5
- package/api/@wtf/project-config/load/type-aliases/LoadOptions.md +4 -3
- package/api/@wtf/project-config/load/type-aliases/LoadPlatform.md +15 -0
- package/api/@wtf/project-config/load/type-aliases/LoadSyncOptions.md +8 -2
- package/api/@wtf/project-config/load/type-aliases/LoadSyncPlatform.md +19 -0
- package/api/@wtf/project-config/locate/README.md +5 -2
- package/api/@wtf/project-config/locate/functions/configFilesOf.md +1 -1
- package/api/@wtf/project-config/locate/functions/configNamesOf.md +1 -1
- package/api/@wtf/project-config/locate/functions/jsonFilesOf.md +1 -1
- package/api/@wtf/project-config/locate/functions/locateConfig.md +1 -1
- package/api/@wtf/project-config/locate/functions/locateConfigSync.md +1 -1
- package/api/@wtf/project-config/locate/functions/projectRootOf.md +1 -1
- package/api/@wtf/project-config/locate/functions/projectRootOfSync.md +1 -1
- package/api/@wtf/project-config/locate/type-aliases/LocateNames.md +2 -2
- package/api/@wtf/project-config/locate/type-aliases/LocateOptions.md +2 -2
- package/api/@wtf/project-config/locate/type-aliases/LocateSyncOptions.md +2 -2
- package/api/@wtf/project-config/locate/type-aliases/NamespaceNames.md +2 -2
- package/api/@wtf/project-config/locate/variables/DEFAULT_NAMESPACE.md +1 -1
- package/api/@wtf/project-config/named/README.md +4 -1
- package/api/@wtf/project-config/named/functions/factoryOf.md +1 -1
- package/api/@wtf/project-config/named/functions/namedSchema.md +1 -1
- package/api/@wtf/project-config/named/functions/namedSetSchema.md +1 -1
- package/api/@wtf/project-config/named/functions/resolveNamed.md +4 -2
- package/api/@wtf/project-config/named/functions/resolveNamedSet.md +7 -3
- package/api/@wtf/project-config/named/type-aliases/LoadModule.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/ModuleReference.md +3 -3
- package/api/@wtf/project-config/named/type-aliases/NamedCheckOptions.md +69 -0
- package/api/@wtf/project-config/named/type-aliases/NamedEntries.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/NamedFactory.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/NamedOptions.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/NamedReference.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/NamedResolveOptions.md +6 -5
- package/api/@wtf/project-config/named/type-aliases/NamedSchema.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/NamedSchemaOptions.md +4 -4
- package/api/@wtf/project-config/named/type-aliases/NamedSet.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/NamedSetOptions.md +10 -40
- package/api/@wtf/project-config/named/type-aliases/NamedSetSchemaOptions.md +3 -3
- package/api/@wtf/project-config/named/type-aliases/NamedSets.md +1 -1
- package/api/@wtf/project-config/named/type-aliases/NamedUse.md +1 -1
- package/api/@wtf/project-config/node/README.md +13 -16
- package/api/@wtf/project-config/node/functions/nodeLoadModule.md +7 -7
- package/api/@wtf/project-config/node/functions/nodeSyncPlatform.md +12 -5
- package/api/@wtf/project-config/path/functions/configPathOf.md +1 -1
- package/api/@wtf/project-config/path/functions/textOfConfigPath.md +1 -1
- package/api/@wtf/project-config/path/functions/valueAt.md +1 -1
- package/api/@wtf/project-config/placeholder/functions/expandPlaceholders.md +1 -1
- package/api/@wtf/project-config/placeholder/functions/expandString.md +1 -1
- package/api/@wtf/project-config/schema/functions/namespaceSchema.md +1 -1
- package/api/@wtf/project-config/schema/functions/sectionIdOf.md +1 -1
- package/api/@wtf/project-config/schema/type-aliases/NamespaceSchemaOptions.md +3 -3
- package/api/@wtf/project-config/schema/variables/JSON_SCHEMA_DRAFT.md +1 -1
- package/api/@wtf/project-config/section/README.md +7 -3
- package/api/@wtf/project-config/section/functions/issuesOf.md +1 -1
- package/api/@wtf/project-config/section/functions/issuesOfSync.md +1 -1
- package/api/@wtf/project-config/section/functions/mergeSection.md +1 -1
- package/api/@wtf/project-config/section/functions/sectionOf.md +6 -6
- package/api/@wtf/project-config/section/functions/sectionOfSync.md +1 -1
- package/api/@wtf/project-config/section/type-aliases/Checked.md +3 -3
- package/api/@wtf/project-config/write/README.md +5 -4
- package/api/@wtf/project-config/write/functions/setConfigValue.md +1 -1
- package/api/@wtf/project-config/write/functions/unsetConfigValue.md +1 -1
- package/api/@wtf/project-config/write/type-aliases/WriteOptions.md +2 -2
- package/api/@wtf/project-oxfmt/README.md +5 -2
- package/api/@wtf/project-oxfmt/config/functions/oxfmtConfig.md +1 -1
- package/api/@wtf/project-oxfmt/config/type-aliases/OxfmtOptions.md +1 -1
- package/api/@wtf/project-oxfmt/config/variables/OXFMT_DEFAULTS.md +6 -6
- package/api/@wtf/project-oxfmt/config/variables/default.md +1 -1
- package/api/@wtf/project-oxfmt/schema/variables/oxfmtSchema.md +1 -1
- package/api/@wtf/project-oxlint/README.md +5 -2
- package/api/@wtf/project-oxlint/config/functions/oxlintConfig.md +1 -1
- package/api/@wtf/project-oxlint/config/type-aliases/OxlintOptions.md +1 -1
- package/api/@wtf/project-oxlint/config/variables/OXLINT_DEFAULTS.md +17 -17
- package/api/@wtf/project-oxlint/config/variables/default.md +1 -1
- package/api/@wtf/project-oxlint/schema/variables/oxlintSchema.md +1 -1
- package/api/@wtf/project-resolve/condition/variables/SOURCE_CONDITION.md +1 -1
- package/api/@wtf/project-resolve/env/functions/isHook.md +1 -1
- package/api/@wtf/project-resolve/env/functions/optionsWithoutHook.md +1 -1
- package/api/@wtf/project-resolve/env/functions/withoutHook.md +1 -1
- package/api/@wtf/project-resolve/env/type-aliases/Env.md +1 -1
- package/api/@wtf/project-resolve/errors/classes/ResolveError.md +4 -4
- package/api/@wtf/project-resolve/errors/classes/UnreadableWorkspaceError.md +6 -6
- package/api/@wtf/project-resolve/errors/classes/WorkspaceError.md +5 -5
- package/api/@wtf/project-resolve/hooks/functions/candidatesOf.md +1 -1
- package/api/@wtf/project-resolve/hooks/functions/sourcesHookOf.md +1 -1
- package/api/@wtf/project-resolve/hooks/functions/sourcesOf.md +1 -1
- package/api/@wtf/project-resolve/hooks/variables/resolveTypeScript.md +1 -1
- package/api/@wtf/project-resolve/node/functions/nodePlatform.md +5 -5
- package/api/@wtf/project-resolve/register/variables/REGISTERED.md +1 -1
- package/api/@wtf/project-resolve/workspace/functions/filesOf.md +1 -1
- package/api/@wtf/project-resolve/workspace/functions/packagesOf.md +1 -1
- package/api/@wtf/project-resolve/workspace/functions/workspaceAt.md +1 -1
- package/api/@wtf/project-resolve/workspace/functions/workspaceOf.md +1 -1
- package/api/@wtf/project-resolve/workspace/functions/workspaceRootAbove.md +1 -1
- package/api/@wtf/project-resolve/workspace/functions/workspaceRootOf.md +1 -1
- package/api/@wtf/project-resolve/workspace/type-aliases/Agent.md +1 -1
- package/api/@wtf/project-resolve/workspace/type-aliases/DirectoryEntry.md +4 -4
- package/api/@wtf/project-resolve/workspace/type-aliases/FileContents.md +3 -3
- package/api/@wtf/project-resolve/workspace/type-aliases/PackageManager.md +4 -4
- package/api/@wtf/project-resolve/workspace/type-aliases/PackageManagerName.md +1 -1
- package/api/@wtf/project-resolve/workspace/type-aliases/ProcessWorkspaceOptions.md +1 -1
- package/api/@wtf/project-resolve/workspace/type-aliases/Workspace.md +5 -5
- package/api/@wtf/project-resolve/workspace/type-aliases/WorkspaceDirectoryHandle.md +6 -6
- package/api/@wtf/project-resolve/workspace/type-aliases/WorkspaceFileHandle.md +3 -3
- package/api/@wtf/project-resolve/workspace/type-aliases/WorkspaceFiles.md +6 -6
- package/api/@wtf/project-resolve/workspace/type-aliases/WorkspaceOptions.md +2 -2
- package/api/@wtf/project-resolve/workspace/type-aliases/WorkspacePackage.md +4 -4
- package/api/@wtf/project-resolve/workspace/type-aliases/WorkspacePaths.md +7 -7
- package/api/@wtf/project-typedoc/README.md +17 -3
- package/api/@wtf/project-typedoc/config/README.md +20 -4
- package/api/@wtf/project-typedoc/config/functions/gitRevisionOf.md +6 -6
- package/api/@wtf/project-typedoc/config/functions/typedocConfig.md +5 -5
- package/api/@wtf/project-typedoc/config/type-aliases/RevisionSources.md +7 -7
- package/api/@wtf/project-typedoc/config/type-aliases/TypedocConfig.md +1 -1
- package/api/@wtf/project-typedoc/config/type-aliases/TypedocOptions.md +8 -6
- package/api/@wtf/project-typedoc/config/type-aliases/TypedocPlatform.md +18 -0
- package/api/@wtf/project-typedoc/plugins/README.md +0 -1
- package/api/@wtf/project-typedoc/plugins/functions/cleanGeneratedMarkdown.md +1 -1
- package/api/@wtf/project-typedoc/plugins/functions/linkTrackedSources.md +2 -2
- package/api/@wtf/project-typedoc/plugins/functions/preventMediaFiles.md +1 -1
- package/api/@wtf/project-typedoc/plugins/type-aliases/CleanGeneratedMarkdownOptions.md +15 -3
- package/api/@wtf/project-typedoc/plugins/type-aliases/LinkTrackedSourcesOptions.md +9 -9
- package/api/@wtf/project-typedoc/plugins/type-aliases/PreventMediaFilesOptions.md +23 -3
- package/api/@wtf/project-typedoc/plugins/type-aliases/TypedocPlugin.md +1 -1
- package/api/@wtf/project-typedoc/schema/README.md +11 -2
- package/api/@wtf/project-typedoc/schema/type-aliases/TypedocSection.md +19 -0
- package/api/@wtf/project-typedoc/schema/variables/typedocSchema.md +6 -5
- package/api/@wtf/project-vite/README.md +20 -11
- package/api/@wtf/project-vite/config/README.md +11 -4
- package/api/@wtf/project-vite/config/functions/baseConfig.md +14 -9
- package/api/@wtf/project-vite/config/functions/buildsSite.md +1 -1
- package/api/@wtf/project-vite/config/functions/compress.md +1 -1
- package/api/@wtf/project-vite/config/functions/conditionsOf.md +8 -7
- package/api/@wtf/project-vite/config/functions/fromDist.md +22 -0
- package/api/@wtf/project-vite/config/type-aliases/BaseOptions.md +15 -2
- package/api/@wtf/project-vite/config/type-aliases/CompressOptions.md +4 -4
- package/api/@wtf/project-vite/config/variables/CLIENT_CONDITIONS.md +1 -1
- package/api/@wtf/project-vite/config/variables/COMPRESSIBLE.md +1 -1
- package/api/@wtf/project-vite/config/variables/THRESHOLD.md +1 -1
- package/api/@wtf/project-vite/schema/README.md +10 -3
- package/api/@wtf/project-vite/schema/type-aliases/ViteSection.md +11 -0
- package/api/@wtf/project-vite/schema/variables/viteSchema.md +5 -4
- package/api/@wtf/project-vitest/README.md +34 -16
- package/api/@wtf/project-vitest/browser/README.md +2 -1
- package/api/@wtf/project-vitest/browser/functions/browserConfig.md +6 -6
- package/api/@wtf/project-vitest/browser/functions/browserRootConfig.md +2 -2
- package/api/@wtf/project-vitest/browser/type-aliases/BrowserOptions.md +8 -6
- package/api/@wtf/project-vitest/config/README.md +17 -1
- package/api/@wtf/project-vitest/config/functions/fromDist.md +22 -0
- package/api/@wtf/project-vitest/config/functions/integrationConfig.md +2 -2
- package/api/@wtf/project-vitest/config/functions/packageConfig.md +17 -10
- package/api/@wtf/project-vitest/config/functions/rootConfig.md +5 -2
- package/api/@wtf/project-vitest/config/type-aliases/PackageOptions.md +18 -0
- package/api/@wtf/project-vitest/config/type-aliases/RootConfigOptions.md +2 -2
- package/api/@wtf/project-vitest/config/type-aliases/RootOptions.md +32 -7
- package/api/@wtf/project-vitest/config/type-aliases/VitestPlatform.md +26 -0
- package/api/@wtf/project-vitest/config/variables/GUARD_TIMEOUT.md +1 -1
- package/api/@wtf/project-vitest/config/variables/integration.md +10 -10
- package/api/@wtf/project-vitest/process/README.md +3 -3
- package/api/@wtf/project-vitest/process/functions/childEnv.md +6 -6
- package/api/@wtf/project-vitest/process/type-aliases/Env.md +1 -1
- package/api/@wtf/project-vitest/schema/README.md +14 -3
- package/api/@wtf/project-vitest/schema/type-aliases/VitestSection.md +12 -0
- package/api/@wtf/project-vitest/schema/variables/vitestSchema.md +6 -5
- package/api/@wtf/project-vitest/storybook/functions/storybookConfig.md +6 -4
- package/api/@wtf/project-vitest/storybook/type-aliases/StorybookOptions.md +3 -3
- package/api/@wtf/project-wpt/README.md +27 -19
- package/api/@wtf/project-wpt/builtins/functions/builtins.md +1 -1
- package/api/@wtf/project-wpt/builtins/functions/intrinsics.md +1 -1
- package/api/@wtf/project-wpt/checkout/README.md +3 -2
- package/api/@wtf/project-wpt/checkout/functions/checkoutFolderOf.md +1 -1
- package/api/@wtf/project-wpt/checkout/functions/checkoutTests.md +1 -1
- package/api/@wtf/project-wpt/checkout/functions/checkoutWpt.md +1 -1
- package/api/@wtf/project-wpt/checkout/functions/execOf.md +28 -0
- package/api/@wtf/project-wpt/checkout/functions/fileOf.md +1 -1
- package/api/@wtf/project-wpt/checkout/type-aliases/CheckedOutTests.md +3 -3
- package/api/@wtf/project-wpt/checkout/type-aliases/CheckoutOptions.md +12 -12
- package/api/@wtf/project-wpt/checkout/type-aliases/CheckoutTestsOptions.md +2 -2
- package/api/@wtf/project-wpt/checkout/variables/HARNESS.md +1 -1
- package/api/@wtf/project-wpt/checkout/variables/REWRITES.md +1 -1
- package/api/@wtf/project-wpt/checkout/variables/WPT_REPOSITORY.md +1 -1
- package/api/@wtf/project-wpt/errors/classes/HarnessFailedError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/InvalidCommitError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/InvalidExpectationsError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/NoSuiteError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/NotInWptError.md +5 -5
- package/api/@wtf/project-wpt/errors/classes/StaleExpectationError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/SubtestFailedError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/UnexpectedPassError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/WptError.md +4 -4
- package/api/@wtf/project-wpt/errors/classes/WptFetchError.md +4 -4
- package/api/@wtf/project-wpt/expectations/functions/checkHarness.md +1 -1
- package/api/@wtf/project-wpt/expectations/functions/checkSubtest.md +1 -1
- package/api/@wtf/project-wpt/expectations/functions/expectationOf.md +1 -1
- package/api/@wtf/project-wpt/expectations/functions/expectationsIssues.md +1 -1
- package/api/@wtf/project-wpt/expectations/functions/readExpectations.md +6 -4
- package/api/@wtf/project-wpt/expectations/functions/staleOf.md +1 -1
- package/api/@wtf/project-wpt/expectations/type-aliases/ReadExpectations.md +3 -3
- package/api/@wtf/project-wpt/index/README.md +2 -5
- package/api/@wtf/project-wpt/index/type-aliases/CreateRealm.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/Exec.md +3 -3
- package/api/@wtf/project-wpt/index/type-aliases/Expectations.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/FileExpectation.md +4 -4
- package/api/@wtf/project-wpt/index/type-aliases/FileResult.md +4 -4
- package/api/@wtf/project-wpt/index/type-aliases/Globals.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/HarnessResult.md +4 -4
- package/api/@wtf/project-wpt/index/type-aliases/HarnessStatus.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/HoldRejections.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/Realm.md +3 -3
- package/api/@wtf/project-wpt/index/type-aliases/SubtestResult.md +5 -5
- package/api/@wtf/project-wpt/index/type-aliases/SubtestStatus.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/WptFile.md +3 -3
- package/api/@wtf/project-wpt/index/type-aliases/WptFiles.md +9 -9
- package/api/@wtf/project-wpt/index/type-aliases/WptPaths.md +4 -4
- package/api/@wtf/project-wpt/index/type-aliases/WptPlatform.md +10 -60
- package/api/@wtf/project-wpt/index/type-aliases/WptSystem.md +8 -8
- package/api/@wtf/project-wpt/index/type-aliases/WptTest.md +3 -3
- package/api/@wtf/project-wpt/meta/functions/idOf.md +1 -1
- package/api/@wtf/project-wpt/meta/functions/metaOf.md +1 -1
- package/api/@wtf/project-wpt/meta/functions/runsOutsideWindow.md +1 -1
- package/api/@wtf/project-wpt/meta/functions/scriptPathsOf.md +1 -1
- package/api/@wtf/project-wpt/meta/functions/testsOf.md +1 -1
- package/api/@wtf/project-wpt/meta/type-aliases/Meta.md +6 -6
- package/api/@wtf/project-wpt/node/README.md +16 -8
- package/api/@wtf/project-wpt/node/functions/nodeSystem.md +9 -3
- package/api/@wtf/project-wpt/node/type-aliases/NodeSystemPlatform.md +12 -0
- package/api/@wtf/project-wpt/node/variables/nodeFiles.md +1 -1
- package/api/@wtf/project-wpt/node/variables/nodeRealm.md +1 -1
- package/api/@wtf/project-wpt/node/variables/nodeRejections.md +1 -1
- package/api/@wtf/project-wpt/run/functions/runTest.md +1 -1
- package/api/@wtf/project-wpt/run/type-aliases/RunOptions.md +10 -9
- package/api/@wtf/project-wpt/run/type-aliases/RunPlatform.md +3 -3
- package/api/@wtf/project-wpt/run/variables/LONG_TIMEOUT.md +1 -1
- package/api/@wtf/project-wpt/run/variables/TIMEOUT.md +1 -1
- package/api/@wtf/project-wpt/run/variables/WPT_ORIGIN.md +1 -1
- package/api/@wtf/project-wpt/schema/README.md +6 -3
- package/api/@wtf/project-wpt/schema/type-aliases/WptConfig.md +2 -2
- package/api/@wtf/project-wpt/schema/type-aliases/WptSuiteConfig.md +2 -2
- package/api/@wtf/project-wpt/schema/variables/wptSchema.md +1 -1
- package/api/@wtf/project-wpt/suite/README.md +6 -2
- package/api/@wtf/project-wpt/suite/functions/wptSuite.md +1 -1
- package/api/@wtf/project-wpt/suite/type-aliases/WptSuiteOptions.md +8 -8
- package/api/llms.txt +8 -3
- package/guides/astro.md +48 -23
- package/guides/config.md +53 -16
- package/guides/getting-started.md +8 -2
- package/guides/presets.md +11 -2
- package/guides/vite.md +20 -10
- package/guides/vitest.md +54 -27
- package/package.json +7 -7
- package/api/@wtf/project-config/node/functions/loadConfig.md +0 -24
- package/api/@wtf/project-config/node/functions/loadConfigSync.md +0 -24
- package/api/@wtf/project-config/node/functions/nodeConfigPlatform.md +0 -16
- package/api/@wtf/project-typedoc/config/variables/nodeRun.md +0 -33
- package/api/@wtf/project-typedoc/plugins/type-aliases/Run.md +0 -25
- package/api/@wtf/project-vite/config/variables/FROM_DIST.md +0 -11
- package/api/@wtf/project-vitest/config/variables/FROM_DIST.md +0 -11
- package/api/@wtf/project-wpt/index/type-aliases/ClearTimeout.md +0 -21
- package/api/@wtf/project-wpt/index/type-aliases/Env.md +0 -11
- package/api/@wtf/project-wpt/index/type-aliases/Performance.md +0 -35
- package/api/@wtf/project-wpt/index/type-aliases/SetTimeout.md +0 -22
- package/api/@wtf/project-wpt/node/functions/nodePlatform.md +0 -18
- package/api/@wtf/project-wpt/node/variables/nodeExec.md +0 -11
package/guides/astro.md
CHANGED
|
@@ -7,25 +7,28 @@ GitLab Pages does, before it ships.
|
|
|
7
7
|
|
|
8
8
|
`@wtf/project-astro` holds it. Astro is a peer dependency: your site names `astro`.
|
|
9
9
|
|
|
10
|
-
| Export | What it is
|
|
11
|
-
| ------------- |
|
|
12
|
-
| `./config` | `baseConfig(options)`, the base of an `astro.config.mjs`, merged with your own by `mergeConfig`
|
|
13
|
-
| `./pages` | `pages(options)`, the integration that makes the build serve on GitLab Pages, and the passes it runs
|
|
14
|
-
| `./links` | `links()`, the integration that fails the build on a link of no page, or of a redirect, and its checks
|
|
15
|
-
| `./redirects` | `parseRedirects`, `formatRedirects` and `matchRedirect`: a `_redirects` file read, written and matched
|
|
16
|
-
| `./preview` | `previewOf(folder, { base })`, a built site to serve as GitLab Pages does, and `listen`, on Node's HTTP server |
|
|
17
|
-
| `./schema` | `astroSchema`, which checks the options of `baseConfig()`, and `astroSchemaWith`, which adds options of yours
|
|
10
|
+
| Export | What it is |
|
|
11
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
12
|
+
| `./config` | `baseConfig({ platform, ...options })`, the base of an `astro.config.mjs`, merged with your own by `mergeConfig` |
|
|
13
|
+
| `./pages` | `pages({ platform, ...options })`, the integration that makes the build serve on GitLab Pages, and the passes it runs |
|
|
14
|
+
| `./links` | `links({ platform })`, the integration that fails the build on a link of no page, or of a redirect, and its checks |
|
|
15
|
+
| `./redirects` | `parseRedirects`, `formatRedirects` and `matchRedirect`: a `_redirects` file read, written and matched |
|
|
16
|
+
| `./preview` | `previewOf(folder, { platform, base })`, a built site to serve as GitLab Pages does, and `listen`, on Node's HTTP server |
|
|
17
|
+
| `./schema` | `astroSchema`, which checks the options of `baseConfig()`, and `astroSchemaWith`, which adds options of yours |
|
|
18
18
|
|
|
19
19
|
## Start from the base
|
|
20
20
|
|
|
21
21
|
```ts
|
|
22
22
|
// astro.config.mjs
|
|
23
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
24
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
23
25
|
import { defineConfig, mergeConfig } from 'astro/config'
|
|
24
26
|
|
|
25
27
|
import { baseConfig } from '@wtf/project-astro/config'
|
|
26
28
|
|
|
29
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
27
30
|
export default defineConfig(
|
|
28
|
-
mergeConfig(baseConfig(), {
|
|
31
|
+
mergeConfig(baseConfig({ platform }), {
|
|
29
32
|
site: 'https://example.com/',
|
|
30
33
|
outDir: 'public',
|
|
31
34
|
publicDir: 'static'
|
|
@@ -33,6 +36,8 @@ export default defineConfig(
|
|
|
33
36
|
)
|
|
34
37
|
```
|
|
35
38
|
|
|
39
|
+
The config file is the entry point: it builds the platform, Node's here, and gives it to the base,
|
|
40
|
+
which reads its environment and its file system, and nothing of the process itself.
|
|
36
41
|
`mergeConfig` of `astro/config` puts your settings over the base's, and your integrations after its
|
|
37
42
|
own. The base sets:
|
|
38
43
|
|
|
@@ -42,29 +47,34 @@ own. The base sets:
|
|
|
42
47
|
- `site` and `base`, from the URL GitLab Pages serves the site at: `ASTRO_BASE`, set it for a domain
|
|
43
48
|
of your own, or else `CI_PAGES_URL`, which a GitLab pipeline sets. The base is the path of that
|
|
44
49
|
URL, such as `/project/` of `https://group.gitlab.io/project`, and none of a site at the root of
|
|
45
|
-
its domain
|
|
50
|
+
its domain, of the platform's `env`. `siteOf(env)` and `baseOf(env)` of `./config` read them. A
|
|
51
|
+
`site` of your own wins.
|
|
46
52
|
- `markdown.processor`, the remark and rehype processor of `@astrojs/markdown-remark`, `unified()`,
|
|
47
53
|
with the plugins you give it.
|
|
48
54
|
- `vite`, from `baseConfig()` of `@wtf/project-vite/config`: the workspace's packages from their
|
|
49
55
|
source, and compressed copies of the scripts and styles of the build (see
|
|
50
56
|
[Vite, and sites](vite.md)).
|
|
51
|
-
- `integrations`: `pages()`, then `links()
|
|
57
|
+
- `integrations`: `pages()`, then `links()`, each of the platform, whose file system they read
|
|
58
|
+
the build by.
|
|
52
59
|
|
|
53
60
|
Give the markdown plugins, the options of the Vite base, and which integrations you want, to
|
|
54
61
|
`baseConfig`:
|
|
55
62
|
|
|
56
63
|
```ts
|
|
64
|
+
import type { AstroPlatform } from '@wtf/project-astro'
|
|
57
65
|
import type { RehypePlugins, RemarkPlugins } from 'astro'
|
|
58
66
|
import { defineConfig, mergeConfig } from 'astro/config'
|
|
59
67
|
|
|
60
68
|
import { baseConfig } from '@wtf/project-astro/config'
|
|
61
69
|
|
|
70
|
+
declare const platform: AstroPlatform
|
|
62
71
|
declare const remarkPlugins: RemarkPlugins
|
|
63
72
|
declare const rehypePlugins: RehypePlugins
|
|
64
73
|
|
|
65
74
|
export default defineConfig(
|
|
66
75
|
mergeConfig(
|
|
67
76
|
baseConfig({
|
|
77
|
+
platform,
|
|
68
78
|
markdown: { remarkPlugins, rehypePlugins },
|
|
69
79
|
vite: { compress: false },
|
|
70
80
|
links: false
|
|
@@ -84,13 +94,16 @@ the section, and refuses a key `baseConfig()` does not take, so a typo fails:
|
|
|
84
94
|
|
|
85
95
|
```ts
|
|
86
96
|
// astro.config.mjs
|
|
87
|
-
import {
|
|
97
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
98
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
99
|
+
import { loadConfig } from '@wtf/project-config/load'
|
|
88
100
|
import { sectionOf } from '@wtf/project-config/section'
|
|
89
101
|
import { baseConfig } from '@wtf/project-astro/config'
|
|
90
102
|
import { astroSchema } from '@wtf/project-astro/schema'
|
|
91
103
|
|
|
92
|
-
const
|
|
93
|
-
|
|
104
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
105
|
+
const config = await loadConfig({ platform })
|
|
106
|
+
export default baseConfig({ platform, ...(await sectionOf(config, 'astro', astroSchema)) })
|
|
94
107
|
```
|
|
95
108
|
|
|
96
109
|
### Add options of your own
|
|
@@ -98,11 +111,14 @@ export default baseConfig({ ...(await sectionOf(config, 'astro', astroSchema)) }
|
|
|
98
111
|
A site, or a package that builds sites, can keep options of its own in the same section. Build
|
|
99
112
|
its schema with `astroSchemaWith(vendor, properties)`: it gives the JSON Schema of each key you
|
|
100
113
|
add beside `astroProperties`, the base's, and still refuses every other key. A key `baseConfig()`
|
|
101
|
-
takes keeps its own schema. Its type is `
|
|
114
|
+
takes keeps its own schema. Its type is `AstroSection`, the options of `baseConfig()` but its
|
|
115
|
+
platform, and yours:
|
|
102
116
|
|
|
103
117
|
```ts
|
|
104
118
|
// astro.config.mjs
|
|
105
|
-
import {
|
|
119
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
120
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
121
|
+
import { loadConfig } from '@wtf/project-config/load'
|
|
106
122
|
import { sectionOf } from '@wtf/project-config/section'
|
|
107
123
|
import { baseConfig } from '@wtf/project-astro/config'
|
|
108
124
|
import { astroSchemaWith } from '@wtf/project-astro/schema'
|
|
@@ -112,9 +128,10 @@ const siteSchema = astroSchemaWith<Analytics>('my-site', {
|
|
|
112
128
|
analytics: { description: 'The ID of the site in its analytics.', type: 'string' }
|
|
113
129
|
})
|
|
114
130
|
|
|
115
|
-
const
|
|
131
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
132
|
+
const config = await loadConfig({ platform })
|
|
116
133
|
const { analytics, ...options } = (await sectionOf(config, 'astro', siteSchema)) ?? {}
|
|
117
|
-
export default baseConfig(options)
|
|
134
|
+
export default baseConfig({ ...options, platform })
|
|
118
135
|
```
|
|
119
136
|
|
|
120
137
|
```json
|
|
@@ -164,12 +181,15 @@ declare them, once:
|
|
|
164
181
|
|
|
165
182
|
```ts
|
|
166
183
|
// astro.config.mjs
|
|
184
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
185
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
167
186
|
import { defineConfig, mergeConfig } from 'astro/config'
|
|
168
187
|
|
|
169
188
|
import { baseConfig } from '@wtf/project-astro/config'
|
|
170
189
|
|
|
190
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
171
191
|
export default defineConfig(
|
|
172
|
-
mergeConfig(baseConfig(), {
|
|
192
|
+
mergeConfig(baseConfig({ platform }), {
|
|
173
193
|
i18n: { locales: ['en', 'sv'], defaultLocale: 'en', routing: { prefixDefaultLocale: true } }
|
|
174
194
|
})
|
|
175
195
|
)
|
|
@@ -181,7 +201,8 @@ A Starlight site can declare them in Starlight's options instead, and not in `i1
|
|
|
181
201
|
It writes nothing of a site whose default locale has no prefix, as `prefixDefaultLocale: false`
|
|
182
202
|
or a Starlight site of one locale at its `root`; of a site that builds a page of its own at its
|
|
183
203
|
base; or of one whose `_redirects` has a rule of the base already, which wins. Switch it off with
|
|
184
|
-
`baseConfig({ pages: { localeRedirect: false } })`, or
|
|
204
|
+
`baseConfig({ platform, pages: { localeRedirect: false } })`, or
|
|
205
|
+
`pages({ platform, localeRedirect: false })`.
|
|
185
206
|
`prefixedLocaleOf(i18n)` gives the prefix it reads of Astro's `i18n`, and
|
|
186
207
|
`redirectBaseToLocaleIn(folder, base, locale)` writes the rule to a folder of a build.
|
|
187
208
|
|
|
@@ -247,9 +268,12 @@ with the flags you choose:
|
|
|
247
268
|
|
|
248
269
|
```ts
|
|
249
270
|
// scripts/preview.ts
|
|
271
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
272
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
250
273
|
import { listen, previewOf } from '@wtf/project-astro/preview'
|
|
251
274
|
|
|
252
|
-
const
|
|
275
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
276
|
+
const site = await previewOf('dist', { platform })
|
|
253
277
|
for (const warning of site.warnings) console.warn(warning)
|
|
254
278
|
const stop = new AbortController()
|
|
255
279
|
for (const signal of ['SIGINT', 'SIGTERM'] as const) process.once(signal, () => stop.abort())
|
|
@@ -267,12 +291,13 @@ await server.closed
|
|
|
267
291
|
}
|
|
268
292
|
```
|
|
269
293
|
|
|
270
|
-
`previewOf(folder,
|
|
271
|
-
in memory; it lists the folder once and answers each request of that list, as a build does not
|
|
294
|
+
`previewOf(folder, { platform })` reads the folder by its path, of the platform's file system,
|
|
295
|
+
against its working folder, or takes a handle, as one in memory; it lists the folder once and answers each request of that list, as a build does not
|
|
272
296
|
change once it is built: start it again to serve a new build.
|
|
273
297
|
|
|
274
298
|
| Option of `previewOf` or `listen` | Default |
|
|
275
299
|
| --------------------------------- | ------------------------------------------------ |
|
|
300
|
+
| `platform` | none: required |
|
|
276
301
|
| `base` | the base of `ASTRO_BASE` or `CI_PAGES_URL`, or / |
|
|
277
302
|
| `host` | `localhost` |
|
|
278
303
|
| `port` | `4321` |
|
package/guides/config.md
CHANGED
|
@@ -46,23 +46,33 @@ export default defineConfig<Sections>({
|
|
|
46
46
|
|
|
47
47
|
## Read it
|
|
48
48
|
|
|
49
|
-
`loadConfig()` of `@wtf/project-config/
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
`loadConfig({ platform })` of `@wtf/project-config/load` loads the config of the platform's
|
|
50
|
+
working folder, `dirs.cwd`, or of the `folder` you give, by its file system, with its `env` over
|
|
51
|
+
it. The config file is the entry point: it builds the platform, as Node's of `@wtf/platform-node`
|
|
52
|
+
and `@wtf/platform-fs-node`, and gives it to the load and to the preset, which read nothing of
|
|
53
|
+
the process themselves. `sectionOf(config, name, schema)` gives one tool's section, checked by its
|
|
54
|
+
schema, or `undefined` when the project gives none. Spread it into the tool's options, and the
|
|
52
55
|
options you write in code come after it, so they win:
|
|
53
56
|
|
|
54
57
|
```ts
|
|
55
58
|
// vite.config.ts
|
|
56
|
-
import {
|
|
59
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
60
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
61
|
+
import { loadConfig } from '@wtf/project-config/load'
|
|
57
62
|
import { sectionOf } from '@wtf/project-config/section'
|
|
58
63
|
import { baseConfig } from '@wtf/project-vite/config'
|
|
59
64
|
import { viteSchema } from '@wtf/project-vite/schema'
|
|
60
65
|
|
|
61
|
-
const
|
|
66
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
67
|
+
const config = await loadConfig({ platform })
|
|
62
68
|
const vite = await sectionOf(config, 'vite', viteSchema)
|
|
63
69
|
|
|
64
70
|
// The section's compress, but never of a test run.
|
|
65
|
-
export default baseConfig({
|
|
71
|
+
export default baseConfig({
|
|
72
|
+
platform,
|
|
73
|
+
...vite,
|
|
74
|
+
...(platform.env.VITEST ? { compress: false } : {})
|
|
75
|
+
})
|
|
66
76
|
```
|
|
67
77
|
|
|
68
78
|
So a setting comes from the preset's default, then the section, then the code.
|
|
@@ -70,7 +80,10 @@ So a setting comes from the preset's default, then the section, then the code.
|
|
|
70
80
|
## The presets' sections
|
|
71
81
|
|
|
72
82
|
Each preset reads no file of its own: it takes options, and exports their schema in `./schema`, a
|
|
73
|
-
Standard Schema that checks a section and gives its JSON Schema. Its README shows the spread.
|
|
83
|
+
Standard Schema that checks a section and gives its JSON Schema. Its README shows the spread. A
|
|
84
|
+
preset that reads its platform takes it beside the section, as `{ platform, ...section }`: the
|
|
85
|
+
platform, and the arguments of the process where a preset reads them, are the config file's own,
|
|
86
|
+
never a value of the section.
|
|
74
87
|
|
|
75
88
|
| Section | Spread into | Its schema | It overrides |
|
|
76
89
|
| --------- | -------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
@@ -79,7 +92,7 @@ Standard Schema that checks a section and gives its JSON Schema. Its README show
|
|
|
79
92
|
| `typedoc` | `typedocConfig()` of `@wtf/project-typedoc/config` | `typedocSchema` of `@wtf/project-typedoc` | `repository`, `entryPoints`, `categories`, `plugins`, and any option of TypeDoc |
|
|
80
93
|
| `oxlint` | `oxlintConfig()` of `@wtf/project-oxlint/config` | `oxlintSchema` of `@wtf/project-oxlint` | `categories`, `rules` and `env` key by key; `plugins`, `ignorePatterns`, any other |
|
|
81
94
|
| `oxfmt` | `oxfmtConfig()` of `@wtf/project-oxfmt/config` | `oxfmtSchema` of `@wtf/project-oxfmt` | `printWidth`, `semi`, `singleQuote`, `trailingComma`, `ignorePatterns`, any other |
|
|
82
|
-
| `astro` | `baseConfig()` of `@wtf/project-astro/config` | `astroSchema` of `@wtf/project-astro` | `pages`, `links`, `vite`; `markdown`
|
|
95
|
+
| `astro` | `baseConfig()` of `@wtf/project-astro/config` | `astroSchema` of `@wtf/project-astro` | `pages`, `links`, `vite`; `markdown` in code |
|
|
83
96
|
| `wpt` | `wptSuite()` of `@wtf/project-wpt/suite` | `wptSchema` of `@wtf/project-wpt` | `commit`, `repository`, and each suite's options by its name in `suites` |
|
|
84
97
|
|
|
85
98
|
A tool that keeps options of its own in a preset's section builds its schema on the preset's.
|
|
@@ -105,19 +118,28 @@ asynchronous. A config of code in use is a `SyncConfigInCodeError`, which says t
|
|
|
105
118
|
or load it with `loadConfig`:
|
|
106
119
|
|
|
107
120
|
```ts
|
|
108
|
-
import {
|
|
121
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
122
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
123
|
+
import { loadConfigSync } from '@wtf/project-config/load'
|
|
124
|
+
import { nodeSyncPlatform } from '@wtf/project-config/node'
|
|
109
125
|
import { sectionOfSync } from '@wtf/project-config/section'
|
|
110
126
|
import { typedocSchema } from '@wtf/project-typedoc/schema'
|
|
111
127
|
|
|
112
|
-
const
|
|
128
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
129
|
+
const config = loadConfigSync({ platform: nodeSyncPlatform(platform) })
|
|
113
130
|
const typedoc = sectionOfSync(config, 'typedoc', typedocSchema)
|
|
114
131
|
```
|
|
115
132
|
|
|
133
|
+
`nodeSyncPlatform(platform)` of `@wtf/project-config/node` adds the disk, read synchronously by
|
|
134
|
+
`node:fs`, to the platform's paths, working folder and environment.
|
|
135
|
+
|
|
116
136
|
## Override it from the environment
|
|
117
137
|
|
|
118
138
|
A variable `WTF_<SECTION>_<KEY>` sets a value of a section as it is read: `WTF_VITE_COMPRESS=false`
|
|
119
|
-
sets `wtf.vite.compress`. Its text is read as JSON, or else as the text
|
|
120
|
-
|
|
139
|
+
sets `wtf.vite.compress`. Its text is read as JSON, or else as the text. Where the schema takes a
|
|
140
|
+
string, the text stays text unless its JSON is a value of another type the schema takes: of a
|
|
141
|
+
value that is a name, a number or a list, `WTF_SITE_KEEP=2` is the number 2,
|
|
142
|
+
`WTF_SITE_KEEP='[2,"newest"]'` the list, and `WTF_SITE_KEEP=newest` the name. A camelCase key is its words in capitals, so `testTimeout` is
|
|
121
143
|
`WTF_VITEST_TEST_TIMEOUT`. A variable sets a key the section has, or its schema names, and no
|
|
122
144
|
other.
|
|
123
145
|
|
|
@@ -200,6 +222,8 @@ import { nodeLoadModule } from '@wtf/project-config/node'
|
|
|
200
222
|
|
|
201
223
|
type Format = { readonly width: number; readonly ellipsis: string }
|
|
202
224
|
declare const section: { formatters?: NamedSet<Format>[]; format: NamedReference }
|
|
225
|
+
// The root of the project, as `root` of the config `loadConfig` gives.
|
|
226
|
+
declare const root: string
|
|
203
227
|
|
|
204
228
|
const builtin = {
|
|
205
229
|
short: factoryOf<Format>({ width: 40, ellipsis: '…' }),
|
|
@@ -209,7 +233,7 @@ const builtin = {
|
|
|
209
233
|
})
|
|
210
234
|
}
|
|
211
235
|
const formatters = await resolveNamedSet<Format>([builtin, ...(section.formatters ?? [])], {
|
|
212
|
-
load: nodeLoadModule(
|
|
236
|
+
load: nodeLoadModule(root, import.meta.url)
|
|
213
237
|
})
|
|
214
238
|
const format = await resolveNamed<Format>(section.format, {
|
|
215
239
|
key: 'format',
|
|
@@ -225,7 +249,9 @@ else it loads one installed beside `beside`, the tool's own `import.meta.url`, a
|
|
|
225
249
|
install of the tool. The loader is a parameter, so the rest runs on any platform.
|
|
226
250
|
|
|
227
251
|
Pass `check`, a schema of the value, to check each value of a set and each value a reference
|
|
228
|
-
resolves to.
|
|
252
|
+
resolves to. A function entry is used as it is; pass `checkResults: true` as well, and `check`
|
|
253
|
+
checks what it gives each time it is called, while a plain value is checked once. Each failure is a
|
|
254
|
+
`NamedError` of `./errors`, with a stable `code`:
|
|
229
255
|
|
|
230
256
|
| Code | What failed |
|
|
231
257
|
| --------------------- | ----------------------------------------------------------------------------- |
|
|
@@ -234,6 +260,14 @@ resolves to. Each failure is a `NamedError` of `./errors`, with a stable `code`:
|
|
|
234
260
|
| `MISSING_EXPORT` | An export that the module does not have. |
|
|
235
261
|
| `INVALID_NAMED_VALUE` | A reference or a set of no form it takes, or a value that `check` refuses. |
|
|
236
262
|
|
|
263
|
+
The error says where it failed, so your tool can keep its own messages without loading each
|
|
264
|
+
module itself. Pass `at`, where the sets or the reference are in the configuration, as
|
|
265
|
+
`['formatters']`. The error's `at` is that path, then the index of the set in an array of sets,
|
|
266
|
+
then the name of the entry: `['formatters', '1', 'wide']`. `set` is that index, `entry` the name of
|
|
267
|
+
the entry, and `module` and `export` say which export a value came from. The message starts with
|
|
268
|
+
the path of the set, and names the entry, the module and the export:
|
|
269
|
+
`formatters[1]: The module ./formatters.mjs has no export wide as the formatter wide.`
|
|
270
|
+
|
|
237
271
|
`namedSchema('format', { names, options })` gives the schema of a reference: the names an editor
|
|
238
272
|
completes, and the schema of the options beside a name. `namedSetSchema({ entry })` gives the
|
|
239
273
|
schema of the sets. Each is a Standard Schema that checks a value and gives its JSON Schema, so put
|
|
@@ -243,5 +277,8 @@ it in the schema of your tool's section, or pass it to `sectionOf`.
|
|
|
243
277
|
|
|
244
278
|
Each function takes `namespace`, `files`, `key` and `env`, so a tool of its own can keep its
|
|
245
279
|
config under another name. `./load`, `./locate` and `./write` read through a platform you pass, a
|
|
246
|
-
`Platform` of `@wtf/platform`, whose storage is the root of a WHATWG File System
|
|
247
|
-
take one whose files are read synchronously
|
|
280
|
+
`Platform` of `@wtf/platform`, whose storage is the root of a WHATWG File System, and the load
|
|
281
|
+
takes its environment, `env`, too; the sync loads take one whose files are read synchronously,
|
|
282
|
+
which `nodeSyncPlatform(platform)` of `./node` makes of Node's disk. No function reads the process,
|
|
283
|
+
nor defaults to Node's: the entry point builds the platform, as `nodePlatform()` of
|
|
284
|
+
`@wtf/platform-node/platform` makes Node's, and a test passes one in memory.
|
|
@@ -56,7 +56,10 @@ You run `test` from the source, with nothing built; run `test:dist` on the build
|
|
|
56
56
|
[testing guide](testing.md) says why, and gives the pair for browser and integration tests.
|
|
57
57
|
|
|
58
58
|
Each package's tsconfig.json extends the strict config, and its tsconfig.test.json adds the test
|
|
59
|
-
config on top. Each package's vitest.config.ts is `packageConfig()`; the root's is
|
|
59
|
+
config on top. Each package's vitest.config.ts is `packageConfig({ platform })`; the root's is
|
|
60
|
+
`rootConfig({ platform, argv })`. A config file is the entry point: it builds Node's platform, of
|
|
61
|
+
`@wtf/platform-node` and `@wtf/platform-fs-node`, dev dependencies of the root, and gives it, and
|
|
62
|
+
the root's the arguments of the process; no preset reads the process itself:
|
|
60
63
|
|
|
61
64
|
```json
|
|
62
65
|
{
|
|
@@ -68,9 +71,12 @@ config on top. Each package's vitest.config.ts is `packageConfig()`; the root's
|
|
|
68
71
|
|
|
69
72
|
```ts
|
|
70
73
|
// vitest.config.ts, at the root
|
|
74
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
75
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
71
76
|
import { rootConfig } from '@wtf/project-vitest/config'
|
|
72
77
|
|
|
73
|
-
|
|
78
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
79
|
+
export default rootConfig({ platform, argv: process.argv })
|
|
74
80
|
```
|
|
75
81
|
|
|
76
82
|
```ts
|
package/guides/presets.md
CHANGED
|
@@ -81,12 +81,17 @@ which the config file loads and spreads in: see [Configuration](config.md).
|
|
|
81
81
|
`typedocConfig()` of `@wtf/project-typedoc/config` is the config for a docs package,
|
|
82
82
|
`packages/docs`. It writes the reference of the workspace's packages as markdown in `api/`, with an
|
|
83
83
|
`llms.txt` built from the package's `llms-template.md`. Each source links to its file in your
|
|
84
|
-
repository, and any warning fails the build.
|
|
84
|
+
repository, and any warning fails the build. The config file is the entry point: it builds the
|
|
85
|
+
platform, Node's here, whose `spawn` runs git, and gives it, with the arguments of the process.
|
|
85
86
|
|
|
86
87
|
```ts
|
|
88
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
89
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
87
90
|
import { typedocConfig } from '@wtf/project-typedoc/config'
|
|
88
91
|
|
|
89
92
|
export default typedocConfig({
|
|
93
|
+
platform: nodePlatform({ fetch, storage: nodeStorage() }),
|
|
94
|
+
argv: process.argv,
|
|
90
95
|
docs: import.meta.url,
|
|
91
96
|
repository: 'https://gitlab.com/wetryfun/project/project',
|
|
92
97
|
entryPoints: ['../core', '../cli']
|
|
@@ -95,7 +100,7 @@ export default typedocConfig({
|
|
|
95
100
|
|
|
96
101
|
The revision each source links to is the first of these that applies:
|
|
97
102
|
|
|
98
|
-
1. `--gitRevision <ref>`, passed to `typedoc
|
|
103
|
+
1. `--gitRevision <ref>`, passed to `typedoc`, of the `argv` you give;
|
|
99
104
|
2. the commit of HEAD;
|
|
100
105
|
3. in a repo with no commit yet, its branch; outside git, `main`.
|
|
101
106
|
|
|
@@ -105,6 +110,8 @@ TypeDoc's application or a module by its name: they run after the preset's, and
|
|
|
105
110
|
typedoc-plugin-llms-txt and typedoc-plugin-markdown. TypeDoc and its two plugins are peers.
|
|
106
111
|
|
|
107
112
|
```ts
|
|
113
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
114
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
108
115
|
import { typedocConfig } from '@wtf/project-typedoc/config'
|
|
109
116
|
import type { TypedocPlugin } from '@wtf/project-typedoc/plugins'
|
|
110
117
|
|
|
@@ -114,6 +121,8 @@ const notice: TypedocPlugin = (app) => {
|
|
|
114
121
|
}
|
|
115
122
|
|
|
116
123
|
export default typedocConfig({
|
|
124
|
+
platform: nodePlatform({ fetch, storage: nodeStorage() }),
|
|
125
|
+
argv: process.argv,
|
|
117
126
|
docs: import.meta.url,
|
|
118
127
|
repository: 'https://gitlab.com/wetryfun/project/project',
|
|
119
128
|
entryPoints: ['../core'],
|
package/guides/vite.md
CHANGED
|
@@ -4,20 +4,22 @@ This guide shows you how to start every Vite config in a workspace from one base
|
|
|
4
4
|
a test and a build all resolve the workspace the same way, and how a site's build ships compressed
|
|
5
5
|
copies that a static host can serve.
|
|
6
6
|
|
|
7
|
-
`@wtf/project-vite/config` holds the base Vite config of a workspace, `baseConfig()`.
|
|
8
|
-
config starts from it: an app's vite.config, a Storybook's `viteFinal`, and each Vitest
|
|
9
|
-
(the configs of `@wtf/project-vitest` start from it themselves).
|
|
7
|
+
`@wtf/project-vite/config` holds the base Vite config of a workspace, `baseConfig({ platform })`.
|
|
8
|
+
Every Vite config starts from it: an app's vite.config, a Storybook's `viteFinal`, and each Vitest
|
|
9
|
+
config (the configs of `@wtf/project-vitest` start from it themselves). It reads the environment
|
|
10
|
+
of the platform it is given, and nothing of the process: the config file, its entry point, builds
|
|
11
|
+
the platform, as `nodePlatform()` of `@wtf/platform-node/platform` makes Node's.
|
|
10
12
|
|
|
11
13
|
| Export of `./config` | What it is |
|
|
12
14
|
| -------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| `baseConfig` | The base config, made of the two layers below: `mergeConfig(baseConfig(), yours)`
|
|
15
|
+
| `baseConfig` | The base config, made of the two layers below: `mergeConfig(baseConfig({ platform }), yours)` |
|
|
14
16
|
| `compress` | The plugin that writes brotli and gzip copies in a site's build; `baseConfig` adds it unless `compress: false` |
|
|
15
17
|
| `conditionsOf` | The resolve conditions of a run: `@wtf/source` first, when reading from source |
|
|
16
18
|
| `buildsSite` | Whether a run is a site's build: `vite build`, with no library (`build.lib`) and no server (`build.ssr`) |
|
|
17
19
|
| `CLIENT_CONDITIONS` | Vite's own conditions for browser modules, which come after `@wtf/source` |
|
|
18
20
|
| `COMPRESSIBLE` | The extensions of the files a site's build compresses: text, and WebAssembly |
|
|
19
21
|
| `THRESHOLD` | The smallest file that gets compressed, 1024 bytes |
|
|
20
|
-
| `
|
|
22
|
+
| `fromDist` | Whether the run reads the packages from their build, of an environment: `fromDist(env)`, `TEST_FROM=dist` |
|
|
21
23
|
|
|
22
24
|
## What the base sets
|
|
23
25
|
|
|
@@ -26,7 +28,8 @@ Every command shares this, whether a dev server, a test or a build:
|
|
|
26
28
|
- `resolve.conditions`: `@wtf/source`, then Vite's own (`module`, `browser`,
|
|
27
29
|
`development|production`). A workspace package resolves to its TypeScript through the
|
|
28
30
|
`@wtf/source` condition of its export map (`SOURCE_CONDITION` of
|
|
29
|
-
`@wtf/project-resolve/condition`), with nothing built first. With `TEST_FROM=dist
|
|
31
|
+
`@wtf/project-resolve/condition`), with nothing built first. With `TEST_FROM=dist` in the
|
|
32
|
+
platform's `env`, as
|
|
30
33
|
`test:dist` and `test:browser:dist` run, there is no `@wtf/source`, and a package resolves the
|
|
31
34
|
way a consumer resolves it: to its build.
|
|
32
35
|
|
|
@@ -46,8 +49,8 @@ A static host such as GitLab Pages compresses nothing as it serves. It serves a
|
|
|
46
49
|
`.gz` in its place, to a browser that accepts it, only when that copy is there. Without them, a
|
|
47
50
|
Storybook or an app with megabytes of script crosses the network uncompressed.
|
|
48
51
|
|
|
49
|
-
Tune it with `baseConfig({ compress: { threshold, extensions, encodings } })`, or turn
|
|
50
|
-
`baseConfig({ compress: false })`, for a site no static host serves.
|
|
52
|
+
Tune it with `baseConfig({ platform, compress: { threshold, extensions, encodings } })`, or turn
|
|
53
|
+
it off with `baseConfig({ platform, compress: false })`, for a site no static host serves.
|
|
51
54
|
|
|
52
55
|
### Compress what Vite did not write
|
|
53
56
|
|
|
@@ -62,6 +65,8 @@ An app's vite.config starts from the base and adds its own settings:
|
|
|
62
65
|
|
|
63
66
|
```ts
|
|
64
67
|
// vite.config.ts
|
|
68
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
69
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
65
70
|
import { defineConfig, mergeConfig, type PluginOption } from 'vite'
|
|
66
71
|
|
|
67
72
|
import { baseConfig } from '@wtf/project-vite/config'
|
|
@@ -69,7 +74,8 @@ import { baseConfig } from '@wtf/project-vite/config'
|
|
|
69
74
|
// The app's own plugins, as `react()` of @vitejs/plugin-react.
|
|
70
75
|
declare const react: () => PluginOption
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
78
|
+
export default defineConfig(mergeConfig(baseConfig({ platform }), { plugins: [react()] }))
|
|
73
79
|
```
|
|
74
80
|
|
|
75
81
|
`mergeConfig` appends lists, so the app's plugins come after the base's, and any conditions it
|
|
@@ -82,6 +88,8 @@ own settings:
|
|
|
82
88
|
|
|
83
89
|
```ts
|
|
84
90
|
// .storybook/main.ts
|
|
91
|
+
import { nodeStorage } from '@wtf/platform-fs-node/storage'
|
|
92
|
+
import { nodePlatform } from '@wtf/platform-node/platform'
|
|
85
93
|
import { mergeConfig, type InlineConfig } from 'vite'
|
|
86
94
|
|
|
87
95
|
import { baseConfig } from '@wtf/project-vite/config'
|
|
@@ -92,9 +100,11 @@ type StorybookConfig = {
|
|
|
92
100
|
viteFinal: (vite: InlineConfig) => InlineConfig
|
|
93
101
|
}
|
|
94
102
|
|
|
103
|
+
const platform = nodePlatform({ fetch, storage: nodeStorage() })
|
|
104
|
+
|
|
95
105
|
const config: StorybookConfig = {
|
|
96
106
|
stories: ['../stories/**/*.stories.tsx'],
|
|
97
|
-
viteFinal: (vite) => mergeConfig(mergeConfig(vite, baseConfig()), { plugins: [] })
|
|
107
|
+
viteFinal: (vite) => mergeConfig(mergeConfig(vite, baseConfig({ platform })), { plugins: [] })
|
|
98
108
|
}
|
|
99
109
|
|
|
100
110
|
export default config
|