oc-template-elm-compiler 0.2.2 → 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.
@@ -6,7 +6,7 @@ function elmEntry({ viewPath, providerFunctions }) {
6
6
  return `
7
7
  import { Elm } from '${viewPath}';
8
8
 
9
- export default function renderer(props, node) {
9
+ function renderer(props, node) {
10
10
  const { _baseUrl, _componentName, _componentVersion, _staticPath, ...rest } = props;
11
11
  const app = Elm["${extractName(viewPath)}"].init({
12
12
  node,
@@ -30,6 +30,10 @@ function elmEntry({ viewPath, providerFunctions }) {
30
30
 
31
31
  return app;
32
32
  }
33
+
34
+ renderer.component = Elm["${extractName(viewPath)}"];
35
+
36
+ export default renderer;
33
37
  `;
34
38
  }
35
39
  function jsEntry({ viewPath, providerFunctions }) {
@@ -40,7 +44,7 @@ function jsEntry({ viewPath, providerFunctions }) {
40
44
  if (!program) throw new Error('Missing program in config');
41
45
  if (!program.init) throw new Error('Program does not look like an elm instance (missing init)');
42
46
 
43
- export default function renderer(props, node) {
47
+ function renderer(props, node) {
44
48
  const { _baseUrl, _componentName, _componentVersion, _staticPath, ...rest } = props;
45
49
  const app = program.init({
46
50
  node,
@@ -66,6 +70,10 @@ function jsEntry({ viewPath, providerFunctions }) {
66
70
 
67
71
  return app;
68
72
  }
73
+
74
+ renderer.component = program;
75
+
76
+ export default renderer;
69
77
  `;
70
78
  }
71
79
  function elmOCProviderTemplate({ viewPath, providerFunctions }) {
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "oc-template-elm-compiler",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Compiler for the Elm OC template",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
- "prepare": "npm run build",
10
9
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
11
10
  },
12
11
  "repository": {
@@ -30,8 +29,8 @@
30
29
  "license": "MIT",
31
30
  "dependencies": {
32
31
  "elm": "^0.19.1-6",
33
- "oc-template-elm": "^0.1.0",
34
- "oc-vite-compiler": "^3.3.0",
32
+ "oc-template-elm": "0.1.1",
33
+ "oc-vite-compiler": "^3.5.0",
35
34
  "vite-plugin-elm": "^2.8.0"
36
35
  },
37
36
  "files": [