@primate/eta 0.1.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/private/Default.d.ts +7 -0
- package/lib/private/Default.js +16 -0
- package/lib/private/Runtime.d.ts +8 -0
- package/lib/private/Runtime.js +8 -0
- package/lib/public/default.d.ts +4 -0
- package/lib/public/default.js +3 -0
- package/lib/public/runtime.d.ts +4 -0
- package/lib/public/runtime.js +3 -0
- package/package.json +20 -21
- package/src/private/build/index.js +0 -18
- package/src/private/build/server.js +0 -12
- package/src/private/extension.js +0 -1
- package/src/private/name.js +0 -1
- package/src/private/pkgname.js +0 -1
- package/src/private/serve/index.js +0 -3
- package/src/public/default.js +0 -10
- package/src/public/runtime.js +0 -8
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Runtime from "#Runtime";
|
|
2
|
+
import { Eta } from "eta";
|
|
3
|
+
const eta = new Eta();
|
|
4
|
+
export default class Default extends Runtime {
|
|
5
|
+
compile = {
|
|
6
|
+
server: (text) => `
|
|
7
|
+
import { Eta } from "eta";
|
|
8
|
+
const eta = new Eta();
|
|
9
|
+
|
|
10
|
+
${eta.compile(text).toString()}
|
|
11
|
+
|
|
12
|
+
export default (props, options) => anonymous.call(eta, props, options);
|
|
13
|
+
`,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Default.js.map
|
package/package.json
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primate/eta",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Primate Eta frontend",
|
|
5
|
-
"homepage": "https://
|
|
6
|
-
"bugs": "https://github.com/
|
|
5
|
+
"homepage": "https://primate.run/docs/frontend/eta",
|
|
6
|
+
"bugs": "https://github.com/primate-run/primate/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"files": [
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"/lib/**/*.js",
|
|
10
|
+
"/lib/**/*.d.ts",
|
|
11
|
+
"!/**/*.spec.*"
|
|
11
12
|
],
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/primate-run/primate",
|
|
15
16
|
"directory": "packages/eta"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@
|
|
19
|
+
"@rcompat/assert": "^0.3.1",
|
|
20
|
+
"eta": "^3.5.0",
|
|
21
|
+
"@primate/core": "^0.3.0"
|
|
19
22
|
},
|
|
20
23
|
"peerDependencies": {
|
|
21
|
-
"
|
|
22
|
-
"primate": "^0.32.5"
|
|
24
|
+
"primate": "^0.34.0"
|
|
23
25
|
},
|
|
24
26
|
"type": "module",
|
|
25
27
|
"imports": {
|
|
26
28
|
"#*": {
|
|
27
|
-
"
|
|
28
|
-
"default": "./
|
|
29
|
-
},
|
|
30
|
-
"#build": {
|
|
31
|
-
"livetypes": "./src/private/build/index.js",
|
|
32
|
-
"default": "./src/private/build/index.js"
|
|
33
|
-
},
|
|
34
|
-
"#serve": {
|
|
35
|
-
"livetypes": "./src/private/serve/index.js",
|
|
36
|
-
"default": "./src/private/serve/index.js"
|
|
29
|
+
"apekit": "./src/private/*.ts",
|
|
30
|
+
"default": "./lib/private/*.js"
|
|
37
31
|
}
|
|
38
32
|
},
|
|
39
33
|
"exports": {
|
|
40
34
|
".": {
|
|
41
|
-
"runtime": "./
|
|
42
|
-
"default": "./
|
|
35
|
+
"runtime": "./lib/public/runtime.js",
|
|
36
|
+
"default": "./lib/public/default.js"
|
|
43
37
|
}
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "npm run clean && tsc",
|
|
41
|
+
"clean": "rm -rf ./lib",
|
|
42
|
+
"lint": "eslint ."
|
|
44
43
|
}
|
|
45
44
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import name from "#name";
|
|
2
|
-
import compile from "@primate/frontend/core/compile";
|
|
3
|
-
import server from "./server.js";
|
|
4
|
-
|
|
5
|
-
export default extension => async (app, next) => {
|
|
6
|
-
app.register(extension, {
|
|
7
|
-
...await compile({
|
|
8
|
-
app,
|
|
9
|
-
extension,
|
|
10
|
-
name,
|
|
11
|
-
compile: { server },
|
|
12
|
-
}),
|
|
13
|
-
// no support for hydration
|
|
14
|
-
client: _ => _,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return next(app);
|
|
18
|
-
};
|
package/src/private/extension.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ".eta";
|
package/src/private/name.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default "eta";
|
package/src/private/pkgname.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default "@primate/eta";
|
package/src/public/default.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import build from "#build";
|
|
2
|
-
import default_extension from "#extension";
|
|
3
|
-
import pkgname from "#pkgname";
|
|
4
|
-
import serve from "#serve";
|
|
5
|
-
|
|
6
|
-
export default ({ extension = default_extension } = {}) => ({
|
|
7
|
-
name: pkgname,
|
|
8
|
-
build: build(extension),
|
|
9
|
-
serve: serve(extension),
|
|
10
|
-
});
|