Skip to content

Commit

Permalink
frontend: organize
Browse files Browse the repository at this point in the history
test
  • Loading branch information
terrablue committed Jul 21, 2024
1 parent aab518e commit 4193aa1
Show file tree
Hide file tree
Showing 109 changed files with 65 additions and 74 deletions.
10 changes: 7 additions & 3 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,20 @@
},
"./spa": "./src/spa/exports.js",
"./*/common": "./src/server/*/common.js",
"./*/hooks/build": "./src/server/*/hooks/build/index.js",
"./*/hooks/serve": "./src/server/*/hooks/serve/index.js",
"./*/client/create-root": "./src/client/*/create-root.js",
"./*/client/expose": "./src/client/*/expose.js",
"./*/client": "./src/client/*/index.js",
"./*/head": "./src/server/*/head.js",
"./react/context/*": "./src/server/react/context/*.js",
"./solid/context/*": "./src/server/solid/context/*.js",
"./webc/client": "./src/server/webc/client/index.js",
"./webc/component": "./src/server/webc/Component.js",
"./base/*": "./src/base/server/*.js",
"./errors/*": "./src/errors/*.js",
"./*": {
"runtime": "./src/server/*/runtime/index.js",
"default": "./src/server/*/default/index.js"
"runtime": "./src/server/*/runtime.js",
"default": "./src/server/*/default.js"
}
}
}
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
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/angular/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/angular/hooks/build";
import serve from "@primate/frontend/angular/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/angular/common";
import serve from "./serve.js";
import serve from "@primate/frontend/angular/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/eta/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/eta/hooks/build";
import serve from "@primate/frontend/eta/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/eta/common";
import serve from "./serve.js";
import serve from "@primate/frontend/eta/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { name, default_extension } from "@primate/frontend/handlebars/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/handlebars/hooks/build";
import serve from "@primate/frontend/handlebars/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { name, default_extension } from "@primate/frontend/handlebars/common";
import serve from "./serve.js";
import serve from "@primate/frontend/handlebars/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/html/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/html/hooks/build";
import serve from "@primate/frontend/html/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/html/common";
import serve from "./serve.js";
import serve from "@primate/frontend/html/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/htmx/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/htmx/hooks/build";
import serve from "@primate/frontend/htmx/hooks/serve";

export default ({
extension = default_extension,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/htmx/common";
import serve from "./serve.js";
import serve from "@primate/frontend/htmx/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/markdown/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/markdown/hooks/build";
import serve from "@primate/frontend/markdown/hooks/serve";

export default ({ extension = default_extension, options } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/markdown/common";
import serve from "./serve.js";
import serve from "@primate/frontend/markdown/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/marko/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/marko/hooks/build";
import serve from "@primate/frontend/marko/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/marko/common";
import serve from "./serve.js";
import serve from "@primate/frontend/marko/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/src/server/react/client/exports.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/react/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/react/hooks/build";
import serve from "@primate/frontend/react/hooks/serve";

export default ({
extension = default_extension,
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/src/server/react/default/prepare.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import compile from "@primate/frontend/base/compile";
import depend from "@primate/frontend/base/depend";
import server_root from "@primate/frontend/base/server-root";
import create_root from "@primate/frontend/react/client/create-root";
import { dependencies, name } from "@primate/frontend/react/common";
import create_root from "../client/create-root.js";
import { client, server } from "./compile.js";
import prepare from "./prepare.js";
import publish from "./publish.js";
Expand All @@ -13,15 +13,13 @@ export default extension => async (app, next) => {
// compile server
await server_root(app, name, create_root, server);

const compiled = await compile({
app.register(extension, await compile({
app,
extension,
name,
create_root,
compile: { server, client },
});

app.register(extension, compiled);
}));

app.build.plugin(publish(app, extension));
const code = "export { default as spa } from '@primate/frontend/spa';";
Expand Down
3 changes: 3 additions & 0 deletions packages/frontend/src/server/react/hooks/build/prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import expose from "@primate/frontend/react/client/expose";

export default app => app.build.export(expose);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import handler from "@primate/frontend/base/handler";
import { name } from "@primate/frontend/react/common";
import client from "../client/default.js";
import client from "@primate/frontend/react/client";
import render from "./render.js";

export default (extension, spa) => (app, next) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/react/common";
import serve from "./serve.js";
import serve from "@primate/frontend/react/hooks/serve";

export default ({
extension = default_extension,
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/src/server/solid/client/exports.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/solid/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/solid/hooks/build";
import serve from "@primate/frontend/solid/hooks/serve";

export default ({
extension = default_extension,
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/src/server/solid/default/prepare.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import compile from "@primate/frontend/base/compile";
import depend from "@primate/frontend/base/depend";
import server_root from "@primate/frontend/base/server-root";
import create_root from "@primate/frontend/solid/client/create-root";
import { dependencies, name } from "@primate/frontend/solid/common";
import create_root from "../client/create-root.js";
import { client, server } from "./compile.js";
import prepare from "./prepare.js";
import publish from "./publish.js";
Expand All @@ -13,15 +13,13 @@ export default extension => async (app, next) => {
// compile server
await server_root(app, name, create_root, server);

const compiled = await compile({
app.register(extension, await compile({
app,
extension,
name,
create_root,
compile: { server, client },
});

app.register(extension, compiled);
}));

app.build.plugin(publish(app, extension));
const code = "export { default as spa } from '@primate/frontend/spa';";
Expand Down
3 changes: 3 additions & 0 deletions packages/frontend/src/server/solid/hooks/build/prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import expose from "@primate/frontend/solid/client/expose";

export default app => app.build.export(expose);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import handler from "@primate/frontend/base/handler";
import { name } from "@primate/frontend/solid/common";
import client from "../client/default.js";
import client from "@primate/frontend/solid/client";
import render from "./render.js";

export default (extension, spa) => (app, next) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/solid/common";
import serve from "./serve.js";
import serve from "@primate/frontend/solid/hooks/serve";

export default ({
extension = default_extension,
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/src/server/svelte/client/exports.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/svelte/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/svelte/hooks/build";
import serve from "@primate/frontend/svelte/hooks/serve";

export default ({
extension = default_extension,
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/src/server/svelte/default/prepare.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import compile from "@primate/frontend/base/compile";
import depend from "@primate/frontend/base/depend";
import server_root from "@primate/frontend/base/server-root";
import create_root from "@primate/frontend/svelte/client/create-root";
import { dependencies, name } from "@primate/frontend/svelte/common";
import create_root from "../client/create-root.js";
import { client, server } from "./compile.js";
import prepare from "./prepare.js";
import publish from "./publish.js";
Expand Down
3 changes: 3 additions & 0 deletions packages/frontend/src/server/svelte/hooks/build/prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import expose from "@primate/frontend/svelte/client/expose";

export default app => app.build.export(expose);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import handler from "@primate/frontend/base/handler";
import { name } from "@primate/frontend/svelte/common";
import client from "../client/default.js";
import client from "@primate/frontend/svelte/client";
import render from "./render.js";

export default (extension, spa) => (app, next) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/svelte/common";
import serve from "./serve.js";
import serve from "@primate/frontend/svelte/hooks/serve";

export default ({
extension = default_extension,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/voby/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/voby/hooks/build";
import serve from "@primate/frontend/voby/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/voby/common";
import serve from "./serve.js";
import serve from "@primate/frontend/voby/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/vue/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/vue/hooks/build";
import serve from "@primate/frontend/vue/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/vue/common";
import serve from "./serve.js";
import serve from "@primate/frontend/vue/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { default_extension, name } from "@primate/frontend/webc/common";
import serve from "../runtime/serve.js";
import build from "./build.js";
import build from "@primate/frontend/webc/hooks/build";
import serve from "@primate/frontend/webc/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { default_extension, name } from "@primate/frontend/webc/common";
import serve from "./serve.js";
import serve from "@primate/frontend/webc/hooks/serve";

export default ({ extension = default_extension } = {}) => ({
name: `primate:${name}`,
Expand Down

0 comments on commit 4193aa1

Please sign in to comment.