Update watcher and component gen functions
This commit is contained in:
parent
48c25d2fb4
commit
f34f8baa99
2
dist/functions/server/watcher-esbuild-ctx.js
vendored
2
dist/functions/server/watcher-esbuild-ctx.js
vendored
@ -57,6 +57,8 @@ export default async function watcherEsbuildCTX() {
|
|||||||
return;
|
return;
|
||||||
if (filename.match(/\/(--|\()/))
|
if (filename.match(/\/(--|\()/))
|
||||||
return;
|
return;
|
||||||
|
if (filename.match(/ /))
|
||||||
|
return;
|
||||||
if (global.RECOMPILING)
|
if (global.RECOMPILING)
|
||||||
return;
|
return;
|
||||||
const action = existsSync(full_file_path) ? "created" : "deleted";
|
const action = existsSync(full_file_path) ? "created" : "deleted";
|
||||||
|
|||||||
2
dist/functions/server/watcher.js
vendored
2
dist/functions/server/watcher.js
vendored
@ -45,7 +45,7 @@ export default async function watcher() {
|
|||||||
}
|
}
|
||||||
if (!filename.match(/^src\/pages\/|\.css$/))
|
if (!filename.match(/^src\/pages\/|\.css$/))
|
||||||
return;
|
return;
|
||||||
if (filename.match(/\/(--|\()/))
|
if (filename.match(/\/(--|\(| )/))
|
||||||
return;
|
return;
|
||||||
if (global.RECOMPILING)
|
if (global.RECOMPILING)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { jsx as _jsx } from "react/jsx-runtime";
|
import { jsx as _jsx } from "react/jsx-runtime";
|
||||||
import grabPageReactComponentString from "./grab-page-react-component-string";
|
import grabPageReactComponentString from "./grab-page-react-component-string";
|
||||||
import grabTsxStringModule from "./grab-tsx-string-module";
|
import grabTsxStringModule from "./grab-tsx-string-module";
|
||||||
|
import { log } from "../../../utils/log";
|
||||||
export default async function grabPageBundledReactComponent({ file_path, root_file_path, server_res, }) {
|
export default async function grabPageBundledReactComponent({ file_path, root_file_path, server_res, }) {
|
||||||
try {
|
try {
|
||||||
let tsx = grabPageReactComponentString({
|
let tsx = grabPageReactComponentString({
|
||||||
@ -21,6 +22,7 @@ export default async function grabPageBundledReactComponent({ file_path, root_fi
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
log.error(`grabPageBundledReactComponent Error: ${error.message}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,7 @@
|
|||||||
import grabRouteParams from "../../../utils/grab-route-params";
|
import grabRouteParams from "../../../utils/grab-route-params";
|
||||||
import grabPageErrorComponent from "./grab-page-error-component";
|
import grabPageErrorComponent from "./grab-page-error-component";
|
||||||
import grabPageBundledReactComponent from "./grab-page-bundled-react-component";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { log } from "../../../utils/log";
|
import { log } from "../../../utils/log";
|
||||||
import grabRootFilePath from "./grab-root-file-path";
|
|
||||||
import grabPageServerRes from "./grab-page-server-res";
|
|
||||||
import grabPageServerPath from "./grab-page-server-path";
|
|
||||||
import grabPageModules from "./grab-page-modules";
|
import grabPageModules from "./grab-page-modules";
|
||||||
import grabPageCombinedServerRes from "./grab-page-combined-server-res";
|
import grabPageCombinedServerRes from "./grab-page-combined-server-res";
|
||||||
class NotFoundError extends Error {
|
class NotFoundError extends Error {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import EJSON from "../../../utils/ejson";
|
import EJSON from "../../../utils/ejson";
|
||||||
|
import { log } from "../../../utils/log";
|
||||||
import pagePathTransform from "../../../utils/page-path-transform";
|
import pagePathTransform from "../../../utils/page-path-transform";
|
||||||
export default function grabPageReactComponentString({ file_path, root_file_path, server_res, }) {
|
export default function grabPageReactComponentString({ file_path, root_file_path, server_res, }) {
|
||||||
try {
|
try {
|
||||||
@ -31,6 +32,7 @@ export default function grabPageReactComponentString({ file_path, root_file_path
|
|||||||
return tsx;
|
return tsx;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
log.error(`grabPageReactComponentString Error: ${error.message}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "@moduletrace/bunext",
|
"name": "@moduletrace/bunext",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.0.45",
|
"version": "1.0.46",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@ -79,6 +79,7 @@ export default async function watcherEsbuildCTX() {
|
|||||||
|
|
||||||
if (!filename.match(/^src\/pages\/|\.css$/)) return;
|
if (!filename.match(/^src\/pages\/|\.css$/)) return;
|
||||||
if (filename.match(/\/(--|\()/)) return;
|
if (filename.match(/\/(--|\()/)) return;
|
||||||
|
if (filename.match(/ /)) return;
|
||||||
|
|
||||||
if (global.RECOMPILING) return;
|
if (global.RECOMPILING) return;
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ export default async function watcher() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!filename.match(/^src\/pages\/|\.css$/)) return;
|
if (!filename.match(/^src\/pages\/|\.css$/)) return;
|
||||||
if (filename.match(/\/(--|\()/)) return;
|
if (filename.match(/\/(--|\(| )/)) return;
|
||||||
|
|
||||||
if (global.RECOMPILING) return;
|
if (global.RECOMPILING) return;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import type { JSX } from "react";
|
|
||||||
import type { GrabPageReactBundledComponentRes } from "../../../types";
|
import type { GrabPageReactBundledComponentRes } from "../../../types";
|
||||||
import grabPageReactComponentString from "./grab-page-react-component-string";
|
import grabPageReactComponentString from "./grab-page-react-component-string";
|
||||||
import grabTsxStringModule from "./grab-tsx-string-module";
|
import grabTsxStringModule from "./grab-tsx-string-module";
|
||||||
|
import { log } from "../../../utils/log";
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
file_path: string;
|
file_path: string;
|
||||||
@ -35,6 +35,7 @@ export default async function grabPageBundledReactComponent({
|
|||||||
tsx,
|
tsx,
|
||||||
};
|
};
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
log.error(`grabPageBundledReactComponent Error: ${error.message}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +1,8 @@
|
|||||||
import grabRouteParams from "../../../utils/grab-route-params";
|
import grabRouteParams from "../../../utils/grab-route-params";
|
||||||
import type {
|
import type { BunxRouteParams, GrabPageComponentRes } from "../../../types";
|
||||||
BunextPageModule,
|
|
||||||
BunextPageModuleServerReturn,
|
|
||||||
BunextPageServerModule,
|
|
||||||
BunextRootModule,
|
|
||||||
BunxRouteParams,
|
|
||||||
GrabPageComponentRes,
|
|
||||||
} from "../../../types";
|
|
||||||
import grabPageErrorComponent from "./grab-page-error-component";
|
import grabPageErrorComponent from "./grab-page-error-component";
|
||||||
import grabPageBundledReactComponent from "./grab-page-bundled-react-component";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { log } from "../../../utils/log";
|
import { log } from "../../../utils/log";
|
||||||
import grabRootFilePath from "./grab-root-file-path";
|
|
||||||
import grabPageServerRes from "./grab-page-server-res";
|
|
||||||
import grabPageServerPath from "./grab-page-server-path";
|
|
||||||
import grabPageModules from "./grab-page-modules";
|
import grabPageModules from "./grab-page-modules";
|
||||||
import grabPageCombinedServerRes from "./grab-page-combined-server-res";
|
import grabPageCombinedServerRes from "./grab-page-combined-server-res";
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import EJSON from "../../../utils/ejson";
|
import EJSON from "../../../utils/ejson";
|
||||||
|
import { log } from "../../../utils/log";
|
||||||
import pagePathTransform from "../../../utils/page-path-transform";
|
import pagePathTransform from "../../../utils/page-path-transform";
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
@ -47,6 +48,7 @@ export default function grabPageReactComponentString({
|
|||||||
|
|
||||||
return tsx;
|
return tsx;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
log.error(`grabPageReactComponentString Error: ${error.message}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user