idcmd 0.0.2 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idcmd",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rustydotwtf/idcmd"
@@ -30,7 +30,7 @@
30
30
  "start": "bun src/server.ts",
31
31
  "check": "ultracite check && bun run typecheck && bun run test",
32
32
  "test": "bun test",
33
- "typecheck": "tsgo --noEmit -p tsconfig.json",
33
+ "typecheck": "tsc --noEmit -p tsconfig.json",
34
34
  "fix": "ultracite fix",
35
35
  "prepare": "lefthook install"
36
36
  },
@@ -49,6 +49,7 @@
49
49
  "oxfmt": "^0.28.0",
50
50
  "oxlint": "^1.43.0",
51
51
  "tailwindcss": "^4.1.18",
52
+ "typescript": "^5",
52
53
  "ultracite": "7.1.4"
53
54
  },
54
55
  "peerDependencies": {
@@ -12,7 +12,8 @@ const findTailwindInput = async (): Promise<string> => {
12
12
  };
13
13
 
14
14
  const idcmdBuildEntry = (): string =>
15
- Bun.fileURLToPath(new URL("../build.ts", import.meta.url));
15
+ // `src/build.ts` lives two levels up from `src/cli/commands/*`.
16
+ Bun.fileURLToPath(new URL("../../build.ts", import.meta.url));
16
17
 
17
18
  export const buildCommand = async (): Promise<number> => {
18
19
  const tailwindInput = await findTailwindInput();
@@ -1,4 +1,4 @@
1
- import { parsePort } from "@/cli/normalize";
1
+ import { parsePort } from "../normalize";
2
2
 
3
3
  const DEFAULT_PORT = 4000;
4
4
 
@@ -25,7 +25,8 @@ const resolveTailwindOutput = async (): Promise<string> => {
25
25
  };
26
26
 
27
27
  const idcmdServerEntry = (): string =>
28
- Bun.fileURLToPath(new URL("../server.ts", import.meta.url));
28
+ // `src/server.ts` lives two levels up from `src/cli/commands/*`.
29
+ Bun.fileURLToPath(new URL("../../server.ts", import.meta.url));
29
30
 
30
31
  const installSignalHandlers = (shutdown: () => void): void => {
31
32
  process.on("SIGINT", shutdown);
@@ -1,13 +1,13 @@
1
- import { copyDir, isDirEmpty, replaceInFile } from "@/cli/fs";
1
+ import { copyDir, isDirEmpty, replaceInFile } from "../fs";
2
2
  import {
3
3
  normalizeOptionalString,
4
4
  parsePort,
5
5
  toPackageName,
6
- } from "@/cli/normalize";
7
- import { basename, joinPath } from "@/cli/path";
8
- import { promptOptionalText, promptText } from "@/cli/prompt";
9
- import { run } from "@/cli/run";
10
- import { readPackageVersion } from "@/cli/version";
6
+ } from "../normalize";
7
+ import { basename, joinPath } from "../path";
8
+ import { promptOptionalText, promptText } from "../prompt";
9
+ import { run } from "../run";
10
+ import { readPackageVersion } from "../version";
11
11
 
12
12
  const DEFAULT_PORT = 4000;
13
13
 
@@ -1,4 +1,7 @@
1
- import { isFileLikePathname, toCanonicalHtmlPathname } from "@/site/url-policy";
1
+ import {
2
+ isFileLikePathname,
3
+ toCanonicalHtmlPathname,
4
+ } from "../../site/url-policy";
2
5
 
3
6
  const stripLeadingSlash = (pathname: string): string =>
4
7
  pathname.startsWith("/") ? pathname.slice(1) : pathname;
package/src/cli/main.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  /* eslint-disable no-console */
2
2
 
3
- import type { ParsedArgs } from "@/cli/args";
4
-
5
- import { parseArgs } from "@/cli/args";
6
- import { buildCommand } from "@/cli/commands/build";
7
- import { deployCommand } from "@/cli/commands/deploy";
8
- import { devCommand } from "@/cli/commands/dev";
9
- import { initCommand } from "@/cli/commands/init";
10
- import { previewCommand } from "@/cli/commands/preview";
11
- import { parsePort } from "@/cli/normalize";
12
- import { readPackageVersion } from "@/cli/version";
3
+ import type { ParsedArgs } from "./args";
4
+
5
+ import { parseArgs } from "./args";
6
+ import { buildCommand } from "./commands/build";
7
+ import { deployCommand } from "./commands/deploy";
8
+ import { devCommand } from "./commands/dev";
9
+ import { initCommand } from "./commands/init";
10
+ import { previewCommand } from "./commands/preview";
11
+ import { parsePort } from "./normalize";
12
+ import { readPackageVersion } from "./version";
13
13
 
14
14
  const DEFAULT_PREVIEW_PORT = 4173;
15
15
 
@@ -1,7 +1,7 @@
1
- export type { LayoutProps } from "@/render/layout";
2
- export { renderLayout } from "@/render/layout";
1
+ export type { LayoutProps } from "../render/layout";
2
+ export { renderLayout } from "../render/layout";
3
3
 
4
- export type { TocItem } from "@/render/toc";
5
- export { RightRail } from "@/render/right-rail";
4
+ export type { TocItem } from "../render/toc";
5
+ export { RightRail } from "../render/right-rail";
6
6
 
7
- export { renderSearchPageContent } from "@/search/page";
7
+ export { renderSearchPageContent } from "../search/page";
@@ -1,4 +1,4 @@
1
- import { getProjectPaths } from "@/project/paths";
1
+ import { getProjectPaths } from "../project/paths";
2
2
 
3
3
  const FALLBACK_ICON_NAME = "file";
4
4
  const FALLBACK_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>`;
@@ -1,7 +1,6 @@
1
- import type { SiteConfig } from "@/site/config";
2
-
3
- import { loadSiteConfig } from "@/site/config";
1
+ import type { SiteConfig } from "../site/config";
4
2
 
3
+ import { loadSiteConfig } from "../site/config";
5
4
  import { parseFrontmatter } from "./frontmatter";
6
5
  import { derivePageMetaFromParsed } from "./meta";
7
6
  import {
@@ -3,12 +3,10 @@
3
3
  * Scans content folders and builds navigation structure from frontmatter.
4
4
  */
5
5
 
6
- import type { GroupConfig } from "@/site/config";
7
-
8
- import { loadSiteConfig } from "@/site/config";
9
-
6
+ import type { GroupConfig } from "../site/config";
10
7
  import type { PageMeta } from "./frontmatter";
11
8
 
9
+ import { loadSiteConfig } from "../site/config";
12
10
  import { parseFrontmatter, extractTitleFromContent } from "./frontmatter";
13
11
  import { resolveIconSvg } from "./icons";
14
12
  import { getContentDir, scanContentFiles, slugFromContentFile } from "./paths";
@@ -1,4 +1,4 @@
1
- import { getProjectPaths } from "@/project/paths";
1
+ import { getProjectPaths } from "../project/paths";
2
2
 
3
3
  const flatContentGlob = new Bun.Glob("*.md");
4
4
 
@@ -3,9 +3,8 @@ import type { JSX } from "preact";
3
3
 
4
4
  import { render } from "preact-render-to-string";
5
5
 
6
- import type { NavGroup, NavItem } from "@/content/navigation";
7
- import type { ResolvedRightRailConfig } from "@/site/config";
8
-
6
+ import type { NavGroup, NavItem } from "../content/navigation";
7
+ import type { ResolvedRightRailConfig } from "../site/config";
9
8
  import type { TocItem } from "./toc";
10
9
 
11
10
  import { RightRail } from "./right-rail";
@@ -2,16 +2,15 @@ import type { Highlighter } from "shiki";
2
2
 
3
3
  import { createHighlighter } from "shiki";
4
4
 
5
- import type { NavGroup } from "@/content/navigation";
6
- import type { SiteConfig } from "@/site/config";
7
-
8
- import { expandMarkdownContentForHtml } from "@/content/components/expand";
9
- import { parseFrontmatter } from "@/content/frontmatter";
10
- import { derivePageMetaFromParsed } from "@/content/meta";
11
- import { discoverNavigation } from "@/content/navigation";
12
- import { loadSiteConfig, resolveRightRailConfig } from "@/site/config";
13
- import { resolveCanonicalUrl } from "@/site/urls";
5
+ import type { NavGroup } from "../content/navigation";
6
+ import type { SiteConfig } from "../site/config";
14
7
 
8
+ import { expandMarkdownContentForHtml } from "../content/components/expand";
9
+ import { parseFrontmatter } from "../content/frontmatter";
10
+ import { derivePageMetaFromParsed } from "../content/meta";
11
+ import { discoverNavigation } from "../content/navigation";
12
+ import { loadSiteConfig, resolveRightRailConfig } from "../site/config";
13
+ import { resolveCanonicalUrl } from "../site/urls";
15
14
  import { getRenderLayout } from "./layout-loader";
16
15
  import { renderMarkdownToHtml } from "./markdown";
17
16
  import { extractTocFromHtml } from "./toc";
@@ -1,7 +1,6 @@
1
1
  import type { JSX } from "preact";
2
2
 
3
- import type { ResolvedRightRailConfig } from "@/site/config";
4
-
3
+ import type { ResolvedRightRailConfig } from "../site/config";
5
4
  import type { TocItem } from "./toc";
6
5
 
7
6
  const CaretDownIcon = (): JSX.Element => (
package/src/render/toc.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { TocLevel } from "@/site/config";
1
+ import type { TocLevel } from "../site/config";
2
2
 
3
3
  export interface TocItem {
4
4
  id: string;
package/src/search/api.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { getSearchScope, loadSiteConfig } from "@/site/config";
2
-
3
1
  import type { SearchResult } from "./contract";
4
2
 
3
+ import { getSearchScope, loadSiteConfig } from "../site/config";
5
4
  import { toSearchResultJsonLine } from "./contract";
6
5
  import { loadSearchIndex, search } from "./index";
7
6
 
@@ -1,16 +1,15 @@
1
- import type { SearchScope, SiteConfig } from "@/site/config";
1
+ import type { SearchScope, SiteConfig } from "../site/config";
2
+ import type { SearchResult } from "./contract";
2
3
 
3
- import { expandMarkdownForAgent } from "@/content/components/expand";
4
- import { parseFrontmatter } from "@/content/frontmatter";
5
- import { derivePageMetaFromParsed } from "@/content/meta";
4
+ import { expandMarkdownForAgent } from "../content/components/expand";
5
+ import { parseFrontmatter } from "../content/frontmatter";
6
+ import { derivePageMetaFromParsed } from "../content/meta";
6
7
  import {
7
8
  getContentDir,
8
9
  pagePathFromContentSlug,
9
10
  scanContentFiles,
10
11
  slugFromContentFile,
11
- } from "@/content/paths";
12
-
13
- import type { SearchResult } from "./contract";
12
+ } from "../content/paths";
14
13
 
15
14
  export const SEARCH_INDEX_VERSION = 1 as const;
16
15
 
@@ -1,16 +1,14 @@
1
- import type { NavGroup } from "@/content/navigation";
2
- import type { SearchScope } from "@/site/config";
1
+ import type { NavGroup } from "../content/navigation";
2
+ import type { SearchScope } from "../site/config";
3
+ import type { SearchResult } from "./contract";
3
4
 
4
- import { getNavigation, renderDocument } from "@/render/page-renderer";
5
+ import { getNavigation, renderDocument } from "../render/page-renderer";
5
6
  import {
6
7
  getSearchScope,
7
8
  loadSiteConfig,
8
9
  resolveRightRailConfig,
9
- } from "@/site/config";
10
- import { resolveCanonicalUrl } from "@/site/urls";
11
-
12
- import type { SearchResult } from "./contract";
13
-
10
+ } from "../site/config";
11
+ import { resolveCanonicalUrl } from "../site/urls";
14
12
  import { loadSearchIndex, search as runSearch } from "./index";
15
13
  import { renderSearchPageContent } from "./page";
16
14
 
package/src/seo/files.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { parseFrontmatter } from "@/content/frontmatter";
1
+ import { parseFrontmatter } from "../content/frontmatter";
2
2
  import {
3
3
  getContentDir,
4
4
  pagePathFromContentSlug,
5
5
  scanContentFiles,
6
6
  slugFromContentFile,
7
- } from "@/content/paths";
8
- import { resolveAbsoluteUrl } from "@/site/urls";
7
+ } from "../content/paths";
8
+ import { resolveAbsoluteUrl } from "../site/urls";
9
9
 
10
10
  export interface SitemapPage {
11
11
  pathname: string;
package/src/seo/server.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { loadSiteConfig } from "@/site/config";
2
- import { resolveCanonicalBaseUrl } from "@/site/urls";
3
-
1
+ import { loadSiteConfig } from "../site/config";
2
+ import { resolveCanonicalBaseUrl } from "../site/urls";
4
3
  import {
5
4
  collectSitemapPagesFromContent,
6
5
  generateRobotsTxt,
@@ -1,6 +1,6 @@
1
1
  import type { Server } from "bun";
2
2
 
3
- import { getContentDir, scanContentFiles } from "@/content/paths";
3
+ import { getContentDir, scanContentFiles } from "../content/paths";
4
4
 
5
5
  interface LiveReloadClient {
6
6
  close: () => void;
@@ -1,6 +1,9 @@
1
- import type { ProjectPaths } from "@/project/paths";
1
+ import type { ProjectPaths } from "../project/paths";
2
2
 
3
- import { isFileLikePathname, toCanonicalHtmlPathname } from "@/site/url-policy";
3
+ import {
4
+ isFileLikePathname,
5
+ toCanonicalHtmlPathname,
6
+ } from "../site/url-policy";
4
7
 
5
8
  export type RouteHandler = (req: Request) => Response | Promise<Response>;
6
9
 
@@ -9,7 +9,7 @@
9
9
  "deploy": "idcmd deploy",
10
10
  "check": "ultracite check && bun run typecheck && bun run test",
11
11
  "test": "bun test",
12
- "typecheck": "tsgo --noEmit -p tsconfig.json",
12
+ "typecheck": "tsc --noEmit -p tsconfig.json",
13
13
  "fix": "ultracite fix"
14
14
  },
15
15
  "dependencies": {