Skip to content
This repository was archived by the owner on May 19, 2020. It is now read-only.

Commit e767274

Browse files
committed
Update example to remove security warnings.
1 parent 190669d commit e767274

24 files changed

+14110
-9391
lines changed

README.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Library created for follow up corporate standards of application configuration.
1212

1313
```bash
1414
npm install --save @microparts/configuration-js
15-
15+
// or
1616
yarn add @microparts/configuration-js
1717
```
1818

@@ -119,7 +119,7 @@ vue create vue-app
119119
```
120120
2. Install this package
121121
```bash
122-
yarn add @microparts/configuration-js
122+
npm install --save @microparts/configuration-js
123123
```
124124
3. Put config files [like this](./example/vue-app/configuration)
125125
4. Change `vue.config.js` to build final config to global variables:
@@ -142,7 +142,9 @@ module.exports = {
142142
}
143143
};
144144
```
145+
145146
5. Add following code to `index.html` to **top** of `<head>` html tag (**before all scripts**):
147+
146148
```html
147149
<head>
148150
<% if (htmlWebpackPlugin.options.__stage === 'local') { %>
@@ -154,9 +156,20 @@ module.exports = {
154156
<% } %>
155157
<!-- ... meta tags and other code -->
156158
```
157-
6. Run application.
159+
160+
6. Add globals to `.eslintrc`:
161+
162+
```json
163+
"globals": {
164+
"__config": "readonly",
165+
"__stage": "readonly",
166+
"__vcs": "readonly"
167+
},
168+
```
169+
170+
7. Run application.
158171
```bash
159-
yarn serve
172+
npm run serve
160173
```
161174

162175
Full example available at [here](./example/vue-app).

example/vue-app/.browserslistrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
> 1%
22
last 2 versions
3-
not ie <= 8

example/vue-app/.eslintrc.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ module.exports = {
77
'plugin:vue/essential',
88
'@vue/airbnb',
99
],
10+
parserOptions: {
11+
parser: 'babel-eslint',
12+
},
1013
rules: {
1114
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1215
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
1316
},
14-
parserOptions: {
15-
parser: 'babel-eslint',
17+
"globals": {
18+
"__config": "readonly",
19+
"__stage": "readonly",
20+
"__vcs": "readonly"
1621
},
1722
};

example/vue-app/.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
node_modules
33
/dist
44

5-
/tests/e2e/videos/
6-
/tests/e2e/screenshots/
7-
85
# local env files
96
.env.local
107
.env.*.local
@@ -21,4 +18,4 @@ yarn-error.log*
2118
*.ntvs*
2219
*.njsproj
2320
*.sln
24-
*.sw*
21+
*.sw?

example/vue-app/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:11-stretch
1+
FROM node:12-stretch
22
WORKDIR /usr/app
33
COPY . /usr/app
44

@@ -7,7 +7,7 @@ ARG STAGE
77
RUN npm ci --silent \
88
&& npm run build
99

10-
FROM microparts/static-server-php:1.0.2
10+
FROM microparts/static-server-php:2.0.3
1111

1212
COPY --from=0 /usr/app/dist /app
1313
COPY --from=0 /usr/app/configuration /app/configuration

example/vue-app/README.md

+3-18
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,17 @@ yarn install
77

88
### Compiles and hot-reloads for development
99
```
10-
yarn run serve
10+
yarn serve
1111
```
1212

1313
### Compiles and minifies for production
1414
```
15-
yarn run build
16-
```
17-
18-
### Run your tests
19-
```
20-
yarn run test
15+
yarn build
2116
```
2217

2318
### Lints and fixes files
2419
```
25-
yarn run lint
26-
```
27-
28-
### Run your end-to-end tests
29-
```
30-
yarn run test:e2e
31-
```
32-
33-
### Run your unit tests
34-
```
35-
yarn run test:unit
20+
yarn lint
3621
```
3722

3823
### Customize configuration

example/vue-app/babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
presets: [
3-
'@vue/app',
3+
'@vue/cli-plugin-babel/preset',
44
],
55
};
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
defaults:
2-
bar: baz
2+
bar: defaults_bar
3+
some:
4+
foo: defaults_foo
5+
array:
6+
- defaults array
7+
- next item
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
local:
2+
bar: local_bar
23
some:
3-
foo: bar
4+
foo: local_foo
5+
array:
6+
- local array

example/vue-app/cypress.json

-3
This file was deleted.

0 commit comments

Comments
 (0)