Skip to content

Commit 3d59faf

Browse files
committed
refactor: change the tsconfig target and bundle
1 parent 77f2ca9 commit 3d59faf

27 files changed

+107
-109
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pranx
22

3-
Pranx — the next of Preact.
3+
Pranx — the next of Preact.
44
A lightweight, Next.js-like fullstack metaframework for Preact apps.
55

66
> Note: Pranx is currently being rewritten from scratch. The API and internals are unstable and subject to change.
@@ -29,8 +29,6 @@ Pranx aims to provide a minimal, highly-performant fullstack developer experienc
2929
- Examples located in `examples/`
3030
- Expect breaking changes until v1.0
3131

32-
33-
3432
Deployment targets: Node servers, serverless platforms, edge runtimes (dependant on handler compile target).
3533

3634
## Contributing

packages/pranx/src/bin/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env node
22

3-
import { build } from "@/cmd/build.js";
4-
import { dev } from "@/cmd/dev.js";
5-
import { start } from "@/cmd/start.js";
6-
import { logger } from "@/utils/logger.js";
3+
import { build } from "@/cmd/build";
4+
import { dev } from "@/cmd/dev";
5+
import { start } from "@/cmd/start";
6+
import { logger } from "@/utils/logger";
77
import { defineCommand, runMain } from "citty";
88

99
const main = defineCommand({

packages/pranx/src/build/bundle/browser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { mdx_pranx_plugin } from "@/plugins/mdx-plugin.js";
2-
import { strip_server_only_from_pages_plugin } from "@/plugins/strip-server-only-from-pages.js";
3-
import { tailwindcss_plugin } from "@/plugins/tailwind-plugin.js";
1+
import { mdx_pranx_plugin } from "@/plugins/mdx-plugin";
2+
import { strip_server_only_from_pages_plugin } from "@/plugins/strip-server-only-from-pages";
3+
import { tailwindcss_plugin } from "@/plugins/tailwind-plugin";
44
import esbuild from "esbuild";
55
import { glob } from "glob";
66
import { join } from "pathe";
7-
import type { PranxConfig } from "types/index.js";
8-
import { OUTPUT_BUNDLE_BROWSER_DIR, SOURCE_DIR, SOURCE_PAGES_DIR } from "../constants.js";
7+
import type { PranxConfig } from "types/index";
8+
import { OUTPUT_BUNDLE_BROWSER_DIR, SOURCE_DIR, SOURCE_PAGES_DIR } from "../constants";
99

1010
export async function bundle_browser(options: { optimize: boolean; user_config: PranxConfig }) {
1111
const browser_entries = await glob(

packages/pranx/src/build/bundle/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { mdx_pranx_plugin } from "@/plugins/mdx-plugin.js";
2-
import { tailwindcss_plugin } from "@/plugins/tailwind-plugin.js";
1+
import { mdx_pranx_plugin } from "@/plugins/mdx-plugin";
2+
import { tailwindcss_plugin } from "@/plugins/tailwind-plugin";
33
import esbuild from "esbuild";
44
import { glob } from "glob";
55
import { join } from "pathe";
6-
import type { PranxConfig } from "types/index.js";
7-
import { OUTPUT_BUNDLE_SERVER_DIR, SOURCE_DIR, SOURCE_PAGES_DIR } from "../constants.js";
6+
import type { PranxConfig } from "types/index";
7+
import { OUTPUT_BUNDLE_SERVER_DIR, SOURCE_DIR, SOURCE_PAGES_DIR } from "../constants";
88

99
export async function bundle_server(options: { optimize: boolean; user_config: PranxConfig }) {
1010
const server_entries = await glob(

packages/pranx/src/build/generate_html_template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { META_TAG } from "@/server/Meta.js";
2-
import { SCRIPTS_TAG } from "@/server/Scripts.js";
1+
import { META_TAG } from "@/server/components/meta";
2+
import { SCRIPTS_TAG } from "@/server/components/scripts";
33
import { minifySync } from "@swc/html";
44

55
export const generate_html_template = ({

packages/pranx/src/client/app-context.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createContext } from "preact";
22
import type { PropsWithChildren } from "preact/compat";
33
import { useCallback, useContext, useState } from "preact/hooks";
4-
import { find_route } from "./shared/find-route.js";
5-
import { onRouteChangeUpdateHead } from "./shared/head.js";
4+
import { find_route } from "./shared/find-route";
5+
import { onRouteChangeUpdateHead } from "./shared/head";
66

77
export type AppContext = {
88
/** Props for the current server side page rendered */

packages/pranx/src/client/app-without-csr.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { lazy } from "preact-iso";
22
import { Suspense } from "preact/compat";
3-
import { find_route } from "./shared/find-route.js";
3+
import { find_route } from "./shared/find-route";
44

55
export function AppWithOutCsr() {
66
const current_route = find_route(window.location.pathname);

packages/pranx/src/client/components/link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ComponentProps, forwardRef } from "preact/compat";
2-
import { _useAppContext } from "../app-context.js";
2+
import { _useAppContext } from "../app-context";
33

44
export type LinkProps = Omit<ComponentProps<"a">, "href"> & {
55
to: string;

packages/pranx/src/client/components/server-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type VNode, cloneElement } from "preact";
22
import { type PropsWithChildren, Children } from "preact/compat";
3-
import { _useAppContext } from "../app-context.js";
3+
import { _useAppContext } from "../app-context";
44

55
export const ServerPage = (props: PropsWithChildren) => {
66
const child = Children.only(props.children) as VNode<any>;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { useAppContext } from "./app-context.js";
2-
export { Link } from "./components/link.js";
3-
export { mount } from "./mount.js";
4-
export { StartApp } from "./start-app.js";
1+
export { useAppContext } from "./app-context";
2+
export { Link } from "./components/link";
3+
export { mount } from "./mount";
4+
export { StartApp } from "./start-app";

0 commit comments

Comments
 (0)