@noverax/courier-build 0.0.0-stage → 0.4.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/LICENSE +21 -0
- package/README.md +289 -2
- package/lib/config/index.d.ts +420 -0
- package/lib/config/index.js +66 -0
- package/lib/config-file-of-Zkwyi9zf.js +28 -0
- package/lib/config-in-page-message-DLd3f0Jd.js +20 -0
- package/lib/courier-routes-options-BYF7Sfdf.d.cts +13 -0
- package/lib/courier-routes-options-BYF7Sfdf.d.ts +13 -0
- package/lib/engine/worker.d.ts +1 -0
- package/lib/engine/worker.js +551 -0
- package/lib/errno-code-CNx_E80R.js +32 -0
- package/lib/esbuild/index.d.ts +58 -0
- package/lib/esbuild/index.js +191 -0
- package/lib/index-_VUU5N5v.d.ts +134 -0
- package/lib/index.d.ts +101 -0
- package/lib/index.js +4 -0
- package/lib/jest/routes-thread.d.ts +1 -0
- package/lib/jest/routes-thread.js +46 -0
- package/lib/jest/transformer.cjs +121 -0
- package/lib/jest/transformer.d.cts +39 -0
- package/lib/load-config-BeedbpkN.js +1419 -0
- package/lib/metro/index.cjs +25 -0
- package/lib/metro/index.d.cts +55 -0
- package/lib/metro/index.d.ts +67 -0
- package/lib/metro/index.js +105 -0
- package/lib/package-file-CVAKY_Nu.js +39 -0
- package/lib/rollup/index.d.ts +51 -0
- package/lib/rollup/index.js +95 -0
- package/lib/routes-engine-BfwrCuNL.d.ts +117 -0
- package/lib/routes-file-DcpgxYb1.js +206 -0
- package/lib/routes-loader-context-40OKDrQp.d.ts +26 -0
- package/lib/routes-module-code-DO3aII6v.js +402 -0
- package/lib/routes-module-id-CnUjQjYF.js +12 -0
- package/lib/routes-read-error-DQhKIE2F.js +30 -0
- package/lib/routes-rule-CjzX6NS5.js +108 -0
- package/lib/rsbuild/index.d.ts +41 -0
- package/lib/rsbuild/index.js +37 -0
- package/lib/rspack/index.d.ts +3 -0
- package/lib/rspack/index.js +1 -0
- package/lib/shared-engine-CCu7vP_0.js +28 -0
- package/lib/vite/index.d.ts +33 -0
- package/lib/vite/index.js +346 -0
- package/lib/webpack/index.d.ts +4 -0
- package/lib/webpack/index.js +3 -0
- package/lib/webpack/loader.cjs +31 -0
- package/lib/webpack/loader.d.cts +40 -0
- package/lib/webpack/run-routes-loader.d.ts +22 -0
- package/lib/webpack/run-routes-loader.js +103 -0
- package/lib/webpack-B0v9i8lk.js +42 -0
- package/lib/worker-messages-BT2vvNQJ.js +35 -0
- package/package.json +209 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NoveraX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,290 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<br />
|
|
3
|
+
<a href="https://courier.noverax.cloud">
|
|
4
|
+
<picture>
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NoveraX/courier/master/docs/public/logos/courier-mark-light.svg" />
|
|
6
|
+
<img alt="Courier" src="https://raw.githubusercontent.com/NoveraX/courier/master/docs/public/logos/courier-mark-dark.svg" height="44" />
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
2
9
|
|
|
3
|
-
|
|
10
|
+
<h1>Courier Build</h1>
|
|
11
|
+
|
|
12
|
+
<p><strong>A page's routes, built from your config. No file to generate.</strong></p>
|
|
13
|
+
|
|
14
|
+
<p>The bundler plugin that hands every page — and every server rendering one — the routes its proxy client may call, read from <code>courier.config.ts</code> by the rules the proxy applies. The routes module carries no address, path or middleware, and no <code>courier.routes.ts</code> is written or committed. It is also the one loader of the config every Courier tool shares.</p>
|
|
15
|
+
|
|
16
|
+
<p>
|
|
17
|
+
<a href="https://www.npmjs.com/package/@noverax/courier-build"><img alt="npm" src="https://img.shields.io/npm/v/@noverax/courier-build?style=flat-square&label=npm&labelColor=08090a&color=1c63d6" /></a>
|
|
18
|
+
<a href="https://www.typescriptlang.org/"><img alt="TypeScript strict" src="https://img.shields.io/badge/typescript-strict-1c63d6?style=flat-square&labelColor=08090a" /></a>
|
|
19
|
+
<a href="https://github.com/NoveraX/courier/blob/master/LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-1c63d6?style=flat-square&labelColor=08090a" /></a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p>
|
|
23
|
+
<a href="https://courier.noverax.cloud/docs/proxy-mode/expose"><strong>Exposing endpoints</strong></a>
|
|
24
|
+
·
|
|
25
|
+
<a href="https://courier.noverax.cloud/docs">Documentation</a>
|
|
26
|
+
·
|
|
27
|
+
<a href="https://github.com/NoveraX/courier#readme">Courier</a>
|
|
28
|
+
·
|
|
29
|
+
<a href="https://github.com/NoveraX/courier/tree/master/packages/build">Source</a>
|
|
30
|
+
</p>
|
|
31
|
+
<br />
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<br />
|
|
35
|
+
|
|
36
|
+
## Overview
|
|
37
|
+
|
|
38
|
+
<table>
|
|
39
|
+
<tr>
|
|
40
|
+
<td width="33%" valign="top">
|
|
41
|
+
<h4>Read from your marks</h4>
|
|
42
|
+
Each endpoint you mark <code>.expose()</code>, by the rules the proxy applies — read from the config in a process of its own, so a build sees your files as they are.
|
|
43
|
+
</td>
|
|
44
|
+
<td width="33%" valign="top">
|
|
45
|
+
<h4>Live as you work</h4>
|
|
46
|
+
Edit a definition and the dev server serves the new routes without a restart; Vitest reruns the tests that import them.
|
|
47
|
+
</td>
|
|
48
|
+
<td width="33%" valign="top">
|
|
49
|
+
<h4>Closed by default</h4>
|
|
50
|
+
A build that cannot read the config fails with why, and a page that imports the config itself fails the build, as it would ship every API's definition to the browser.
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
54
|
+
|
|
55
|
+
<br />
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install --save-dev @noverax/courier-build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
<br />
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
Add the plugin to the app's Vite config:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
// vite.config.ts
|
|
71
|
+
import { courierRoutes } from "@noverax/courier-build/vite"
|
|
72
|
+
import { defineConfig } from "vite"
|
|
73
|
+
|
|
74
|
+
export default defineConfig({ plugins: [courierRoutes()] })
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Register the config once, in a module of the project, so `routes` is typed from it — a `courier-env.d.ts` beside the config keeps it out of every bundle:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
// courier-env.d.ts
|
|
81
|
+
import type config from "./courier.config"
|
|
82
|
+
|
|
83
|
+
declare module "@noverax/courier/routes" {
|
|
84
|
+
interface Register {
|
|
85
|
+
config: typeof config
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
A page then takes the routes of the API it calls, and its client reaches exactly the endpoints that API opens to a page:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import { createProxyCaller } from "@noverax/courier"
|
|
94
|
+
import { routes } from "@noverax/courier/routes"
|
|
95
|
+
|
|
96
|
+
export const shop = createProxyCaller(routes.shop)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`routes` holds every source of the config; one that opens nothing to a page has no endpoints. Without the plugin, reading a route throws `ConfigurationError` `ROUTES_NOT_BUILT`, so a page never runs on routes nobody built.
|
|
100
|
+
|
|
101
|
+
### How the routes are read
|
|
102
|
+
|
|
103
|
+
- **The config** is the `courier.config.*` in Vite's root or the nearest folder above it, up to the top of the project: the folder that holds its repository (`.git`, `.hg`, `.jj`) or is the root of its workspace (`pnpm-workspace.yaml`, or a `package.json` with `workspaces`). One found above the root runs only when it belongs to you or to the owner of the root, and no user outside its group may write it; otherwise the routes are not read, and the error says why. Name another config with the `config` option.
|
|
104
|
+
- **Env files** are those Vite reads for the mode — `.env.[mode].local`, `.env.[mode]`, `.env.local`, `.env`, the first to set a variable winning — with the values Vite gives them, a reference such as `${HOST}` or `${FLAG:-1}` filled in; a variable the process was started with wins over all. An endpoint opened by a variable is opened as the build sees it. The config reads them from `process.env`: `import.meta.env.MODE`, `DEV` and the other values Vite builds into a page are not set for it.
|
|
105
|
+
- **A build** reads the routes once for every environment, and fails with what the config threw; a build that watches builds again once what failed it is mended. **The dev server** reads them again whenever something they came from changes: the config, a module it imports, a file it reads or a folder it lists, an env file, a variable it looked at, or a config saved where one is looked for, Vite's root or a folder above it. A change saved while the routes are read is read too. A config that breaks leaves the routes it read last in force, says why in the terminal and over the page, and is followed until it is mended.
|
|
106
|
+
- **The config in a page** fails the build: imported as a value it would ship the server's settings and every API's definition to the browser. Import its type alone, with `import type`.
|
|
107
|
+
- **Vitest** runs tests through Vite with the plugin: a test gets the routes under Node and under jsdom alike, may import the config itself, and in watch mode an edit reruns the tests that import the routes, with the new ones. Vitest 3.1 and later tell the plugin they run it; under Vitest 3.0 a test that imports the config as a value in a browser environment is refused as a page would be.
|
|
108
|
+
- **Definitions in a page** are not refused: a module of definitions a page imports as a value goes to the browser whole, with each API's address, its paths and middleware, and its endpoints closed to pages. Keep them out of a page's modules, or import their types alone; the routes are all a page needs to call through the proxy.
|
|
109
|
+
|
|
110
|
+
### Options
|
|
111
|
+
|
|
112
|
+
| Option | Default | |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| `config` | the `courier.config.*` found from the root | The config file, from Vite's root or absolute |
|
|
115
|
+
|
|
116
|
+
<br />
|
|
117
|
+
|
|
118
|
+
## webpack, Rspack and Rsbuild
|
|
119
|
+
|
|
120
|
+
The same routes, under the webpack family: a plugin adds a rule that builds them in place of `@noverax/courier/routes`, in every bundle the compiler builds, and a rule that fails a page's bundle where it takes the config itself.
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// webpack.config.ts
|
|
124
|
+
import { CourierRoutesPlugin } from "@noverax/courier-build/webpack"
|
|
125
|
+
|
|
126
|
+
export default { plugins: [new CourierRoutesPlugin()] }
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Rspack runs the same plugin, from `@noverax/courier-build/rspack`. Rsbuild takes its own, which builds every environment — a page's and a server's:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
// rsbuild.config.ts
|
|
133
|
+
import { courierRoutes } from "@noverax/courier-build/rsbuild"
|
|
134
|
+
import { defineConfig } from "@rsbuild/core"
|
|
135
|
+
|
|
136
|
+
export default defineConfig({ plugins: [courierRoutes()] })
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Next.js takes `withCourier()` from `@noverax/courier-next/plugin`, under Turbopack and webpack alike; Nuxt's `courierRoutesModule` builds the routes under its webpack and Rspack builders as under Vite.
|
|
140
|
+
|
|
141
|
+
- **The config** is found from the compiler's context — Rsbuild's root — as Vite's plugin finds it from Vite's root, and the `config` option names another.
|
|
142
|
+
- **Variables** are the process's: the bundler's own env files, which Next.js and Rsbuild load before they build, reach the config, and webpack reads none of its own.
|
|
143
|
+
- **A watching build or a dev server** builds the routes module again when a file the config read changes or a path it looked for appears. Its result is never kept for the same inputs, as no bundler sees the variables a config reads; the engine reads the routes again only when what they came from has changed. A config that breaks under a dev server leaves the routes it read last in force and reports why with the compilation's errors; a build fails with it.
|
|
144
|
+
|
|
145
|
+
<br />
|
|
146
|
+
|
|
147
|
+
## esbuild
|
|
148
|
+
|
|
149
|
+
The same routes, under esbuild: the plugin from `@noverax/courier-build/esbuild` builds them in place of `@noverax/courier/routes`, and a bundle for any `platform` but `node` — a page's — fails where it takes the config itself.
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import { build } from "esbuild"
|
|
153
|
+
import { courierRoutes } from "@noverax/courier-build/esbuild"
|
|
154
|
+
|
|
155
|
+
await build({ entryPoints: ["src/main.ts"], bundle: true, outdir: "dist", plugins: [courierRoutes()] })
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
- **The config** is found from `absWorkingDir`, or the folder esbuild runs in, and the `config` option names another.
|
|
159
|
+
- **Variables** are the process's: esbuild reads no env file of its own.
|
|
160
|
+
- **A context that builds again**, under `watch()` or `serve()`, follows every file the routes came from, each path the config looked for that is not there yet, and each folder it listed. A config that breaks on a later build leaves the routes read last in force, with a warning; a first build fails with it.
|
|
161
|
+
|
|
162
|
+
<br />
|
|
163
|
+
|
|
164
|
+
## Rollup and Rolldown
|
|
165
|
+
|
|
166
|
+
Rollup and Rolldown take the same plugin, from `@noverax/courier-build/rollup`. Neither tells a page's bundle from a server's, so a bundle is taken for a page's, which fails where it takes the config itself; a server's, which may import it, says so:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
// rollup.config.js
|
|
170
|
+
import { courierRoutes } from "@noverax/courier-build/rollup"
|
|
171
|
+
|
|
172
|
+
export default [
|
|
173
|
+
{ input: "src/main.js", output: { dir: "dist" }, plugins: [courierRoutes()] },
|
|
174
|
+
{ input: "src/server.js", output: { dir: "server" }, plugins: [courierRoutes({ server: true })] },
|
|
175
|
+
]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- **The config** is found from the folder the bundler runs in, and the `config` option names another.
|
|
179
|
+
- **Under `watch`**, every file the routes came from is watched, each path the config looked for that is not there yet, and each folder it listed. A config that breaks on a rebuild leaves the routes read last in force, with a warning; a build fails with it.
|
|
180
|
+
|
|
181
|
+
<br />
|
|
182
|
+
|
|
183
|
+
## Metro and Expo
|
|
184
|
+
|
|
185
|
+
Metro bundles only files on disk, so `withCourier()` from `@noverax/courier-build/metro` reads the routes before Metro starts and writes them to a module of the app's own, `node_modules/.cache/@noverax/courier/routes.js`, which `@noverax/courier/routes` resolves to:
|
|
186
|
+
|
|
187
|
+
```js
|
|
188
|
+
// metro.config.js
|
|
189
|
+
const { getDefaultConfig } = require("expo/metro-config")
|
|
190
|
+
const { withCourier } = require("@noverax/courier-build/metro")
|
|
191
|
+
|
|
192
|
+
module.exports = withCourier(getDefaultConfig(__dirname))
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
- **The config** is found from Metro's `projectRoot`, and the `config` option names another.
|
|
196
|
+
- **A dev server** keeps the module current: a change to a file the routes came from — an edit saved by replacing the file, as editors save, too — reads them again, and Metro bundles the module anew. A config that breaks leaves the routes read last in force, and says why in Metro's terminal; with none read yet, the module fails where it is imported, saying why.
|
|
197
|
+
- **A build** — `expo export`, a release bundle — fails while the routes cannot be read, with why.
|
|
198
|
+
- **The config in the app's bundle** fails it: the app's bundle would carry the server's settings and every API's definition. A server's bundle under Expo — its API routes, React Server Components — may take it.
|
|
199
|
+
- **`outDir`** names another folder for the module, where `node_modules` cannot be written; one outside the project is added to `watchFolders`. The app's own `resolveRequest` runs for every other module, Expo's as well.
|
|
200
|
+
|
|
201
|
+
<br />
|
|
202
|
+
|
|
203
|
+
## Jest
|
|
204
|
+
|
|
205
|
+
Jest runs the transformer from `@noverax/courier-build/jest` on the module `@noverax/courier/routes` ships. Jest transforms nothing under `node_modules` unless told, and the core is an ES module it transforms in any case:
|
|
206
|
+
|
|
207
|
+
```js
|
|
208
|
+
// jest.config.js
|
|
209
|
+
export default {
|
|
210
|
+
transform: {
|
|
211
|
+
"/node_modules/@noverax/courier/lib/routes/index\\.js$": "@noverax/courier-build/jest",
|
|
212
|
+
"\\.[jt]sx?$": "babel-jest",
|
|
213
|
+
},
|
|
214
|
+
transformIgnorePatterns: ["/node_modules/(?!@noverax/courier/)"],
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
- **The routes** are CommonJS for a test that requires them, and an ES module under `--experimental-vm-modules`.
|
|
219
|
+
- **The config** is found from Jest's `rootDir`, and read once in each worker while nothing it read changes; `["@noverax/courier-build/jest", { config: "…" }]` names another.
|
|
220
|
+
- **Jest's cache** is keyed by the routes themselves: a run after an edit, or under another value of a variable the config reads, never takes the routes of the last.
|
|
221
|
+
- **Under `--watch`**, a test that takes only the routes is not run again when a definition changes: Jest follows the module the package ships, which imports none. Run them all with `a`.
|
|
222
|
+
|
|
223
|
+
<br />
|
|
224
|
+
|
|
225
|
+
## API
|
|
226
|
+
|
|
227
|
+
| Export | From | Purpose |
|
|
228
|
+
|---|---|---|
|
|
229
|
+
| `courierRoutes(options?)` | `/vite` | The Vite plugin: the routes in place of `@noverax/courier/routes`, in every environment |
|
|
230
|
+
| `CourierRoutesPlugin` | `/webpack`, `/rspack` | The webpack and Rspack plugin: the routes in every bundle, and the config refused in a page's |
|
|
231
|
+
| `courierRoutes(options?)` | `/rsbuild` | The Rsbuild plugin, for every environment |
|
|
232
|
+
| `courierRoutes(options?)` | `/esbuild` | The esbuild plugin: the routes in every bundle, and the config refused in a page's — any `platform` but `node` |
|
|
233
|
+
| `writtenRoutesPlugin(options)` | `/esbuild` | The esbuild plugin for a host that follows only the files a build read from disk, as Angular's builders do: the routes written to a module there, kept current while the host watches |
|
|
234
|
+
| `courierRoutes(options?)` | `/rollup` | The Rollup and Rolldown plugin: the routes in every bundle, and the config refused unless `server: true` says the bundle is a server's |
|
|
235
|
+
| `withCourier(config, options?)` | `/metro` | Metro's and Expo's: the routes written to a module of the app's own, kept current under a dev server, and the config refused in the app's bundle |
|
|
236
|
+
| `createTransformer(options?)` | `/jest` | The Jest transformer: the routes as CommonJS or an ES module, as the test runs, cached by the routes themselves |
|
|
237
|
+
| `routesProject(root, options?)` / `routesRule(project)` / `configInPageRule(project)` / `routesLoaderFile()` | `/webpack` | The rules the plugins add, for a framework that writes its bundler's config itself |
|
|
238
|
+
| `createRoutesEngine(options)` | root | Read a project's routes in a process of their own, again only when a file or variable they came from changed — for a plugin of another bundler |
|
|
239
|
+
| `routesModuleCode(snapshot)` / `routesCommonJsCode(snapshot)` / `unreadRoutesModuleCode(message)` | root | The module a bundle takes in place of `@noverax/courier/routes` — as an ES module or as CommonJS — or one that fails with why |
|
|
240
|
+
| `configInPageMessage(configFile)` | root | Why a page's bundle that takes the config itself fails, and what to write instead, as every plugin says it — for a plugin of another bundler |
|
|
241
|
+
| `RoutesReadError` | root | Why the routes were not read — `CONFIG_NOT_FOUND`, `CONFIG_NOT_TRUSTED`, `CONFIG_NOT_LOADED`, `ROUTES_NOT_READ`, `CORE_NOT_FOUND` or `ROUTES_NOT_WRITTEN` — and, in `inputs`, what the reading had read, which may mend it |
|
|
242
|
+
| `loadCourierConfig(options?)` | `/config` | Find and load `courier.config.{ts,mts,cts,js,mjs,cjs}`, in that order of names |
|
|
243
|
+
| `loadCourierConfigFile(file, options?)` | `/config` | Load one config file, found by whatever means the caller chose |
|
|
244
|
+
| `findConfigFile(startDir)` / `findConfigFileAt(cwd)` / `CONFIG_BASENAMES` | `/config` | The config file in a directory or the nearest one above it up to the top of the project (one above only when it is yours: else `UntrustedConfigError`), in that directory alone, and the names it may have |
|
|
245
|
+
| `configCandidates(startDir)` | `/config` | Every path a config is looked for at from a directory, in order, up to the top of the project |
|
|
246
|
+
| `createConfigJiti(file, options?)` | `/config` | The loader the config is read with, for another of the project's files |
|
|
247
|
+
| `findTransformCacheDirectory(projectRoot)` | `/config` | Where transforms are kept across processes: `.cache/courier/transform` in the nearest `node_modules`, or `null` when there is no `node_modules`, the directory could hold files another user placed, or `COURIER_TRANSFORM_CACHE` is `0`, `false` or `off` |
|
|
248
|
+
| `createTransformCache(options?)` | `/config` | Reuse each module's transform while its bytes are unchanged, in memory and in that directory |
|
|
249
|
+
| `projectTransformCache(projectRoot)` | `/config` | The transforms kept in a project's `node_modules/.cache`, for a process that loads its modules once |
|
|
250
|
+
| `readPathAliases(projectRoot)` | `/config` | The tsconfig `paths` the loader resolves imports through |
|
|
251
|
+
| `unknownConfigKeys(config)` | `/config` | The keys of a config Courier does not read, which are usually typos |
|
|
252
|
+
|
|
253
|
+
<br />
|
|
254
|
+
|
|
255
|
+
## Part of Courier
|
|
256
|
+
|
|
257
|
+
<table>
|
|
258
|
+
<tr>
|
|
259
|
+
<td width="50%" valign="top">
|
|
260
|
+
<a href="https://github.com/NoveraX/courier/tree/master/packages/core"><strong>@noverax/courier</strong></a><br />
|
|
261
|
+
Define your API once; call it typed from server code and the browser.
|
|
262
|
+
</td>
|
|
263
|
+
<td width="50%" valign="top">
|
|
264
|
+
<a href="https://github.com/NoveraX/courier/tree/master/packages/studio"><strong>@noverax/courier-studio</strong></a><br />
|
|
265
|
+
See every request your app makes, live.
|
|
266
|
+
</td>
|
|
267
|
+
</tr>
|
|
268
|
+
<tr>
|
|
269
|
+
<td width="50%" valign="top">
|
|
270
|
+
<a href="https://github.com/NoveraX/courier/tree/master/packages/cli"><strong>@noverax/courier-cli</strong></a><br />
|
|
271
|
+
What a page may call, written from your marks and checked in CI.
|
|
272
|
+
</td>
|
|
273
|
+
<td width="50%" valign="top">
|
|
274
|
+
<a href="https://github.com/NoveraX/courier/tree/master/packages/create-courier"><strong>@noverax/create-courier</strong></a><br />
|
|
275
|
+
All of it in your project, in one command.
|
|
276
|
+
</td>
|
|
277
|
+
</tr>
|
|
278
|
+
</table>
|
|
279
|
+
|
|
280
|
+
<br />
|
|
281
|
+
|
|
282
|
+
## License
|
|
283
|
+
|
|
284
|
+
[MIT](https://github.com/NoveraX/courier/blob/master/LICENSE)
|
|
285
|
+
|
|
286
|
+
<br />
|
|
287
|
+
|
|
288
|
+
<div align="center">
|
|
289
|
+
<sub>Part of <a href="https://github.com/NoveraX/courier">Courier</a> · built by <a href="https://github.com/NoveraX">NoveraX</a></sub>
|
|
290
|
+
</div>
|