Skip to content

Commit

Permalink
move files around
Browse files Browse the repository at this point in the history
  • Loading branch information
nksaraf committed Jul 22, 2023
1 parent 45749d7 commit 22bd629
Show file tree
Hide file tree
Showing 209 changed files with 184 additions and 664 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"peerDependencies": {
"react": "0.0.0-experimental-035a41c4e-20230704",
"react-dom": "0.0.0-experimental-035a41c4e-20230704",
"vite": "^4.3.0"
"vite": "^4.3.9"
},
"dependencies": {
"acorn-loose": "^8.3.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"dependencies": {
"@picocss/pico": "^1.5.7",
"@vinxi/react": "workspace:^",
"@vitejs/plugin-react": "^4.0.1",
"autoprefixer": "^10.4.14",
"path-to-regexp": "^6.2.1",
"react": "0.0.0-experimental-035a41c4e-20230704",
"react-dom": "0.0.0-experimental-035a41c4e-20230704",
"tailwindcss": "^3.3.2",
"vinxi": "workspace:^",
"wouter": "^2.11.0"
},
"devDependencies": {
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6"
"@types/react-dom": "^18.2.6",
"tailwindcss": "^3.3.2",
"vinxi": "workspace:^",
"@vitejs/plugin-react": "^4.0.1",
"autoprefixer": "^10.4.14"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default createApp({
mode: "build",
handler: "./app/client.tsx",
dir: "./app/routes",
root: "./app/root.tsx",
style: TanstackFileSystemRouter,
build: {
target: "browser",
Expand All @@ -85,20 +84,10 @@ export default createApp({
mode: "handler",
handler: "./app/server.tsx",
dir: "./app/routes",
root: "./app/root.tsx",
style: TanstackFileSystemRouter,
build: {
target: "node",
plugins: () => [
reactRefresh(),
// config("ssr-no-external", {
// ssr: {
// noExternal: [
// "/node_modules/@gisatcz/cross-package-react-context/dist/index.js",
// ],
// },
// }),
],
plugins: () => [reactRefresh()],
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { RootRoute } from "@tanstack/router";
import { lazyRoute } from "@vinxi/react";
import fileRoutes from "vinxi/routes";

import Root from "./Root";
import { createLoaderClient } from "./loaderClient";
import Root from "./root";

const createNestedRoutes = (fileRoutes) => {
function processRoute(routes, route, id, full) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dev": "pnpm -r --parallel --filter \"./packages/*\" run dev",
"build": "pnpm -r --filter \"./packages/*\" run build",
"clean:test": "rimraf ../.fixtures",
"clean": "rm -rf **/*/.{nitro,output}",
"test": "pnpm --filter tests clean && pnpm --filter tests test --",
"ci": "pnpm -r --stream run ci",
"test:packages": "pnpm -r --stream run test",
Expand All @@ -21,5 +22,8 @@
"vite@4.3.9": "patches/vite@4.3.9.patch",
"@tanstack/react-start@0.0.1-beta.111": "patches/@tanstack__react-start@0.0.1-beta.111.patch"
}
},
"dependencies": {
"rimraf": "^5.0.1"
}
}
5 changes: 3 additions & 2 deletions packages/vinxi-react/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@vinxi/react",
"version": "1.0.0",
"version": "0.0.4",
"type": "module",
"author": "Nikhil Saraf <nsaraf98@gmail.com>",
"files": [
"src",
"*.jsx",
"invariant.js",
"*.d.ts"
],
"types": "./index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/vinxi-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vinxi/solid",
"version": "1.0.0",
"version": "0.0.2",
"type": "module",
"author": "Nikhil Saraf <nsaraf98@gmail.com>",
"files": [
Expand Down
28 changes: 26 additions & 2 deletions packages/vinxi/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { visualizer } from "rollup-plugin-visualizer";

import { consola, withLogger } from "./logger.js";
import { createSPAManifest } from "./manifest/spa-manifest.js";
import { config } from "./plugins/config.js";
import { manifest } from "./plugins/manifest.js";
import { routes } from "./plugins/routes.js";
import { treeShake } from "./plugins/tree-shake.js";
Expand Down Expand Up @@ -33,6 +34,7 @@ export async function createBuild(app, buildConfig) {

const nitro = await createNitro({
dev: false,
preset: process.env.TARGET ?? process.env.NITRO_PRESET,
plugins: [
"#app-manifest",
fileURLToPath(new URL("./prod-manifest.js", import.meta.url)),
Expand Down Expand Up @@ -214,8 +216,30 @@ const spaManifest = () => {

const routerModePlugin = {
static: () => [],
handler: () => [],
spa: () => [spaManifest()],
handler: () => [
config("appType", {
appType: "custom",
ssr: {
noExternal: ["vinxi"],
},
optimizeDeps: {
disabled: true,
},
}),
],
spa: () => [
spaManifest(),
config("appType", {
appType: "custom",
ssr: {
noExternal: ["vinxi"],
},
optimizeDeps: {
force: true,
exclude: ["vinxi"],
},
}),
],
};

function toRouteId(route) {
Expand Down
33 changes: 29 additions & 4 deletions packages/vinxi/lib/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,15 @@ const routerModeDevPlugin = {
routes(),
devEntries(),
manifest(),
config("appType", { appType: "spa" }),
config("appType", {
appType: "spa",
ssr: {
noExternal: ["vinxi"],
},
optimizeDeps: {
exclude: ["vinxi"],
},
}),
treeShake(),
// fileSystemWatcher(),
],
Expand All @@ -125,14 +133,31 @@ const routerModeDevPlugin = {
routes(),
devEntries(),
manifest(),
config("appType", { appType: "custom" }),
config("appType", {
appType: "custom",
ssr: {
noExternal: ["vinxi"],
},
optimizeDeps: {
disabled: true,
},
}),
treeShake(),
],
build: () => [
routes(),
devEntries(),
manifest(),
config("appType", { appType: "custom" }),
config("appType", {
appType: "custom",
ssr: {
noExternal: ["vinxi"],
},
optimizeDeps: {
force: true,
exclude: ["vinxi"],
},
}),
treeShake(),
],
};
Expand Down Expand Up @@ -244,7 +269,7 @@ export async function createDevServer(
const localFetch = createLocalFetch(localCall, globalThis.fetch);
const $fetch = createFetch({
fetch: localFetch,
Headers,
// Headers,
});
// @ts-ignore
globalThis.$fetch = $fetch;
Expand Down
4 changes: 3 additions & 1 deletion packages/vinxi/lib/manifest/client-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const manifest = new Proxy(
"Bundler name should be a string",
);
return {
handler: import.meta.env.ROUTER_HANDLER,
handler: import.meta.env.DEV
? join(import.meta.env.CWD, import.meta.env.ROUTER_HANDLER)
: import.meta.env.ROUTER_HANDLER,
inputs: new Proxy(
{},
{
Expand Down
1 change: 1 addition & 0 deletions packages/vinxi/lib/plugins/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function manifest() {
"import.meta.env.MANIFEST": `globalThis.MANIFEST`,
"import.meta.env.ROUTER_NAME": JSON.stringify(router.name),
"import.meta.env.ROUTER_HANDLER": JSON.stringify(router.handler),
"import.meta.env.CWD": JSON.stringify(router.root),
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
},
};
Expand Down
3 changes: 2 additions & 1 deletion packages/vinxi/lib/plugins/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export function routes() {
root = config.root;
router = config.router;
},
async load(id) {
async load(url) {
const [id, query] = url.split("?");
if (id === fileURLToPath(new URL("../routes.js", import.meta.url))) {
const js = jsCode();
const routesCode = JSON.stringify(
Expand Down
8 changes: 5 additions & 3 deletions packages/vinxi/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "vinxi",
"version": "1.0.0",
"version": "0.0.5",
"type": "module",
"author": "Nikhil Saraf <nsaraf98@gmail.com>",
"files": [
"src",
"bin",
"lib",
"runtime",
"*.d.ts"
],
"bin": "./bin/cli.mjs",
Expand Down Expand Up @@ -63,7 +65,7 @@
"unenv": "^1.5.1",
"unimport": "^3.0.11",
"unstorage": "^1.7.0",
"vite": "^4.3.9"
"vite": "4.3.9"
},
"devDependencies": {
"@types/node": "^18.14.0",
Expand Down
Loading

0 comments on commit 22bd629

Please sign in to comment.