@byu-oit/nuxt-common 3.0.2 → 3.0.4-beta.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/README.md +90 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plugins/axios.js +6 -7
- package/dist/plugins/axios.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -2,7 +2,96 @@
|
|
|
2
2
|
|
|
3
3
|
Common packages, plus a small set of plugins, for OIT Vue frontend apps
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---------
|
|
6
|
+
|
|
7
|
+
# NUXT 2 / VUE 2 EOL Updates
|
|
8
|
+
|
|
9
|
+
## One-time setup for your own machine
|
|
10
|
+
|
|
11
|
+
### Get access to HeroDevs npm repository
|
|
12
|
+
|
|
13
|
+
1. Get the Hero Devs access token. There's only one token, shared across the organization.
|
|
14
|
+
It's saved in LastPass in the "Shared-OIT-AppEng-Developer" folder, with the item name "HeroDev".
|
|
15
|
+
|
|
16
|
+
If you do not have access, then request access from Rose Combs.
|
|
17
|
+
|
|
18
|
+
2. Run these two commands to update your system's .npmrc file:
|
|
19
|
+
|
|
20
|
+
`npm set --global @neverendingsupport:registry=https://registry.nes.herodevs.com/npm/pkg/`
|
|
21
|
+
|
|
22
|
+
`npm set --global //registry.nes.herodevs.com/npm/pkg/:_authToken={{HERO DEVS ACCESS TOKEN HERE}}`
|
|
23
|
+
|
|
24
|
+
## Changes For Each Project
|
|
25
|
+
|
|
26
|
+
### Step 1 - Update package.json
|
|
27
|
+
|
|
28
|
+
1. Add the following section to your `package.json` config:
|
|
29
|
+
```json
|
|
30
|
+
"overrides": {
|
|
31
|
+
"nuxt": "npm:@neverendingsupport/nuxt2@2.18.1-nuxt-2.18.6",
|
|
32
|
+
"@nuxt/babel-preset-app": "npm:@neverendingsupport/nuxt2@2.18.1-babel-preset-app-2.18.6",
|
|
33
|
+
"@nuxt/builder": "npm:@neverendingsupport/nuxt2@2.18.1-builder-2.18.6",
|
|
34
|
+
"@nuxt/cli": "npm:@neverendingsupport/nuxt2@2.18.1-cli-2.18.6",
|
|
35
|
+
"@nuxt/components": "npm:@neverendingsupport/nuxt-components@2.2.1-nuxt-components-2.2.2",
|
|
36
|
+
"@nuxt/config": "npm:@neverendingsupport/nuxt2@2.18.1-config-2.18.6",
|
|
37
|
+
"@nuxt/core": "npm:@neverendingsupport/nuxt2@2.18.1-core-2.18.6",
|
|
38
|
+
"@nuxt/generator": "npm:@neverendingsupport/nuxt2@2.18.1-generator-2.18.6",
|
|
39
|
+
"@nuxt/loading-screen": "npm:@neverendingsupport/nuxt-loading-screen@2.0.4-nuxt-loading-screen-2.0.5",
|
|
40
|
+
"@nuxt/nuxt-start": "npm:@neverendingsupport/nuxt2@2.18.1-nuxt-start-2.18.6",
|
|
41
|
+
"@nuxt/server": "npm:@neverendingsupport/nuxt2@2.18.1-server-2.18.6",
|
|
42
|
+
"@nuxt/telemetry": "npm:@neverendingsupport/nuxt-telemetry@1.5.0-nuxt-telemetry-1.5.2",
|
|
43
|
+
"@nuxt/types": "npm:@neverendingsupport/nuxt2@2.18.1-types-2.18.6",
|
|
44
|
+
"@nuxt/utils": "npm:@neverendingsupport/nuxt2@2.18.1-utils-2.18.6",
|
|
45
|
+
"@nuxt/vue-app": "npm:@neverendingsupport/nuxt2@2.18.1-vue-app-2.18.6",
|
|
46
|
+
"@nuxt/vue-renderer": "npm:@neverendingsupport/nuxt2@2.18.1-vue-renderer-2.18.6",
|
|
47
|
+
"@nuxt/webpack": "npm:@neverendingsupport/nuxt2@2.18.1-webpack-2.18.6",
|
|
48
|
+
"@nuxtjs/youch": "npm:@neverendingsupport/nuxt-youch@4.2.3-nuxtjs-youch-4.2.5",
|
|
49
|
+
"nuxt-start": "npm:@neverendingsupport/nuxt2@2.18.1-nuxt-start-2.18.6",
|
|
50
|
+
"vue": "npm:@neverendingsupport/vue2@2.7.22",
|
|
51
|
+
"vuetify": "npm:@neverendingsupport/vuetify@2.7.2-vuetify-2.7.4",
|
|
52
|
+
"vue-server-renderer": "npm:@neverendingsupport/vue2@2.7.22-server-renderer",
|
|
53
|
+
"vue-template-compiler": "npm:@neverendingsupport/vue2@2.7.22-template-compiler",
|
|
54
|
+
"@vue/compiler-sfc": "npm:@neverendingsupport/vue2@2.7.22-compiler-sfc",
|
|
55
|
+
"vuex": "npm:@neverendingsupport/vuex@3.7.0",
|
|
56
|
+
"vue-router": "npm:@neverendingsupport/vue-router@3.6.6",
|
|
57
|
+
"serialize-javascript": "^6.0.2"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. If you have `@byu-oit/nuxt-common` in your `dependencies`, then bump its version to `3.0.2`. If you are directly importing Nuxt and/or Vue, then skip to the next step.
|
|
62
|
+
```json
|
|
63
|
+
"dependencies": {
|
|
64
|
+
[ ... ]
|
|
65
|
+
"@byu-oit/nuxt-common": "3.0.2",
|
|
66
|
+
[ ... ]
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
3. Before running `npm install`, visually inspect your `package.json` to see if you have any of the overridden packages already listed in
|
|
71
|
+
`dependencies`, `devDependencies`, and/or `peerDependencies`. If so, then copy the version numbers **from** the `overrides` entries **into** the existing dependency entries.
|
|
72
|
+
|
|
73
|
+
4. Run `npm install`. If you missed a direct dependency (previous step), then `npm install` will fail with the message
|
|
74
|
+
`Override for [package name] conflicts with direct dependency`. If you get that message, then copy the version number **from** the `overrides` entry **into** the existing dependency entry, and run `npm install` again.
|
|
75
|
+
|
|
76
|
+
That *should* be everything required for local testing. Run your code and make sure everything works.
|
|
77
|
+
|
|
78
|
+
### Step 2 - Github Actions updates
|
|
79
|
+
|
|
80
|
+
Everywhere in your `.github/workflows` files where you set up Node (most commonly via `uses: actions/setup-node`), add the following step immediately after setup but before any `npm` commands:
|
|
81
|
+
```yaml
|
|
82
|
+
- name: HeroDevs
|
|
83
|
+
run: |
|
|
84
|
+
npm set --global @neverendingsupport:registry=https://registry.nes.herodevs.com/npm/pkg/ && \
|
|
85
|
+
npm set --global //registry.nes.herodevs.com/npm/pkg/:_authToken=${{secrets.HERO_DEVS_ACCESS_TOKEN}}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
That `HERO_DEVS_ACCESS_TOKEN` secret is already set for the whole `byu-oit` Github organization, so no need to individually set it up for your project.
|
|
89
|
+
|
|
90
|
+
# ( -- end of Nuxt 2 EOL instructions -- )
|
|
91
|
+
|
|
92
|
+
---------
|
|
93
|
+
|
|
94
|
+
# Initial installation of this package
|
|
6
95
|
|
|
7
96
|
This package uses Nuxt 2, which has some... quirks when used with Node 18 or above.
|
|
8
97
|
To get a clean installation, you *must* use the `--legacy-peer-deps` flag for the *initial* installation:
|
package/dist/index.d.ts
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,aAAa;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,aAAa;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AA+BtC,MAAM,gBAAgB,GAAW,KAAK,WAAW,aAAa;IAC5D,MAAM,eAAe,GAAG,CAAC,aAAa,IAAI,aAAa,CAAC,eAAe,CAAC,IAAI,EAAE,CAAA;IAC9E,MAAM,eAAe,GAAG,CAAC,aAAa,IAAI,aAAa,CAAC,eAAe,CAAC,IAAI,EAAE,CAAA;IAC9E,MAAM,oBAAoB,GAAG,CAAC,aAAa,IAAI,aAAa,CAAC,oBAAoB,C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,MAAM,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;AACzC,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA;AAE/B,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA"}
|
package/dist/plugins/axios.js
CHANGED
|
@@ -6,11 +6,7 @@ let refreshDialogVisible = false;
|
|
|
6
6
|
const errorMessages = [];
|
|
7
7
|
export default (context) => {
|
|
8
8
|
context.$axios.onResponseError((error) => {
|
|
9
|
-
if (
|
|
10
|
-
// Explicit cancellation, so do not show "error" message
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (error.config && error.response?.status === 401) {
|
|
9
|
+
if (error?.config && error.response?.status === 401) {
|
|
14
10
|
// @ts-ignore Internal var added to config, so we can tell if this is a second automated attempt
|
|
15
11
|
if (!error.config.insideRetry) {
|
|
16
12
|
return retryWithRefreshedToken(error);
|
|
@@ -35,7 +31,10 @@ export default (context) => {
|
|
|
35
31
|
// Caller has declared that it will handle unknown errors instead of using auto-popup
|
|
36
32
|
return;
|
|
37
33
|
}
|
|
38
|
-
|
|
34
|
+
if (!axios.isCancel(error)) {
|
|
35
|
+
// Do not show error message if this was an explicit cancellation
|
|
36
|
+
context.$axios.defaultErrorPopup(error);
|
|
37
|
+
}
|
|
39
38
|
});
|
|
40
39
|
context.$axios.defaultErrorPopup = (error) => {
|
|
41
40
|
const text = get(error, 'response.data.errorMessage') ||
|
|
@@ -65,7 +64,7 @@ export default (context) => {
|
|
|
65
64
|
}
|
|
66
65
|
return refreshPromise.then((tokenInfo) => {
|
|
67
66
|
const config = Object.assign({ insideRetry: true }, error.config);
|
|
68
|
-
if (tokenInfo?.state === authn.STATE_AUTHENTICATED && tokenInfo.token?.authorizationHeader) {
|
|
67
|
+
if (tokenInfo?.state === authn.STATE_AUTHENTICATED && tokenInfo.token?.authorizationHeader && config.headers) {
|
|
69
68
|
config.headers.Authorization = tokenInfo.token.authorizationHeader;
|
|
70
69
|
}
|
|
71
70
|
return context.$axios.request(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios.js","sourceRoot":"","sources":["../../src/plugins/axios.ts"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAA;AAE9C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,IAAI,oBAAoB,GAAG,KAAK,CAAA;AAChC,MAAM,aAAa,GAAa,EAAE,CAAA;AAElC,eAAe,CAAC,OAAgB,EAAE,EAAE;IAClC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"axios.js","sourceRoot":"","sources":["../../src/plugins/axios.ts"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAA;AAE9C,aAAa;AACb,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,IAAI,oBAAoB,GAAG,KAAK,CAAA;AAChC,MAAM,aAAa,GAAa,EAAE,CAAA;AAElC,eAAe,CAAC,OAAgB,EAAE,EAAE;IAClC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,EAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE;YACnD,gGAAgG;YAChG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE;gBAC7B,OAAO,uBAAuB,CAAC,KAAK,CAAC,CAAA;aACtC;YACD,yEAAyE;YACzE,mDAAmD;YACnD,IAAI,CAAC,oBAAoB,EAAE;gBACzB,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,KAAK,CAAA;gBACpD,oBAAoB,GAAG,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,CAAC,IAAI,CAAC,GAAG,EAAE;gBACrE,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;gBACzC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;oBAChB,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;iBAC/B;YACH,CAAC,CAAC,CAAA;SACH;IACH,CAAC,CAAA;IAED,IAAI,cAAc,GAAQ,IAAI,CAAA;IAC9B,SAAS,uBAAuB,CAAC,KAAsB;QACrD,IAAI,CAAC,cAAc,EAAE;YACnB,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,CAAA;SAChF;QACD,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,SAAc,EAAE,EAAE;YAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;YACjE,IAAI,SAAS,EAAE,KAAK,KAAK,KAAK,CAAC,mBAAmB,IAAI,SAAS,CAAC,KAAK,EAAE,mBAAmB,IAAI,MAAM,CAAC,OAAO,EAAE;gBAC5G,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAA;aACnE;YACD,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACvC,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byu-oit/nuxt-common",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4-beta.0",
|
|
4
4
|
"description": "BYU Front End common module for Nuxt.js",
|
|
5
5
|
"author": "BYU Apps Custom",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"eslint-plugin-vue": "~9.9.0",
|
|
76
76
|
"eslint-plugin-vuetify": "~1.1.0",
|
|
77
77
|
"flush-promises": "~1.0.2",
|
|
78
|
+
"form-data": "^3.0.4",
|
|
78
79
|
"husky": "~8.0.3",
|
|
79
80
|
"lodash": "~4.17.21",
|
|
80
81
|
"lru-cache": "~7.14.1",
|
|
@@ -115,6 +116,9 @@
|
|
|
115
116
|
"@nuxt/vue-app": "npm:@neverendingsupport/nuxt2@2.18.1-vue-app-2.18.6",
|
|
116
117
|
"@nuxt/vue-renderer": "npm:@neverendingsupport/nuxt2@2.18.1-vue-renderer-2.18.6",
|
|
117
118
|
"@nuxt/webpack": "npm:@neverendingsupport/nuxt2@2.18.1-webpack-2.18.6",
|
|
119
|
+
"@nuxtjs/axios": {
|
|
120
|
+
"axios": "0.28.0"
|
|
121
|
+
},
|
|
118
122
|
"@nuxtjs/youch": "npm:@neverendingsupport/nuxt-youch@4.2.3-nuxtjs-youch-4.2.5",
|
|
119
123
|
"nuxt-start": "npm:@neverendingsupport/nuxt2@2.18.1-nuxt-start-2.18.6",
|
|
120
124
|
"vue": "npm:@neverendingsupport/vue2@2.7.22",
|