Skip to content

Commit

Permalink
create @primate/marko
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Aug 4, 2024
1 parent 90986f4 commit 7f50ab7
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 35 deletions.
16 changes: 4 additions & 12 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@
"@angular/platform-server": "18",
"@angular/ssr": "18",
"@babel/core": "7",
"@marko/compiler": "5",
"@marko/translator-default": "6",
"babel-preset-solid": "1",
"eta": "3",
"handlebars": "4",
"htmx-esm": "0.2",
"linkedom-global": "1",
"marked": "13",
"marko": "5",
"primate": "workspace:^",
"react": "18",
"react-dom": "18",
Expand Down Expand Up @@ -67,12 +64,6 @@
"@babel/core": {
"optional": true
},
"@marko/compiler": {
"optional": true
},
"@marko/translator-default": {
"optional": true
},
"babel-preset-solid": {
"optional": true
},
Expand All @@ -91,9 +82,6 @@
"marked": {
"optional": true
},
"marko": {
"optional": true
},
"react": {
"optional": true
},
Expand Down Expand Up @@ -178,6 +166,10 @@
"./*/context/app": "./src/server/*/context/app.js",
"./*/context/head": "./src/server/*/context/head.js",
"./webc/Component": "./src/server/webc/public/Component.js",
"./core/*": {
"@primate/lt": "./src/private/*.js",
"default": "./src/private/*.js"
},
"./*": {
"runtime": "./src/server/*/public/runtime.js",
"default": "./src/server/*/public/default.js"
Expand Down
1 change: 0 additions & 1 deletion packages/frontend/src/server/marko/dependencies.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/frontend/src/server/marko/name.js

This file was deleted.

10 changes: 0 additions & 10 deletions packages/frontend/src/server/marko/public/default.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/frontend/src/server/marko/public/runtime.js

This file was deleted.

46 changes: 46 additions & 0 deletions packages/marko/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "@primate/marko",
"version": "0.1.0",
"description": "Primate Marko frontend",
"bugs": "https://github.com/primatejs/primate/issues",
"license": "MIT",
"files": [
"src/**/*.js",
"!src/**/*.spec.js"
],
"repository": {
"type": "git",
"url": "https://github.com/primatejs/primate",
"directory": "packages/marko"
},
"dependencies": {
"@primate/core": "workspace:^"
},
"peerDependencies": {
"@marko/compiler": "5",
"@marko/translator-default": "6",
"marko": "5",
"primate": "workspace:^"
},
"type": "module",
"imports": {
"#*": {
"@primate/lt": "./src/private/*.js",
"default": "./src/private/*.js"
},
"#build": {
"@primate/lt": "./src/private/build/index.js",
"default": "./src/private/build/index.js"
},
"#serve": {
"@primate/lt": "./src/private/serve/index.js",
"default": "./src/private/serve/index.js"
}
},
"exports": {
".": {
"runtime": "./src/public/runtime.js",
"default": "./src/public/default.js"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import compile from "#compile";
import name from "#marko/name";
import name from "#name";
import compile from "@primate/frontend/core/compile";
import server from "./server.js";

export default extension => async (app, next) => {
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/marko/src/private/name.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "@primate/marko";
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import serve from "#serve";
import serve from "@primate/frontend/core/serve";
import render from "./render.js";

export default serve({ render });
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/marko/src/public/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import build from "#build";
import default_extension from "#extension";
import name from "#name";
import serve from "#serve";

export default ({ extension = default_extension } = {}) => ({
name,
build: build(extension),
serve: serve(extension),
});
8 changes: 8 additions & 0 deletions packages/marko/src/public/runtime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import default_extension from "#extension";
import name from "#name";
import serve from "#serve";

export default ({ extension = default_extension } = {}) => ({
name,
serve: serve(extension),
});
3 changes: 3 additions & 0 deletions packages/marko/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.base.json"
}

0 comments on commit 7f50ab7

Please sign in to comment.