@soleil-se/app-util 1.0.4 → 1.0.6
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/README.md +4 -0
- package/package.json +1 -4
- package/src/index.js +2 -0
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Get HTML for rendering a Vue application.
|
|
|
17
17
|
| data | `Object` | | Data that will be available in `$options`. |
|
|
18
18
|
| [noScript] | `String` | `''` | HTML that will be printed when JavaScript is not available. |
|
|
19
19
|
|
|
20
|
+
#### Example
|
|
20
21
|
```javascript
|
|
21
22
|
router.get('/', (req, res) => {
|
|
22
23
|
res.send(renderVue('AppName', data, noScript));
|
|
@@ -31,6 +32,7 @@ Get URI for a route.
|
|
|
31
32
|
| --- | --- | --- |
|
|
32
33
|
| route | `String` | A route. |
|
|
33
34
|
|
|
35
|
+
#### Example
|
|
34
36
|
```javascript
|
|
35
37
|
const routeUri = getRouteUri('/my-route');
|
|
36
38
|
```
|
|
@@ -43,6 +45,7 @@ Get URI for a resource.
|
|
|
43
45
|
| --- | --- | --- |
|
|
44
46
|
| resource | `String` | A resource. |
|
|
45
47
|
|
|
48
|
+
#### Example
|
|
46
49
|
```javascript
|
|
47
50
|
const resourceUri = getResourceUri('file/in/resource.png');
|
|
48
51
|
```
|
|
@@ -56,6 +59,7 @@ Renders a Underscore template and returns a string.
|
|
|
56
59
|
| template | `String` | | Underscore template. |
|
|
57
60
|
| [values] | `Object` | `{}` | Values. |
|
|
58
61
|
|
|
62
|
+
#### Example
|
|
59
63
|
```javascript
|
|
60
64
|
const string = renderTemplate('<div><%= foo %></div>', {
|
|
61
65
|
foo: 'bar',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/app-util",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "Soleil AB",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "npx buble ./src/index.js --output ./dist/index.js --no modules --objectAssign=Object.assign"
|
|
11
11
|
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"underscore": "^1.9.1"
|
|
14
|
-
},
|
|
15
12
|
"dependencies": {},
|
|
16
13
|
"devDependencies": {}
|
|
17
14
|
}
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import PropertyUtil from 'PropertyUtil';
|
|
|
2
2
|
import PortletContextUtil from 'PortletContextUtil';
|
|
3
3
|
import VersionUtil from 'VersionUtil';
|
|
4
4
|
import app from 'app';
|
|
5
|
+
/* Underscore is provided by SiteVision */
|
|
6
|
+
/* eslint-disable-next-line import/no-extraneous-dependencies */
|
|
5
7
|
import _ from 'underscore';
|
|
6
8
|
|
|
7
9
|
/** If the webapp is running in offline mode or not. */
|