@wtf/project-docs 1.0.1 → 1.1.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/README.md +2 -0
- package/api/.generated +49 -0
- package/api/@wtf/project-astro/README.md +68 -0
- package/api/@wtf/project-astro/config/README.md +38 -0
- package/api/@wtf/project-astro/config/functions/baseConfig.md +43 -0
- package/api/@wtf/project-astro/config/functions/baseOf.md +23 -0
- package/api/@wtf/project-astro/config/functions/siteOf.md +22 -0
- package/api/@wtf/project-astro/config/type-aliases/BaseOptions.md +73 -0
- package/api/@wtf/project-astro/config/type-aliases/Env.md +11 -0
- package/api/@wtf/project-astro/errors/README.md +16 -0
- package/api/@wtf/project-astro/errors/classes/BrokenLinksError.md +172 -0
- package/api/@wtf/project-astro/errors/classes/InvalidRedirectError.md +174 -0
- package/api/@wtf/project-astro/errors/classes/RedirectedLinksError.md +173 -0
- package/api/@wtf/project-astro/errors/classes/SiteError.md +192 -0
- package/api/@wtf/project-astro/index/README.md +19 -0
- package/api/@wtf/project-astro/index/type-aliases/BrokenLink.md +35 -0
- package/api/@wtf/project-astro/index/type-aliases/IgnoredLine.md +47 -0
- package/api/@wtf/project-astro/index/type-aliases/RedirectInput.md +17 -0
- package/api/@wtf/project-astro/index/type-aliases/RedirectMatch.md +35 -0
- package/api/@wtf/project-astro/index/type-aliases/RedirectRule.md +61 -0
- package/api/@wtf/project-astro/index/type-aliases/RedirectStatus.md +12 -0
- package/api/@wtf/project-astro/index/type-aliases/RedirectedLink.md +17 -0
- package/api/@wtf/project-astro/index/type-aliases/Redirects.md +35 -0
- package/api/@wtf/project-astro/links/README.md +27 -0
- package/api/@wtf/project-astro/links/functions/brokenLinksIn.md +27 -0
- package/api/@wtf/project-astro/links/functions/links.md +29 -0
- package/api/@wtf/project-astro/links/functions/redirectedLinksIn.md +27 -0
- package/api/@wtf/project-astro/links/variables/LINKS.md +11 -0
- package/api/@wtf/project-astro/pages/README.md +36 -0
- package/api/@wtf/project-astro/pages/functions/fixSearchUrlsIn.md +27 -0
- package/api/@wtf/project-astro/pages/functions/moveConflictingPages.md +23 -0
- package/api/@wtf/project-astro/pages/functions/pages.md +31 -0
- package/api/@wtf/project-astro/pages/functions/slashFolderLinksIn.md +35 -0
- package/api/@wtf/project-astro/pages/variables/PAGES.md +11 -0
- package/api/@wtf/project-astro/preview/README.md +34 -0
- package/api/@wtf/project-astro/preview/functions/files.md +39 -0
- package/api/@wtf/project-astro/preview/functions/listen.md +25 -0
- package/api/@wtf/project-astro/preview/functions/notFound.md +24 -0
- package/api/@wtf/project-astro/preview/functions/pagesOf.md +27 -0
- package/api/@wtf/project-astro/preview/type-aliases/FilesOptions.md +24 -0
- package/api/@wtf/project-astro/preview/type-aliases/Handler.md +21 -0
- package/api/@wtf/project-astro/preview/type-aliases/ListenOptions.md +35 -0
- package/api/@wtf/project-astro/preview/type-aliases/Listening.md +53 -0
- package/api/@wtf/project-astro/preview/type-aliases/Pages.md +35 -0
- package/api/@wtf/project-astro/redirects/README.md +28 -0
- package/api/@wtf/project-astro/redirects/functions/formatRedirects.md +28 -0
- package/api/@wtf/project-astro/redirects/functions/matchRedirect.md +35 -0
- package/api/@wtf/project-astro/redirects/functions/parseRedirects.md +32 -0
- package/api/@wtf/project-astro/redirects/variables/MAX_PARTS.md +11 -0
- package/api/@wtf/project-astro/redirects/variables/MAX_RULES.md +11 -0
- package/api/@wtf/project-astro/redirects/variables/MAX_SIZE.md +11 -0
- package/api/@wtf/project-oxfmt/variables/default.md +6 -6
- package/api/@wtf/project-oxlint/variables/default.md +17 -17
- 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/config/functions/gitRevisionOf.md +1 -1
- package/api/@wtf/project-typedoc/config/functions/typedocConfig.md +1 -1
- package/api/@wtf/project-typedoc/config/type-aliases/RevisionSources.md +3 -3
- package/api/@wtf/project-typedoc/config/type-aliases/TypedocConfig.md +1 -1
- package/api/@wtf/project-typedoc/config/type-aliases/TypedocOptions.md +6 -6
- package/api/@wtf/project-typedoc/config/variables/nodeRun.md +1 -1
- package/api/@wtf/project-typedoc/plugins/functions/cleanGeneratedMarkdown.md +1 -1
- package/api/@wtf/project-typedoc/plugins/functions/linkTrackedSources.md +1 -1
- package/api/@wtf/project-typedoc/plugins/functions/preventMediaFiles.md +1 -1
- package/api/@wtf/project-typedoc/plugins/type-aliases/CleanGeneratedMarkdownOptions.md +3 -3
- package/api/@wtf/project-typedoc/plugins/type-aliases/LinkTrackedSourcesOptions.md +3 -3
- package/api/@wtf/project-typedoc/plugins/type-aliases/PreventMediaFilesOptions.md +3 -3
- package/api/@wtf/project-typedoc/plugins/type-aliases/Run.md +1 -1
- package/api/@wtf/project-typedoc/plugins/type-aliases/TypedocPlugin.md +1 -1
- package/api/@wtf/project-vite/functions/baseConfig.md +4 -4
- package/api/@wtf/project-vite/functions/buildsSite.md +1 -1
- package/api/@wtf/project-vite/functions/compress.md +1 -1
- package/api/@wtf/project-vite/functions/conditionsOf.md +1 -1
- package/api/@wtf/project-vite/type-aliases/BaseOptions.md +2 -2
- package/api/@wtf/project-vite/type-aliases/CompressOptions.md +4 -4
- package/api/@wtf/project-vite/variables/CLIENT_CONDITIONS.md +1 -1
- package/api/@wtf/project-vite/variables/COMPRESSIBLE.md +1 -1
- package/api/@wtf/project-vite/variables/FROM_DIST.md +1 -1
- package/api/@wtf/project-vite/variables/THRESHOLD.md +1 -1
- package/api/@wtf/project-vitest/browser/functions/browserConfig.md +1 -1
- package/api/@wtf/project-vitest/browser/functions/browserRootConfig.md +1 -1
- package/api/@wtf/project-vitest/browser/type-aliases/BrowserOptions.md +3 -3
- package/api/@wtf/project-vitest/config/functions/integrationConfig.md +1 -1
- package/api/@wtf/project-vitest/config/functions/packageConfig.md +1 -1
- package/api/@wtf/project-vitest/config/functions/rootConfig.md +1 -1
- package/api/@wtf/project-vitest/config/type-aliases/RootConfigOptions.md +2 -2
- package/api/@wtf/project-vitest/config/type-aliases/RootOptions.md +7 -7
- package/api/@wtf/project-vitest/config/variables/FROM_DIST.md +1 -1
- package/api/@wtf/project-vitest/config/variables/GUARD_TIMEOUT.md +1 -1
- package/api/@wtf/project-vitest/config/variables/integration.md +9 -9
- package/api/@wtf/project-vitest/process/functions/childEnv.md +1 -1
- package/api/@wtf/project-vitest/process/type-aliases/Env.md +1 -1
- package/api/@wtf/project-vitest/storybook/functions/storybookConfig.md +1 -1
- package/api/@wtf/project-vitest/storybook/type-aliases/StorybookOptions.md +2 -2
- 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/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/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 +8 -8
- 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 +1 -1
- 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/type-aliases/ClearTimeout.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/CreateRealm.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/Env.md +1 -1
- package/api/@wtf/project-wpt/index/type-aliases/Exec.md +1 -1
- 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/Performance.md +3 -3
- package/api/@wtf/project-wpt/index/type-aliases/Realm.md +3 -3
- package/api/@wtf/project-wpt/index/type-aliases/SetTimeout.md +1 -1
- 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 +6 -6
- package/api/@wtf/project-wpt/index/type-aliases/WptSystem.md +6 -6
- 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/functions/nodePlatform.md +1 -1
- package/api/@wtf/project-wpt/node/functions/nodeSystem.md +1 -1
- package/api/@wtf/project-wpt/node/variables/nodeExec.md +1 -1
- 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 +8 -8
- package/api/@wtf/project-wpt/run/type-aliases/RunPlatform.md +1 -1
- 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/suite/functions/wptSuite.md +1 -1
- package/api/@wtf/project-wpt/suite/type-aliases/WptSuiteOptions.md +8 -8
- package/api/README.md +1 -0
- package/api/trains.json +3 -0
- package/guides/astro.md +173 -0
- package/package.json +3 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [preview](../README.md) / ListenOptions
|
|
2
|
+
|
|
3
|
+
# Type Alias: ListenOptions
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type ListenOptions = object;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/preview.ts:57](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L57)
|
|
10
|
+
|
|
11
|
+
Where [listen](../functions/listen.md) serves.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### host?
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
readonly optional host?: string;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defined in: [packages/project-astro/src/preview.ts:59](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L59)
|
|
22
|
+
|
|
23
|
+
The host it listens on: `localhost` by default.
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### port?
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
readonly optional port?: number;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Defined in: [packages/project-astro/src/preview.ts:61](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L61)
|
|
34
|
+
|
|
35
|
+
The port it listens on: `4321` by default, as `astro preview`'s; `0`, a free one.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [preview](../README.md) / Listening
|
|
2
|
+
|
|
3
|
+
# Type Alias: Listening
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type Listening = object;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/preview.ts:65](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L65)
|
|
10
|
+
|
|
11
|
+
A handler served on Node's HTTP server, by [listen](../functions/listen.md).
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### url
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
readonly url: URL;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defined in: [packages/project-astro/src/preview.ts:67](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L67)
|
|
22
|
+
|
|
23
|
+
The URL it is served at, such as `http://localhost:4321/`.
|
|
24
|
+
|
|
25
|
+
## Methods
|
|
26
|
+
|
|
27
|
+
### \[asyncDispose\]()
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
asyncDispose: Promise<void>;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Defined in: [packages/project-astro/src/preview.ts:70](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L70)
|
|
34
|
+
|
|
35
|
+
#### Returns
|
|
36
|
+
|
|
37
|
+
`Promise`\<`void`\>
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### close()
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
close(): Promise<void>;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Defined in: [packages/project-astro/src/preview.ts:69](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L69)
|
|
48
|
+
|
|
49
|
+
Stops serving: it closes every connection, and resolves once the server is closed.
|
|
50
|
+
|
|
51
|
+
#### Returns
|
|
52
|
+
|
|
53
|
+
`Promise`\<`void`\>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [preview](../README.md) / Pages
|
|
2
|
+
|
|
3
|
+
# Type Alias: Pages
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type Pages = object;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/preview.ts:49](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L49)
|
|
10
|
+
|
|
11
|
+
A built site, ready to serve: its handler, and the lines of its `_redirects` it ignores.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### handler
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
readonly handler: Handler;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Defined in: [packages/project-astro/src/preview.ts:51](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L51)
|
|
22
|
+
|
|
23
|
+
What answers each request, as GitLab Pages would.
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### ignored
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
readonly ignored: readonly IgnoredLine[];
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Defined in: [packages/project-astro/src/preview.ts:53](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/preview.ts#L53)
|
|
34
|
+
|
|
35
|
+
Each line of the site's `_redirects` that GitLab Pages ignores too, and why.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@wtf/project-astro](../README.md) / redirects
|
|
2
|
+
|
|
3
|
+
# redirects
|
|
4
|
+
|
|
5
|
+
The `_redirects` file of a site, the format GitLab Pages and Netlify share:
|
|
6
|
+
[parseRedirects](functions/parseRedirects.md) reads it, [formatRedirects](functions/formatRedirects.md) writes it, and [matchRedirect](functions/matchRedirect.md)
|
|
7
|
+
finds the rule that answers a path. It supports what GitLab Pages supports: redirects (`301`,
|
|
8
|
+
`302`), rewrites (`200`), placeholders (`:name`) and a splat (`*`). It ignores, line by line,
|
|
9
|
+
what GitLab Pages ignores: other statuses, the force flag (`301!`), conditions, query parameters,
|
|
10
|
+
rules for another domain, and the lines past its limits.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
const { rules } = parseRedirects('/old /new 301\n/blog/* /posts/:splat 302\n')
|
|
14
|
+
const match = matchRedirect(rules, '/blog/2026/hello') // { location: '/posts/2026/hello', … }
|
|
15
|
+
const text = formatRedirects([{ from: '/', to: '/en/', status: 302 }]) // '/ /en/ 302\n'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Variables
|
|
19
|
+
|
|
20
|
+
- [MAX\_PARTS](variables/MAX_PARTS.md)
|
|
21
|
+
- [MAX\_RULES](variables/MAX_RULES.md)
|
|
22
|
+
- [MAX\_SIZE](variables/MAX_SIZE.md)
|
|
23
|
+
|
|
24
|
+
## Functions
|
|
25
|
+
|
|
26
|
+
- [formatRedirects](functions/formatRedirects.md)
|
|
27
|
+
- [matchRedirect](functions/matchRedirect.md)
|
|
28
|
+
- [parseRedirects](functions/parseRedirects.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [redirects](../README.md) / formatRedirects
|
|
2
|
+
|
|
3
|
+
# Function: formatRedirects()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function formatRedirects(rules): string;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/redirects.ts:130](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/redirects.ts#L130)
|
|
10
|
+
|
|
11
|
+
The text of a `_redirects` file of `rules`, one line of each, in order: its path, its target and
|
|
12
|
+
its status, `301` by default. Throws an [InvalidRedirectError](../../errors/classes/InvalidRedirectError.md) of the first rule GitLab
|
|
13
|
+
Pages would ignore, with why, as of a status it does not support or a path with a space in it,
|
|
14
|
+
and of more rules than it reads, [MAX\_RULES](../variables/MAX_RULES.md), or a file larger than [MAX\_SIZE](../variables/MAX_SIZE.md) bytes.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
formatRedirects([{ from: '/', to: '/en/', status: 302 }]) // '/ /en/ 302\n'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type |
|
|
23
|
+
| ------ | ------ |
|
|
24
|
+
| `rules` | readonly [`RedirectInput`](../../index/type-aliases/RedirectInput.md)[] |
|
|
25
|
+
|
|
26
|
+
## Returns
|
|
27
|
+
|
|
28
|
+
`string`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [redirects](../README.md) / matchRedirect
|
|
2
|
+
|
|
3
|
+
# Function: matchRedirect()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function matchRedirect(rules, path):
|
|
7
|
+
| RedirectMatch
|
|
8
|
+
| undefined;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/project-astro/src/redirects.ts:202](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/redirects.ts#L202)
|
|
12
|
+
|
|
13
|
+
The first of `rules` whose path matches `path`, the path of a URL as it is written, encoded,
|
|
14
|
+
such as `/blog/2026/hello`, and where it sends it: its `to`, each placeholder and `:splat` put
|
|
15
|
+
in. None, of a path no rule matches. A part of a rule matches a part of the path when the two
|
|
16
|
+
decode to the same text, and a slash at the end of either does not matter. GitLab Pages applies
|
|
17
|
+
the rules only where there is no file at the path: a redirect, `301` or `302`, answers with the
|
|
18
|
+
location, and a rewrite, `200`, serves what is there under the path that was asked for.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const { rules } = parseRedirects('/docs/* /guides/:splat 302\n')
|
|
22
|
+
matchRedirect(rules, '/docs/a/b')?.location // '/guides/a/b'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type |
|
|
28
|
+
| ------ | ------ |
|
|
29
|
+
| `rules` | readonly [`RedirectRule`](../../index/type-aliases/RedirectRule.md)[] |
|
|
30
|
+
| `path` | `string` |
|
|
31
|
+
|
|
32
|
+
## Returns
|
|
33
|
+
|
|
34
|
+
\| [`RedirectMatch`](../../index/type-aliases/RedirectMatch.md)
|
|
35
|
+
\| `undefined`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [redirects](../README.md) / parseRedirects
|
|
2
|
+
|
|
3
|
+
# Function: parseRedirects()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function parseRedirects(text): Redirects;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/redirects.ts:87](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/redirects.ts#L87)
|
|
10
|
+
|
|
11
|
+
The rules of the text of a `_redirects` file, in order, and each line it ignores, with why. A
|
|
12
|
+
line is a path to match, a target and a status, `301` by default, apart by spaces; an empty line
|
|
13
|
+
and one that starts with `#` are no rule. A line that is no rule GitLab Pages supports is
|
|
14
|
+
ignored, as are the rules past the first [MAX\_RULES](../variables/MAX_RULES.md), and a file larger than
|
|
15
|
+
[MAX\_SIZE](../variables/MAX_SIZE.md) bytes has no rules at all.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
declare const text: string
|
|
19
|
+
|
|
20
|
+
const { rules, ignored } = parseRedirects(text)
|
|
21
|
+
for (const { line, reason } of ignored) console.warn(`_redirects:${line}: ${reason}`)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
|
|
26
|
+
| Parameter | Type |
|
|
27
|
+
| ------ | ------ |
|
|
28
|
+
| `text` | `string` |
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
[`Redirects`](../../index/type-aliases/Redirects.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [redirects](../README.md) / MAX\_PARTS
|
|
2
|
+
|
|
3
|
+
# Variable: MAX\_PARTS
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const MAX_PARTS: 25 = 25;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/redirects.ts:34](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/redirects.ts#L34)
|
|
10
|
+
|
|
11
|
+
The most parts a path of a rule may have.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [redirects](../README.md) / MAX\_RULES
|
|
2
|
+
|
|
3
|
+
# Variable: MAX\_RULES
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const MAX_RULES: 1000 = 1000;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/redirects.ts:28](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/redirects.ts#L28)
|
|
10
|
+
|
|
11
|
+
The most rules GitLab Pages reads of a file: the lines past them are ignored.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[Documentation](../../../../README.md) / [@wtf/project-astro](../../README.md) / [redirects](../README.md) / MAX\_SIZE
|
|
2
|
+
|
|
3
|
+
# Variable: MAX\_SIZE
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const MAX_SIZE: 65536 = 65_536;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/project-astro/src/redirects.ts:31](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-astro/src/redirects.ts#L31)
|
|
10
|
+
|
|
11
|
+
The largest file GitLab Pages reads, in bytes: a larger one has no rules.
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
default: object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-oxfmt/src/config.ts:10](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-oxfmt/src/config.ts:10](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxfmt/src/config.ts#L10)
|
|
10
10
|
|
|
11
11
|
## Type Declaration
|
|
12
12
|
|
|
13
13
|
| Name | Type | Default value | Defined in |
|
|
14
14
|
| ------ | ------ | ------ | ------ |
|
|
15
|
-
| <a id="property-ignorepatterns"></a> `ignorePatterns` | `string`[] | - | [packages/project-oxfmt/src/config.ts:11](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
16
|
-
| <a id="property-printwidth"></a> `printWidth` | `number` | `100` | [packages/project-oxfmt/src/config.ts:12](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
17
|
-
| <a id="property-semi"></a> `semi` | `false` | `false` | [packages/project-oxfmt/src/config.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
18
|
-
| <a id="property-singlequote"></a> `singleQuote` | `true` | `true` | [packages/project-oxfmt/src/config.ts:15](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
19
|
-
| <a id="property-trailingcomma"></a> `trailingComma` | `"none"` | `'none'` | [packages/project-oxfmt/src/config.ts:13](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
15
|
+
| <a id="property-ignorepatterns"></a> `ignorePatterns` | `string`[] | - | [packages/project-oxfmt/src/config.ts:11](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxfmt/src/config.ts#L11) |
|
|
16
|
+
| <a id="property-printwidth"></a> `printWidth` | `number` | `100` | [packages/project-oxfmt/src/config.ts:12](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxfmt/src/config.ts#L12) |
|
|
17
|
+
| <a id="property-semi"></a> `semi` | `false` | `false` | [packages/project-oxfmt/src/config.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxfmt/src/config.ts#L14) |
|
|
18
|
+
| <a id="property-singlequote"></a> `singleQuote` | `true` | `true` | [packages/project-oxfmt/src/config.ts:15](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxfmt/src/config.ts#L15) |
|
|
19
|
+
| <a id="property-trailingcomma"></a> `trailingComma` | `"none"` | `'none'` | [packages/project-oxfmt/src/config.ts:13](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxfmt/src/config.ts#L13) |
|
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
default: object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-oxlint/src/config.ts:10](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-oxlint/src/config.ts:10](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L10)
|
|
10
10
|
|
|
11
11
|
## Type Declaration
|
|
12
12
|
|
|
13
13
|
| Name | Type | Default value | Defined in |
|
|
14
14
|
| ------ | ------ | ------ | ------ |
|
|
15
|
-
| <a id="property-categories"></a> `categories` | `object` | - | [packages/project-oxlint/src/config.ts:12](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
16
|
-
| `categories.correctness` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:13](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
17
|
-
| `categories.pedantic` | `"off"` | `'off'` | [packages/project-oxlint/src/config.ts:15](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
18
|
-
| `categories.perf` | `"warn"` | `'warn'` | [packages/project-oxlint/src/config.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
19
|
-
| `categories.style` | `"off"` | `'off'` | [packages/project-oxlint/src/config.ts:17](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
20
|
-
| `categories.suspicious` | `"warn"` | `'warn'` | [packages/project-oxlint/src/config.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
21
|
-
| <a id="property-env"></a> `env` | `object` | - | [packages/project-oxlint/src/config.ts:25](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
22
|
-
| `env.es2025` | `true` | `true` | [packages/project-oxlint/src/config.ts:25](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
23
|
-
| `env.node` | `true` | `true` | [packages/project-oxlint/src/config.ts:25](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
24
|
-
| <a id="property-ignorepatterns"></a> `ignorePatterns` | `string`[] | - | [packages/project-oxlint/src/config.ts:26](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
25
|
-
| <a id="property-plugins"></a> `plugins` | (`"unicorn"` \| `"typescript"` \| `"import"`)[] | - | [packages/project-oxlint/src/config.ts:11](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
26
|
-
| <a id="property-rules"></a> `rules` | `object` | - | [packages/project-oxlint/src/config.ts:19](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
27
|
-
| `rules.eqeqeq` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:21](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
28
|
-
| `rules.import/no-cycle` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:20](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
29
|
-
| `rules.typescript/no-explicit-any` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:22](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
30
|
-
| `rules.typescript/no-unused-vars` | \[`"error"`, \{ `argsIgnorePattern`: `"^_"`; `varsIgnorePattern`: `"^_"`; \}\] | - | [packages/project-oxlint/src/config.ts:23](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
15
|
+
| <a id="property-categories"></a> `categories` | `object` | - | [packages/project-oxlint/src/config.ts:12](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L12) |
|
|
16
|
+
| `categories.correctness` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:13](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L13) |
|
|
17
|
+
| `categories.pedantic` | `"off"` | `'off'` | [packages/project-oxlint/src/config.ts:15](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L15) |
|
|
18
|
+
| `categories.perf` | `"warn"` | `'warn'` | [packages/project-oxlint/src/config.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L16) |
|
|
19
|
+
| `categories.style` | `"off"` | `'off'` | [packages/project-oxlint/src/config.ts:17](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L17) |
|
|
20
|
+
| `categories.suspicious` | `"warn"` | `'warn'` | [packages/project-oxlint/src/config.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L14) |
|
|
21
|
+
| <a id="property-env"></a> `env` | `object` | - | [packages/project-oxlint/src/config.ts:25](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L25) |
|
|
22
|
+
| `env.es2025` | `true` | `true` | [packages/project-oxlint/src/config.ts:25](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L25) |
|
|
23
|
+
| `env.node` | `true` | `true` | [packages/project-oxlint/src/config.ts:25](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L25) |
|
|
24
|
+
| <a id="property-ignorepatterns"></a> `ignorePatterns` | `string`[] | - | [packages/project-oxlint/src/config.ts:26](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L26) |
|
|
25
|
+
| <a id="property-plugins"></a> `plugins` | (`"unicorn"` \| `"typescript"` \| `"import"`)[] | - | [packages/project-oxlint/src/config.ts:11](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L11) |
|
|
26
|
+
| <a id="property-rules"></a> `rules` | `object` | - | [packages/project-oxlint/src/config.ts:19](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L19) |
|
|
27
|
+
| `rules.eqeqeq` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:21](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L21) |
|
|
28
|
+
| `rules.import/no-cycle` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:20](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L20) |
|
|
29
|
+
| `rules.typescript/no-explicit-any` | `"error"` | `'error'` | [packages/project-oxlint/src/config.ts:22](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L22) |
|
|
30
|
+
| `rules.typescript/no-unused-vars` | \[`"error"`, \{ `argsIgnorePattern`: `"^_"`; `varsIgnorePattern`: `"^_"`; \}\] | - | [packages/project-oxlint/src/config.ts:23](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-oxlint/src/config.ts#L23) |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const SOURCE_CONDITION: "@wtf/source" = '@wtf/source';
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/condition.ts:21](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/condition.ts:21](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/condition.ts#L21)
|
|
10
10
|
|
|
11
11
|
The export condition of a package's TypeScript source, `@wtf/source`: in an export map, the
|
|
12
12
|
entry before `types` and `default`, as `"@wtf/source": "./src/index.ts"`. A workspace resolves a
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function isHook(specifier): boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/env.ts:34](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/env.ts:34](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/env.ts#L34)
|
|
10
10
|
|
|
11
11
|
Whether `specifier`, as `--import` takes it, is the module of the resolve hook.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function optionsWithoutHook(options): string;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/env.ts:40](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/env.ts:40](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/env.ts#L40)
|
|
10
10
|
|
|
11
11
|
`NODE_OPTIONS` with no resolve hook: each `--import` of it, as `--import=<hook>` or
|
|
12
12
|
`--import <hook>`, taken out, and each other option kept, in order.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function withoutHook(env): Readonly<Record<string, string | undefined>> & object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/env.ts:60](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/env.ts:60](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/env.ts#L60)
|
|
10
10
|
|
|
11
11
|
`env`, an environment as a process has it, with no resolve hook in `NODE_OPTIONS`, and every
|
|
12
12
|
other variable and option as it is. `NODE_OPTIONS` is a string, empty when nothing is left, so it
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
type Env = Readonly<Record<string, string | undefined>>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/env.ts:24](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/env.ts:24](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/env.ts#L24)
|
|
10
10
|
|
|
11
11
|
An environment, as Node's `process.env` is, and as a spawn takes it.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: ResolveError
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/project-resolve/src/errors.ts:13](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
5
|
+
Defined in: [packages/project-resolve/src/errors.ts:13](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L13)
|
|
6
6
|
|
|
7
7
|
What this package throws: an Error with a stable SCREAMING_SNAKE `code`, and the `exitCode` a
|
|
8
8
|
command that fails by it exits with, 1.
|
|
@@ -28,7 +28,7 @@ new ResolveError(
|
|
|
28
28
|
): ResolveError;
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
Defined in: [packages/project-resolve/src/errors.ts:18](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
31
|
+
Defined in: [packages/project-resolve/src/errors.ts:18](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L18)
|
|
32
32
|
|
|
33
33
|
#### Parameters
|
|
34
34
|
|
|
@@ -53,8 +53,8 @@ Error.constructor
|
|
|
53
53
|
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|
|
54
54
|
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
|
|
55
55
|
| <a id="property-cause"></a> `cause?` | `public` | `unknown` | `undefined` | - | `Error.cause` | - |
|
|
56
|
-
| <a id="property-code"></a> `code` | `readonly` | `string` | `undefined` | - | - | [packages/project-resolve/src/errors.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
57
|
-
| <a id="property-exitcode"></a> `exitCode` | `readonly` | `number` | `1` | What a command that fails by it exits with. | - | [packages/project-resolve/src/errors.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
56
|
+
| <a id="property-code"></a> `code` | `readonly` | `string` | `undefined` | - | - | [packages/project-resolve/src/errors.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L14) |
|
|
57
|
+
| <a id="property-exitcode"></a> `exitCode` | `readonly` | `number` | `1` | What a command that fails by it exits with. | - | [packages/project-resolve/src/errors.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L16) |
|
|
58
58
|
| <a id="property-message"></a> `message` | `public` | `string` | `undefined` | - | `Error.message` | - |
|
|
59
59
|
| <a id="property-name"></a> `name` | `public` | `string` | `undefined` | - | `Error.name` | - |
|
|
60
60
|
| <a id="property-stack"></a> `stack?` | `public` | `string` | `undefined` | - | `Error.stack` | - |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: UnreadableWorkspaceError
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/project-resolve/src/errors.ts:56](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
5
|
+
Defined in: [packages/project-resolve/src/errors.ts:56](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L56)
|
|
6
6
|
|
|
7
7
|
The file that defines a workspace, its pnpm-workspace.yaml, which is there and cannot be read: a
|
|
8
8
|
folder of that name, a file the process may not read, or a link that loops. It is no workspace
|
|
@@ -20,7 +20,7 @@ that is not there, which the package manager would read as none: it refuses it,
|
|
|
20
20
|
new UnreadableWorkspaceError(file, error): UnreadableWorkspaceError;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/project-resolve/src/errors.ts:66](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
23
|
+
Defined in: [packages/project-resolve/src/errors.ts:66](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L66)
|
|
24
24
|
|
|
25
25
|
#### Parameters
|
|
26
26
|
|
|
@@ -42,12 +42,12 @@ Defined in: [packages/project-resolve/src/errors.ts:66](https://gitlab.com/wetry
|
|
|
42
42
|
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|
|
43
43
|
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
|
|
44
44
|
| <a id="property-cause"></a> `cause?` | `public` | `unknown` | `undefined` | - | [`ResolveError`](ResolveError.md).[`cause`](ResolveError.md#property-cause) | - |
|
|
45
|
-
| <a id="property-code"></a> `code` | `readonly` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`code`](ResolveError.md#property-code) | [packages/project-resolve/src/errors.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
46
|
-
| <a id="property-exitcode"></a> `exitCode` | `readonly` | `number` | `1` | What a command that fails by it exits with. | [`ResolveError`](ResolveError.md).[`exitCode`](ResolveError.md#property-exitcode) | [packages/project-resolve/src/errors.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
47
|
-
| <a id="property-file"></a> `file` | `readonly` | `string` | `undefined` | The file that cannot be read: a pnpm-workspace.yaml. | - | [packages/project-resolve/src/errors.ts:58](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
45
|
+
| <a id="property-code"></a> `code` | `readonly` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`code`](ResolveError.md#property-code) | [packages/project-resolve/src/errors.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L14) |
|
|
46
|
+
| <a id="property-exitcode"></a> `exitCode` | `readonly` | `number` | `1` | What a command that fails by it exits with. | [`ResolveError`](ResolveError.md).[`exitCode`](ResolveError.md#property-exitcode) | [packages/project-resolve/src/errors.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L16) |
|
|
47
|
+
| <a id="property-file"></a> `file` | `readonly` | `string` | `undefined` | The file that cannot be read: a pnpm-workspace.yaml. | - | [packages/project-resolve/src/errors.ts:58](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L58) |
|
|
48
48
|
| <a id="property-message"></a> `message` | `public` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`message`](ResolveError.md#property-message) | - |
|
|
49
49
|
| <a id="property-name"></a> `name` | `public` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`name`](ResolveError.md#property-name) | - |
|
|
50
|
-
| <a id="property-reason"></a> `reason` | `readonly` | `string` \| `undefined` | `undefined` | What the file system said of it: the code of Node's error, `EISDIR`, `EACCES` or `ELOOP`, or the name of a handle's `DOMException`, as `TypeMismatchError` of a folder; `undefined` of an error of neither. | - | [packages/project-resolve/src/errors.ts:64](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
50
|
+
| <a id="property-reason"></a> `reason` | `readonly` | `string` \| `undefined` | `undefined` | What the file system said of it: the code of Node's error, `EISDIR`, `EACCES` or `ELOOP`, or the name of a handle's `DOMException`, as `TypeMismatchError` of a folder; `undefined` of an error of neither. | - | [packages/project-resolve/src/errors.ts:64](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L64) |
|
|
51
51
|
| <a id="property-stack"></a> `stack?` | `public` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`stack`](ResolveError.md#property-stack) | - |
|
|
52
52
|
| <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | `undefined` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | [`ResolveError`](ResolveError.md).[`stackTraceLimit`](ResolveError.md#property-stacktracelimit) | - |
|
|
53
53
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: WorkspaceError
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/project-resolve/src/errors.ts:30](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
5
|
+
Defined in: [packages/project-resolve/src/errors.ts:30](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L30)
|
|
6
6
|
|
|
7
7
|
A workspace that a file of it says wrong: a package.json that is no JSON object, `workspaces`
|
|
8
8
|
or the `packages` of a pnpm-workspace.yaml that is no list of patterns, or two packages of one
|
|
@@ -24,7 +24,7 @@ new WorkspaceError(
|
|
|
24
24
|
): WorkspaceError;
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Defined in: [packages/project-resolve/src/errors.ts:34](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
27
|
+
Defined in: [packages/project-resolve/src/errors.ts:34](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L34)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -47,9 +47,9 @@ Defined in: [packages/project-resolve/src/errors.ts:34](https://gitlab.com/wetry
|
|
|
47
47
|
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|
|
48
48
|
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
|
|
49
49
|
| <a id="property-cause"></a> `cause?` | `public` | `unknown` | `undefined` | - | [`ResolveError`](ResolveError.md).[`cause`](ResolveError.md#property-cause) | - |
|
|
50
|
-
| <a id="property-code"></a> `code` | `readonly` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`code`](ResolveError.md#property-code) | [packages/project-resolve/src/errors.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
51
|
-
| <a id="property-exitcode"></a> `exitCode` | `readonly` | `number` | `1` | What a command that fails by it exits with. | [`ResolveError`](ResolveError.md).[`exitCode`](ResolveError.md#property-exitcode) | [packages/project-resolve/src/errors.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
52
|
-
| <a id="property-file"></a> `file` | `readonly` | `string` | `undefined` | The file that says it: a package.json, or a pnpm-workspace.yaml. | - | [packages/project-resolve/src/errors.ts:32](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
50
|
+
| <a id="property-code"></a> `code` | `readonly` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`code`](ResolveError.md#property-code) | [packages/project-resolve/src/errors.ts:14](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L14) |
|
|
51
|
+
| <a id="property-exitcode"></a> `exitCode` | `readonly` | `number` | `1` | What a command that fails by it exits with. | [`ResolveError`](ResolveError.md).[`exitCode`](ResolveError.md#property-exitcode) | [packages/project-resolve/src/errors.ts:16](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L16) |
|
|
52
|
+
| <a id="property-file"></a> `file` | `readonly` | `string` | `undefined` | The file that says it: a package.json, or a pnpm-workspace.yaml. | - | [packages/project-resolve/src/errors.ts:32](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/errors.ts#L32) |
|
|
53
53
|
| <a id="property-message"></a> `message` | `public` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`message`](ResolveError.md#property-message) | - |
|
|
54
54
|
| <a id="property-name"></a> `name` | `public` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`name`](ResolveError.md#property-name) | - |
|
|
55
55
|
| <a id="property-stack"></a> `stack?` | `public` | `string` | `undefined` | - | [`ResolveError`](ResolveError.md).[`stack`](ResolveError.md#property-stack) | - |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function candidatesOf(specifier): string[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/hooks.ts:132](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/hooks.ts:132](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/hooks.ts#L132)
|
|
10
10
|
|
|
11
11
|
The modules of TypeScript a relative specifier names, in the order TypeScript looks for them:
|
|
12
12
|
the `.ts` of the `.js`, or, of a specifier with no extension of JavaScript, its `.ts` and then
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function sourcesHookOf(packages, realpath): ResolveHookSync;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/hooks.ts:86](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/hooks.ts:86](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/hooks.ts#L86)
|
|
10
10
|
|
|
11
11
|
The hook of the packages given, each a package of the workspace: an import of one of them, or of
|
|
12
12
|
one of its subpaths, resolves by its `@wtf/source` condition first. A package of the registry is
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function sourcesOf(packages): ReadonlyMap<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/hooks.ts:29](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/hooks.ts:29](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/hooks.ts#L29)
|
|
10
10
|
|
|
11
11
|
The TypeScript of each package of the workspace, and of each subpath it exports, by its
|
|
12
12
|
`@wtf/source` condition, keyed by the specifier that imports it: `@scope/lib`, `@scope/lib/sub`.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const resolveTypeScript: ResolveHookSync;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/hooks.ts:154](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/hooks.ts:154](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/hooks.ts#L154)
|
|
10
10
|
|
|
11
11
|
The hook: what Node resolves, and, of a relative import of the project's own module that it
|
|
12
12
|
finds nothing for, the first of its [candidatesOf](../functions/candidatesOf.md) it finds; with Node's own error when
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function nodePlatform(): object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/node.ts:82](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/node.ts:82](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/node.ts#L82)
|
|
10
10
|
|
|
11
11
|
Node's platform, as a workspace is read by it: the disk, from the root of the working folder's
|
|
12
12
|
drive, as `navigator.storage.getDirectory()`, and the paths of `node:path`.
|
|
@@ -19,7 +19,7 @@ The platform, for `{ platform }` of each reader of ./workspace.
|
|
|
19
19
|
|
|
20
20
|
| Name | Type | Defined in |
|
|
21
21
|
| ------ | ------ | ------ |
|
|
22
|
-
| `navigator` | `object` | [packages/project-resolve/src/workspace.ts:90](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
23
|
-
| `navigator.storage` | `object` | [packages/project-resolve/src/workspace.ts:91](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
24
|
-
| `getDirectory()` | () => `Promise`\<[`WorkspaceDirectoryHandle`](../../workspace/type-aliases/WorkspaceDirectoryHandle.md)\> | [packages/project-resolve/src/workspace.ts:91](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
25
|
-
| `path` | [`WorkspacePaths`](../../workspace/type-aliases/WorkspacePaths.md) | [packages/project-resolve/src/workspace.ts:93](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
22
|
+
| `navigator` | `object` | [packages/project-resolve/src/workspace.ts:90](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/workspace.ts#L90) |
|
|
23
|
+
| `navigator.storage` | `object` | [packages/project-resolve/src/workspace.ts:91](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/workspace.ts#L91) |
|
|
24
|
+
| `getDirectory()` | () => `Promise`\<[`WorkspaceDirectoryHandle`](../../workspace/type-aliases/WorkspaceDirectoryHandle.md)\> | [packages/project-resolve/src/workspace.ts:91](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/workspace.ts#L91) |
|
|
25
|
+
| `path` | [`WorkspacePaths`](../../workspace/type-aliases/WorkspacePaths.md) | [packages/project-resolve/src/workspace.ts:93](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/workspace.ts#L93) |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const REGISTERED: "@wtf/project-resolve/registered" = '@wtf/project-resolve/registered';
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/project-resolve/src/register.ts:43](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.0
|
|
9
|
+
Defined in: [packages/project-resolve/src/register.ts:43](https://gitlab.com/wetryfun/project/project/-/blob/docs-v1.1.0/packages/project-resolve/src/register.ts#L43)
|
|
10
10
|
|
|
11
11
|
The specifier the hooks resolve once they are registered, to the URL of the module that
|
|
12
12
|
registered them, and that nothing resolves before.
|