@fairgarden/monolith 0.1.0-alpha.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.
Files changed (50) hide show
  1. package/Readme.md +84 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +160 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/compat.d.ts +4 -0
  7. package/dist/compat.d.ts.map +1 -0
  8. package/dist/compat.js +156 -0
  9. package/dist/compat.js.map +1 -0
  10. package/dist/eslint.d.ts +62 -0
  11. package/dist/eslint.d.ts.map +1 -0
  12. package/dist/eslint.js +198 -0
  13. package/dist/eslint.js.map +1 -0
  14. package/dist/index.d.ts +28 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +77 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/link.d.ts +24 -0
  19. package/dist/link.d.ts.map +1 -0
  20. package/dist/link.js +473 -0
  21. package/dist/link.js.map +1 -0
  22. package/dist/mounts.d.ts +37 -0
  23. package/dist/mounts.d.ts.map +1 -0
  24. package/dist/mounts.js +51 -0
  25. package/dist/mounts.js.map +1 -0
  26. package/dist/package-json.d.ts +38 -0
  27. package/dist/package-json.d.ts.map +1 -0
  28. package/dist/package-json.js +156 -0
  29. package/dist/package-json.js.map +1 -0
  30. package/dist/portability.d.ts +36 -0
  31. package/dist/portability.d.ts.map +1 -0
  32. package/dist/portability.js +158 -0
  33. package/dist/portability.js.map +1 -0
  34. package/dist/portable-link.d.ts +22 -0
  35. package/dist/portable-link.d.ts.map +1 -0
  36. package/dist/portable-link.js +24 -0
  37. package/dist/portable-link.js.map +1 -0
  38. package/dist/resolve.d.ts +5 -0
  39. package/dist/resolve.d.ts.map +1 -0
  40. package/dist/resolve.js +181 -0
  41. package/dist/resolve.js.map +1 -0
  42. package/dist/routes.d.ts +23 -0
  43. package/dist/routes.d.ts.map +1 -0
  44. package/dist/routes.js +95 -0
  45. package/dist/routes.js.map +1 -0
  46. package/dist/types.d.ts +111 -0
  47. package/dist/types.d.ts.map +1 -0
  48. package/dist/types.js +2 -0
  49. package/dist/types.js.map +1 -0
  50. package/package.json +74 -0
@@ -0,0 +1,23 @@
1
+ import type { NextConfig } from 'next';
2
+ import type { ResolvedApp } from './types.ts';
3
+ /**
4
+ * Move a path into an app's mount point.
5
+ *
6
+ * Absolute URLs and Next's internal paths are left alone; everything else is a
7
+ * route belonging to the app and moves under `/<name>`.
8
+ *
9
+ * Pages Router API routes are the one exception. Next only treats files
10
+ * directly under `pages/api/` as API routes, so an app's `pages/api` mounts at
11
+ * `pages/api/<name>` and its paths become `/api/<name>/...` — the prefix goes
12
+ * after `/api`, not before it.
13
+ */
14
+ export declare const prefixPath: (value: string, prefix: string, apiViaPages?: boolean) => string;
15
+ /**
16
+ * Build the monolith's `rewrites`, keeping each phase's ordering: the
17
+ * monolith's own entries stay ahead of the apps', and apps keep the order they
18
+ * were declared in.
19
+ */
20
+ export declare const mergeRewrites: (base: NextConfig, apps: ResolvedApp[]) => Promise<NonNullable<NextConfig["rewrites"]>>;
21
+ export declare const mergeRedirects: (base: NextConfig, apps: ResolvedApp[]) => Promise<NonNullable<NextConfig["redirects"]>>;
22
+ export declare const mergeHeaders: (base: NextConfig, apps: ResolvedApp[]) => Promise<NonNullable<NextConfig["headers"]>>;
23
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAU7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,qBAAmB,KAClB,MAWF,CAAA;AAsCD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,UAAU,EAChB,MAAM,WAAW,EAAE,KAClB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAiB7C,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,MAAM,UAAU,EAChB,MAAM,WAAW,EAAE,KAClB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAS9C,CAAA;AAED,eAAO,MAAM,YAAY,GACvB,MAAM,UAAU,EAChB,MAAM,WAAW,EAAE,KAClB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAS5C,CAAA"}
package/dist/routes.js ADDED
@@ -0,0 +1,95 @@
1
+ /** Next's own internals are served from the monolith root, never per app. */
2
+ const RESERVED = ['/_next/', '/__next', '/api/__'];
3
+ /**
4
+ * Move a path into an app's mount point.
5
+ *
6
+ * Absolute URLs and Next's internal paths are left alone; everything else is a
7
+ * route belonging to the app and moves under `/<name>`.
8
+ *
9
+ * Pages Router API routes are the one exception. Next only treats files
10
+ * directly under `pages/api/` as API routes, so an app's `pages/api` mounts at
11
+ * `pages/api/<name>` and its paths become `/api/<name>/...` — the prefix goes
12
+ * after `/api`, not before it.
13
+ */
14
+ export const prefixPath = (value, prefix, apiViaPages = false) => {
15
+ // An app served at the site root has nothing to prefix, and '/' must stay
16
+ // '/' rather than becoming the empty prefix.
17
+ if (prefix === '')
18
+ return value;
19
+ if (!value.startsWith('/'))
20
+ return value;
21
+ if (RESERVED.some((reserved) => value.startsWith(reserved)))
22
+ return value;
23
+ if (apiViaPages && (value === '/api' || value.startsWith('/api/'))) {
24
+ return `/api${prefix}${value.slice('/api'.length)}`;
25
+ }
26
+ if (value === '/')
27
+ return prefix;
28
+ return `${prefix}${value}`;
29
+ };
30
+ const prefixRewrite = (rewrite, app) => ({
31
+ ...rewrite,
32
+ source: prefixPath(rewrite.source, app.prefix, app.apiViaPages),
33
+ destination: prefixPath(rewrite.destination, app.prefix, app.apiViaPages),
34
+ });
35
+ const prefixRedirect = (redirect, app) => ({
36
+ ...redirect,
37
+ source: prefixPath(redirect.source, app.prefix, app.apiViaPages),
38
+ destination: prefixPath(redirect.destination, app.prefix, app.apiViaPages),
39
+ });
40
+ const prefixHeader = (header, app) => ({
41
+ ...header,
42
+ source: prefixPath(header.source, app.prefix, app.apiViaPages),
43
+ });
44
+ /** Rewrites are either a flat list or the three-phase object; normalize both. */
45
+ const toPhases = (rewrites) => {
46
+ if (!rewrites)
47
+ return { beforeFiles: [], afterFiles: [], fallback: [] };
48
+ if (Array.isArray(rewrites)) {
49
+ return { beforeFiles: [], afterFiles: rewrites, fallback: [] };
50
+ }
51
+ return {
52
+ beforeFiles: (rewrites.beforeFiles ?? []),
53
+ afterFiles: (rewrites.afterFiles ?? []),
54
+ fallback: (rewrites.fallback ?? []),
55
+ };
56
+ };
57
+ const call = async (value) => (value ? await value() : undefined);
58
+ /**
59
+ * Build the monolith's `rewrites`, keeping each phase's ordering: the
60
+ * monolith's own entries stay ahead of the apps', and apps keep the order they
61
+ * were declared in.
62
+ */
63
+ export const mergeRewrites = async (base, apps) => {
64
+ return async () => {
65
+ const merged = toPhases(await call(base.rewrites));
66
+ for (const app of apps) {
67
+ const phases = toPhases(await call(app.nextConfig.rewrites));
68
+ merged.beforeFiles.push(...phases.beforeFiles.map((rule) => prefixRewrite(rule, app)));
69
+ merged.afterFiles.push(...phases.afterFiles.map((rule) => prefixRewrite(rule, app)));
70
+ merged.fallback.push(...phases.fallback.map((rule) => prefixRewrite(rule, app)));
71
+ }
72
+ return merged;
73
+ };
74
+ };
75
+ export const mergeRedirects = async (base, apps) => {
76
+ return async () => {
77
+ const merged = [...((await call(base.redirects)) ?? [])];
78
+ for (const app of apps) {
79
+ const redirects = (await call(app.nextConfig.redirects)) ?? [];
80
+ merged.push(...redirects.map((rule) => prefixRedirect(rule, app)));
81
+ }
82
+ return merged;
83
+ };
84
+ };
85
+ export const mergeHeaders = async (base, apps) => {
86
+ return async () => {
87
+ const merged = [...((await call(base.headers)) ?? [])];
88
+ for (const app of apps) {
89
+ const headers = (await call(app.nextConfig.headers)) ?? [];
90
+ merged.push(...headers.map((rule) => prefixHeader(rule, app)));
91
+ }
92
+ return merged;
93
+ };
94
+ };
95
+ //# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAQA,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AAElD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,KAAa,EACb,MAAc,EACd,WAAW,GAAG,KAAK,EACX,EAAE;IACV,0EAA0E;IAC1E,6CAA6C;IAC7C,IAAI,MAAM,KAAK,EAAE;QAAE,OAAO,KAAK,CAAA;IAC/B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACxC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IACzE,IAAI,WAAW,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACnE,OAAO,OAAO,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAA;IACrD,CAAC;IACD,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,MAAM,CAAA;IAChC,OAAO,GAAG,MAAM,GAAG,KAAK,EAAE,CAAA;AAC5B,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAE,GAAgB,EAAW,EAAE,CAAC,CAAC;IACtE,GAAG,OAAO;IACV,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,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AO,KAAK,IAAI,EAAE;QAChB,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QACxD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,SAAS,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAA;YAC9D,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;QACpE,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,IAAgB,EAChB,IAAmB,EAC0B,EAAE;IAC/C,OAAO,KAAK,IAAI,EAAE;QAChB,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QACtD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;YAC1D,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;QAChE,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,111 @@
1
+ import type { NextConfig } from 'next';
2
+ /**
3
+ * How the routes Next reads are produced from the committed source tree.
4
+ *
5
+ * The symlinks under `src/app/` are the readable view — they are committed, and
6
+ * GitHub renders them as links you can follow to the app they point at. What
7
+ * Next reads is derived from them:
8
+ *
9
+ * - `source` produces nothing. `next build` follows the committed symlinks, so
10
+ * it reads `src/app/` directly and there is no generated copy to go stale.
11
+ * - `mirror` recreates the tree at `app/` and symlinks each file. `next dev`
12
+ * does not discover routes through a symlinked *directory*, but it does
13
+ * through a symlinked *file*, and because a symlink resolves by path, edits
14
+ * show up even when an editor saves by writing a new file and renaming it.
15
+ * - `hardlink` and `copy` duplicate the files, for filesystems without usable
16
+ * symlinks. Both go stale when an editor replaces a file rather than writing
17
+ * through it, so they lean on the watcher.
18
+ *
19
+ * This chooses how the App Router tree is produced. The Pages Router tree is
20
+ * always duplicated: Next resolves a route to its real path, and a Pages Router
21
+ * route reached through a symlink loses its `pages/` root, which surfaces as a
22
+ * missing `/_document` when the 404 is rendered.
23
+ */
24
+ export type LinkStrategy = 'source' | 'mirror' | 'hardlink' | 'copy';
25
+ export interface MonolithApp {
26
+ /** Directory of the app, relative to the monolith. */
27
+ root?: string;
28
+ /**
29
+ * Package to resolve the app from, e.g. `@fairgarden/id`.
30
+ *
31
+ * May be given alongside `root`, and is then the fallback: the checkout is
32
+ * used when its routes are there, and the package when they are not. That is
33
+ * what lets a private module build somewhere that could install the package
34
+ * but not clone the submodule.
35
+ */
36
+ package?: string;
37
+ /** Routes directory. Defaults to `app/`, falling back to `src/app/`. */
38
+ appDir?: string;
39
+ /** Static asset directory. Defaults to `public/`, omitted when absent. */
40
+ publicDir?: string;
41
+ /**
42
+ * Pages Router directory. Defaults to `pages/`, falling back to `src/pages/`,
43
+ * and omitted when absent.
44
+ */
45
+ pagesDir?: string;
46
+ /**
47
+ * Path to serve this app at. Defaults to `/<mount name>`.
48
+ *
49
+ * `/` serves it at the site root, which is what a `www` app wants: its
50
+ * routes become `/about` rather than `/www/about`. Only one app can have it,
51
+ * and its files sit alongside the monolith's own rather than under a
52
+ * directory of their own.
53
+ */
54
+ prefix?: string;
55
+ /**
56
+ * Config to merge for this app. Defaults to the app's own `next.config.*`.
57
+ * Pass `false` to mount the routes without merging any config.
58
+ */
59
+ nextConfig?: NextConfig | NextConfigFn | false;
60
+ }
61
+ export type NextConfigFn = (phase: string) => NextConfig | Promise<NextConfig>;
62
+ /** Mount name -> app. A bare string is shorthand for a package name or path. */
63
+ export type MonolithApps = Record<string, string | MonolithApp>;
64
+ export interface MonolithOptions {
65
+ /**
66
+ * Defaults to `auto`: `symlink` for builds, `hardlink` for `next dev`.
67
+ * @see LinkStrategy
68
+ */
69
+ strategy?: LinkStrategy | 'auto';
70
+ /** Monolith directory. Defaults to `process.cwd()`. */
71
+ root?: string;
72
+ /**
73
+ * Committed routes directory holding the app symlinks, relative to the
74
+ * monolith. Defaults to `src/app`. Next reads it directly during builds.
75
+ * The Pages Router tree is its `pages` sibling — `src/pages` by default.
76
+ */
77
+ sourceDir?: string;
78
+ /** Watch each app for changes. Defaults to true when mirroring for `next dev`. */
79
+ watch?: boolean;
80
+ /**
81
+ * Make each app resolvable by its own package name from inside itself.
82
+ * Defaults to true. @see linkSelfReference
83
+ */
84
+ selfReference?: boolean;
85
+ }
86
+ export interface ResolvedApp {
87
+ /** Mount name; routes are served under `/<name>`. */
88
+ name: string;
89
+ /** Path prefix the app is mounted at, e.g. `/id`. */
90
+ prefix: string;
91
+ root: string;
92
+ /** The app's own package name, when it has one. */
93
+ packageName: string | undefined;
94
+ /** Whether the files came from the checkout or from node_modules. */
95
+ source: 'path' | 'package';
96
+ appDir: string;
97
+ publicDir: string | undefined;
98
+ pagesDir: string | undefined;
99
+ /** The app's `pages/api`, when it has one. */
100
+ pagesApiDir: string | undefined;
101
+ /**
102
+ * Whether `/api/...` paths in this app's config are Pages Router API routes.
103
+ *
104
+ * Those mount at `/api/<name>/...`, because Next only treats files directly
105
+ * under `pages/api/` as API routes — so unlike every other path, the prefix
106
+ * goes after `/api`, not before it.
107
+ */
108
+ apiViaPages: boolean;
109
+ nextConfig: NextConfig;
110
+ }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IACrD,IAAI,EAAE,MAAM,CAAA;IACZ,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,qEAAqE;IACrE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,8CAA8C;IAC9C,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B;;;;;;OAMG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;CACvB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@fairgarden/monolith",
3
+ "version": "0.1.0-alpha.0",
4
+ "description": "Compose several Next.js apps into a single deployable monolith",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/fairgarden/monolith.git"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "license": "UNLICENSED",
13
+ "type": "module",
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "./link": {
22
+ "types": "./dist/portable-link.d.ts",
23
+ "default": "./dist/portable-link.js"
24
+ },
25
+ "./eslint": {
26
+ "types": "./dist/eslint.d.ts",
27
+ "default": "./dist/eslint.js"
28
+ }
29
+ },
30
+ "bin": {
31
+ "fg-monolith": "./dist/cli.js"
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "dependencies": {
37
+ "@babel/parser": "^7.29.9",
38
+ "@fairgarden/distribution": "^0.1.0-alpha.0",
39
+ "merge-package.json": "^9.1.0",
40
+ "semver": "^7.8.5",
41
+ "sync-directory": "^6.0.5"
42
+ },
43
+ "devDependencies": {
44
+ "@babel/types": "^8.0.6",
45
+ "@types/babel__parser": "^7.1.5",
46
+ "@types/node": "^26.6.2",
47
+ "@types/react": "^19.3.0",
48
+ "@types/semver": "^7.8.0",
49
+ "@typescript-eslint/eslint-plugin": "^8.70.0",
50
+ "@typescript-eslint/parser": "^8.70.0",
51
+ "eslint": "^9.39.5",
52
+ "next": "^16.3.5",
53
+ "react": "^19.3.0",
54
+ "typescript": "^6.0.3"
55
+ },
56
+ "peerDependencies": {
57
+ "next": ">=15",
58
+ "react": ">=18"
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "react": {
62
+ "optional": true
63
+ }
64
+ },
65
+ "scripts": {
66
+ "build": "tsc",
67
+ "dev": "tsc --watch --preserveWatchOutput",
68
+ "lint": "eslint",
69
+ "test": "node --test test/*.test.js",
70
+ "canary": "fg-dist canary",
71
+ "release": "fg-dist release",
72
+ "release:check": "fg-dist release --check"
73
+ }
74
+ }