@publish.os/cli 0.0.1-alpha.1
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 +13 -0
- package/dist/assets/nextjs/defaults/app/globals.css +6 -0
- package/dist/assets/nextjs/defaults/app/providers.tsx +1 -0
- package/dist/assets/nextjs/defaults/group/layout.tsx +13 -0
- package/dist/assets/nextjs/defaults/group/leaf.tsx +29 -0
- package/dist/assets/nextjs/defaults/group/page.tsx +50 -0
- package/dist/assets/nextjs/defaults/project/next.config.mjs +49 -0
- package/dist/assets/nextjs/defaults/project/package.json +10 -0
- package/dist/assets/nextjs/defaults/project/postcss.config.mjs +5 -0
- package/dist/assets/nextjs/defaults/project/tsconfig.json +32 -0
- package/dist/assets/nextjs/defaults/root/css/radius.css +34 -0
- package/dist/assets/nextjs/defaults/root/css/scaling.css +50 -0
- package/dist/assets/nextjs/defaults/root/css/typography.css +487 -0
- package/dist/assets/nextjs/defaults/root/css/zindex.css +29 -0
- package/dist/assets/nextjs/defaults/root/globals.css +122 -0
- package/dist/assets/nextjs/defaults/root/layout.tsx +15 -0
- package/dist/assets/nextjs/defaults/root/page.tsx +66 -0
- package/dist/assets/nextjs/defaults/root/theme.css +248 -0
- package/dist/assets/nextjs/defaults/source/_internal/logger.ts +20 -0
- package/dist/assets/nextjs/shims/global-layout.tsx +28 -0
- package/dist/assets/nextjs/shims/group-layout.tsx +7 -0
- package/dist/assets/nextjs/shims/group-page.tsx +12 -0
- package/dist/assets/nextjs/shims/leaf-page.tsx +13 -0
- package/dist/assets/nextjs/shims/metadata-route.tmpl +4 -0
- package/dist/assets/nextjs/shims/root-page.tsx +12 -0
- package/dist/publish.os.d.mts +1 -0
- package/dist/publish.os.mjs +10133 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Providers } from "@publish.os/nextjs/components/providers";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LayoutProps } from "@publish.os/nextjs/types";
|
|
2
|
+
import { log } from "@source/_internal/logger";
|
|
3
|
+
|
|
4
|
+
export default function GroupLayout(props: LayoutProps) {
|
|
5
|
+
log.debug("[default:group-layout]", props);
|
|
6
|
+
const { children } = props;
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<section className="mx-auto w-full max-w-6xl px-6 py-10 lg:px-10">
|
|
10
|
+
{children}
|
|
11
|
+
</section>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PageList } from "@publish.os/nextjs/components/page-list";
|
|
2
|
+
import { MDX } from "@publish.os/nextjs/mdx";
|
|
3
|
+
import type { PageProps } from "@publish.os/nextjs/types";
|
|
4
|
+
import { log } from "@source/_internal/logger";
|
|
5
|
+
|
|
6
|
+
export default async function LeafPage(props: PageProps) {
|
|
7
|
+
log.debug("[default:leaf-page]", props);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div className="grid gap-8 lg:grid-cols-[14rem_minmax(0,1fr)]">
|
|
11
|
+
<aside className="border-stroke-2 text-foreground-2 lg:border-r lg:pr-6">
|
|
12
|
+
<p className="mb-3 text-sm font-medium text-foreground-1">Pages</p>
|
|
13
|
+
<PageList tree={props.tree} currentPath={props.currentPath} />
|
|
14
|
+
</aside>
|
|
15
|
+
<article className="min-w-0 text-foreground-1">
|
|
16
|
+
<h1 className="text-3xl font-semibold tracking-tight text-foreground-1">
|
|
17
|
+
{props.page.title}
|
|
18
|
+
</h1>
|
|
19
|
+
<div className="markdown-prose mt-6">
|
|
20
|
+
<MDX
|
|
21
|
+
content={props.page.body}
|
|
22
|
+
pageId={props.page.id}
|
|
23
|
+
slug={props.page.slug}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</article>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PageList } from "@publish.os/nextjs/components/page-list";
|
|
2
|
+
import type { IndexPageProps } from "@publish.os/nextjs/types";
|
|
3
|
+
import { log } from "@source/_internal/logger";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
|
|
6
|
+
export default function GroupPage(props: IndexPageProps) {
|
|
7
|
+
log.debug("[default:group-page]", props);
|
|
8
|
+
const { node, tree, currentPath } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<main className="w-full max-w-3xl text-foreground-1">
|
|
12
|
+
<h1 className="text-3xl font-semibold tracking-tight text-foreground-1">
|
|
13
|
+
{node.title} ({currentPath})
|
|
14
|
+
</h1>
|
|
15
|
+
|
|
16
|
+
{tree.length > 0 && (
|
|
17
|
+
<nav className="mt-8">
|
|
18
|
+
<ul className="space-y-2 text-sm">
|
|
19
|
+
{tree.map((node) => (
|
|
20
|
+
<li key={node.id}>
|
|
21
|
+
{node.type === "link" ? (
|
|
22
|
+
<a
|
|
23
|
+
className="text-accent-1 underline-offset-4 hover:underline"
|
|
24
|
+
href={node.href}
|
|
25
|
+
>
|
|
26
|
+
{node.title}
|
|
27
|
+
</a>
|
|
28
|
+
) : node.type === "section" || node.type === "folder" ? (
|
|
29
|
+
<div className="space-y-2">
|
|
30
|
+
<p className="font-medium text-foreground-1">
|
|
31
|
+
{node.title}
|
|
32
|
+
</p>
|
|
33
|
+
<PageList tree={node.children} />
|
|
34
|
+
</div>
|
|
35
|
+
) : (
|
|
36
|
+
<Link
|
|
37
|
+
className="text-accent-1 underline-offset-4 hover:underline"
|
|
38
|
+
href={node.path}
|
|
39
|
+
>
|
|
40
|
+
{node.title}
|
|
41
|
+
</Link>
|
|
42
|
+
)}
|
|
43
|
+
</li>
|
|
44
|
+
))}
|
|
45
|
+
</ul>
|
|
46
|
+
</nav>
|
|
47
|
+
)}
|
|
48
|
+
</main>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Generated by PublishOS builder - do not edit.
|
|
2
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
function findNextRoot(start) {
|
|
9
|
+
let current = resolve(start);
|
|
10
|
+
const packageSuffix = "/node_modules/next/package.json";
|
|
11
|
+
|
|
12
|
+
for (;;) {
|
|
13
|
+
const nextPackage = resolve(
|
|
14
|
+
current,
|
|
15
|
+
"node_modules",
|
|
16
|
+
"next",
|
|
17
|
+
"package.json",
|
|
18
|
+
);
|
|
19
|
+
if (existsSync(nextPackage)) {
|
|
20
|
+
const realNextPackage = realpathSync(nextPackage);
|
|
21
|
+
if (realNextPackage.endsWith(packageSuffix)) {
|
|
22
|
+
return realNextPackage.slice(0, -packageSuffix.length);
|
|
23
|
+
}
|
|
24
|
+
return current;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const parent = resolve(current, "..");
|
|
28
|
+
if (parent === current) return start;
|
|
29
|
+
current = parent;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const repoRoot = findNextRoot(__dirname);
|
|
34
|
+
|
|
35
|
+
/** @type {import("next").NextConfig} */
|
|
36
|
+
export default {
|
|
37
|
+
cacheComponents: true,
|
|
38
|
+
outputFileTracingRoot: repoRoot,
|
|
39
|
+
turbopack: {
|
|
40
|
+
root: repoRoot,
|
|
41
|
+
},
|
|
42
|
+
cacheLife: {
|
|
43
|
+
page: {
|
|
44
|
+
stale: 60 * 60 * 24,
|
|
45
|
+
revalidate: 60 * 60 * 24 * 30,
|
|
46
|
+
expire: 60 * 60 * 24 * 365,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"baseUrl": ".",
|
|
17
|
+
"paths": {
|
|
18
|
+
"@source/*": ["./source/*"],
|
|
19
|
+
"@manifest": ["./manifest.generated"]
|
|
20
|
+
},
|
|
21
|
+
"plugins": [{ "name": "next" }]
|
|
22
|
+
},
|
|
23
|
+
"include": [
|
|
24
|
+
"source/**/*",
|
|
25
|
+
"app/**/*",
|
|
26
|
+
"next-env.d.ts",
|
|
27
|
+
"manifest.generated.ts",
|
|
28
|
+
".next/types/**/*.ts",
|
|
29
|
+
".next/dev/types/**/*.ts"
|
|
30
|
+
],
|
|
31
|
+
"exclude": ["node_modules"]
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/*
|
|
3
|
+
* Presets for --theme-radius in theme.css.
|
|
4
|
+
* Use none, xs, sm, md, lg, xl, or full by assigning one of these vars.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
--theme-radius-none: 0px;
|
|
8
|
+
--theme-radius-xs: calc(2px * var(--theme-scaling));
|
|
9
|
+
--theme-radius-sm: calc(4px * var(--theme-scaling));
|
|
10
|
+
--theme-radius-md: calc(6px * var(--theme-scaling));
|
|
11
|
+
--theme-radius-lg: calc(8px * var(--theme-scaling));
|
|
12
|
+
--theme-radius-xl: calc(12px * var(--theme-scaling));
|
|
13
|
+
--theme-radius-full: 9999px;
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* Component radius aliases.
|
|
17
|
+
* Tailwind exposes these as rounded-button, rounded-card, rounded-popup, etc.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
--radius-button: var(--theme-radius);
|
|
21
|
+
--radius-kbd: var(--theme-radius-sm);
|
|
22
|
+
--radius-input: var(--theme-radius);
|
|
23
|
+
--radius-card: var(--theme-radius-lg);
|
|
24
|
+
--radius-codeblock: var(--theme-radius-lg);
|
|
25
|
+
--radius-badge: var(--theme-radius-full);
|
|
26
|
+
--radius-avatar: var(--theme-radius-full);
|
|
27
|
+
--radius-panel: var(--theme-radius-lg);
|
|
28
|
+
--radius-popup: var(--theme-radius);
|
|
29
|
+
--radius-checkbox: var(--theme-radius-sm);
|
|
30
|
+
--radius-switch-thumb: var(--theme-radius-full);
|
|
31
|
+
--radius-switch-track: var(--theme-radius-full);
|
|
32
|
+
--radius-scrollbar-thumb: var(--theme-radius-full);
|
|
33
|
+
--radius-link-underline: var(--theme-radius-lg);
|
|
34
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/*
|
|
3
|
+
* Presets for --theme-scaling in theme.css.
|
|
4
|
+
* Tenants can use a preset var or any number, for example 1.08.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
--theme-scale-xs: 0.9;
|
|
8
|
+
--theme-scale-sm: 0.95;
|
|
9
|
+
--theme-scale-md: 1;
|
|
10
|
+
--theme-scale-lg: 1.05;
|
|
11
|
+
--theme-scale-xl: 1.1;
|
|
12
|
+
--theme-scale-2xl: 1.25;
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Platform spacing helpers.
|
|
16
|
+
* Components use these so one --theme-scaling change can adjust density.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
--scale-0: calc(0rem * var(--theme-scaling));
|
|
20
|
+
--scale-px: max(1px, calc(1px * var(--theme-scaling)));
|
|
21
|
+
--scale-0-5: calc(0.125rem * var(--theme-scaling));
|
|
22
|
+
--scale-1: calc(0.25rem * var(--theme-scaling));
|
|
23
|
+
--scale-1-5: calc(0.375rem * var(--theme-scaling));
|
|
24
|
+
--scale-2: calc(0.5rem * var(--theme-scaling));
|
|
25
|
+
--scale-2-5: calc(0.625rem * var(--theme-scaling));
|
|
26
|
+
--scale-3: calc(0.75rem * var(--theme-scaling));
|
|
27
|
+
--scale-3-5: calc(0.875rem * var(--theme-scaling));
|
|
28
|
+
--scale-4: calc(1rem * var(--theme-scaling));
|
|
29
|
+
--scale-5: calc(1.25rem * var(--theme-scaling));
|
|
30
|
+
--scale-6: calc(1.5rem * var(--theme-scaling));
|
|
31
|
+
--scale-8: calc(2rem * var(--theme-scaling));
|
|
32
|
+
--scale-10: calc(2.5rem * var(--theme-scaling));
|
|
33
|
+
--scale-12: calc(3rem * var(--theme-scaling));
|
|
34
|
+
--scale-16: calc(4rem * var(--theme-scaling));
|
|
35
|
+
--scale-20: calc(5rem * var(--theme-scaling));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (max-width: 640px) {
|
|
39
|
+
:root {
|
|
40
|
+
/* Reserved for future viewport-aware density tuning. */
|
|
41
|
+
--theme-viewport-scale: 0.95;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (min-width: 1536px) {
|
|
46
|
+
:root {
|
|
47
|
+
/* Reserved for future viewport-aware density tuning. */
|
|
48
|
+
--theme-viewport-scale: 1.05;
|
|
49
|
+
}
|
|
50
|
+
}
|