oc-template-vue-compiler 0.0.1 → 0.0.3
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.
|
@@ -1,51 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function vueOCProviderTemplate({ viewPath }) {
|
|
3
|
+
function vueOCProviderTemplate({ viewPath, providerFunctions }) {
|
|
4
4
|
return `
|
|
5
5
|
import { createApp } from 'vue'
|
|
6
6
|
import View from '${viewPath}';
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
version: providerProps._componentVersion,
|
|
12
|
-
baseUrl: providerProps._baseUrl,
|
|
13
|
-
parameters
|
|
14
|
-
}, (err, data) => {
|
|
15
|
-
if (err) {
|
|
16
|
-
return cb(err);
|
|
17
|
-
}
|
|
18
|
-
const { _staticPath, _baseUrl, _componentName, _componentVersion, ...rest } = data.component.props;
|
|
19
|
-
cb(null, rest, data.component.props);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
8
|
+
function renderer(props, element, ssr) {
|
|
9
|
+
const { _staticPath, _baseUrl, _componentName, _componentVersion, ...rest } = props;
|
|
10
|
+
${providerFunctions}
|
|
22
11
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
version: providerProps._componentVersion,
|
|
27
|
-
baseUrl: providerProps._baseUrl,
|
|
28
|
-
staticPath: providerProps._staticPath
|
|
29
|
-
};
|
|
30
|
-
return settingHash[setting];
|
|
12
|
+
rest.getData = getData;
|
|
13
|
+
rest.getSetting = getSetting;
|
|
14
|
+
createApp(View, rest).mount(element, ssr);
|
|
31
15
|
}
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
function renderer(props, element, ssr) {
|
|
35
|
-
function getData(params) {
|
|
36
|
-
return new Promise((resolve, reject) => {
|
|
37
|
-
getDataCb(props, params, (err, data) => {
|
|
38
|
-
if (err) {
|
|
39
|
-
return reject(err);
|
|
40
|
-
}
|
|
41
|
-
resolve(data);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
props.getData = getData;
|
|
46
|
-
props.getSetting = (setting) => getSetting(props, setting);
|
|
47
|
-
createApp(View, props).mount(element, ssr);
|
|
48
|
-
}
|
|
17
|
+
renderer.component = View;
|
|
49
18
|
|
|
50
19
|
export default renderer;
|
|
51
20
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-template-vue-compiler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Compiler for the vueJS OC template",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@vitejs/plugin-vue": "^4.5.2",
|
|
33
|
-
"oc-template-vue": "^0.0.
|
|
34
|
-
"oc-vite-compiler": "^3.
|
|
33
|
+
"oc-template-vue": "^0.0.2",
|
|
34
|
+
"oc-vite-compiler": "^3.4.0"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist/**",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
defineProps<{ msg: string }>()
|
|
5
|
-
|
|
6
|
-
const count = ref(0)
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<h1>{{ msg }}</h1>
|
|
11
|
-
|
|
12
|
-
<div class="card">
|
|
13
|
-
<button type="button" @click="count++">count is {{ count }}</button>
|
|
14
|
-
<p>
|
|
15
|
-
Edit
|
|
16
|
-
<code>components/HelloWorld.vue</code> to test HMR
|
|
17
|
-
</p>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<p>
|
|
21
|
-
Check out
|
|
22
|
-
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
|
|
23
|
-
>create-vue</a
|
|
24
|
-
>, the official Vue + Vite starter
|
|
25
|
-
</p>
|
|
26
|
-
<p>
|
|
27
|
-
Install
|
|
28
|
-
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
|
|
29
|
-
in your IDE for a better DX
|
|
30
|
-
</p>
|
|
31
|
-
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<style scoped>
|
|
35
|
-
.read-the-docs {
|
|
36
|
-
color: #888;
|
|
37
|
-
}
|
|
38
|
-
</style>
|