@bildvitta/quasar-app-extension-asteroid 2.17.0 → 3.0.0-alpha.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.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-app-extension-asteroid",
3
- "version": "2.17.0",
4
- "description": "A Quasar App Extension",
5
- "author": "Inovação Bild & Vitta <inova@bild.com.br>",
3
+ "description": "Asteroid",
4
+ "version": "3.0.0-alpha.3",
5
+ "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "publishConfig": {
@@ -23,12 +23,13 @@
23
23
  },
24
24
  "bugs": "https://github.com/bildvitta/asteroid/issues",
25
25
  "homepage": "",
26
- "dependencies": {
27
- "@bildvitta/quasar-ui-asteroid": "latest"
28
- },
29
26
  "engines": {
30
27
  "node": ">= 8.9.0",
31
28
  "npm": ">= 5.6.0",
32
29
  "yarn": ">= 1.6.0"
30
+ },
31
+ "dependencies": {
32
+ "@bildvitta/quasar-ui-asteroid": "3.0.0-alpha.2",
33
+ "humps": "^2.0.1"
33
34
  }
34
35
  }
package/src/boot/api.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import { camelizeKeys, decamelizeKeys } from 'humps'
2
2
 
3
- export default async ({ Vue }) => {
4
- const api = Vue.prototype.$axios
5
- const environment = Vue.prototype.$environment
3
+ export default async ({ app }) => {
4
+ const api = app.config.globalProperties.$axios
6
5
 
7
6
  // Defaults
8
- api.defaults.baseURL = process.env.SERVER_BASE_URL || (environment ? environment.serverBaseURL : '/')
7
+ api.defaults.baseURL = process.env.SERVER_BASE_URL || '/'
9
8
  api.defaults.timeout = process.env.SERVER_TIMEOUT || 10000
10
9
 
11
10
  // Transformers
@@ -22,7 +21,7 @@ export default async ({ Vue }) => {
22
21
  if (data instanceof FormData) {
23
22
  return data
24
23
  }
25
-
24
+
26
25
  return decamelizeKeys(data, (key, convert, options) =>
27
26
  /^\D+$/.test(key) ? convert(key, options) : key
28
27
  )
@@ -1,12 +1,8 @@
1
- import { handleHistory } from '@bildvitta/quasar-ui-asteroid/src/helpers/historyHandler'
1
+ import { addRoute } from '@bildvitta/quasar-ui-asteroid/src/store/history'
2
2
 
3
- export default async ({ Vue, router }) => {
4
- Vue.prototype.$history = []
5
- const history = handleHistory()
6
-
7
- router.beforeEach(async (to, from, next) => {
8
- Vue.prototype.$history.unshift(from)
9
- history.push(to)
3
+ export default ({ router }) => {
4
+ router.beforeEach((to, from, next) => {
5
+ addRoute(to)
10
6
  next()
11
7
  })
12
8
  }
@@ -1,4 +1,8 @@
1
- import Vue from 'vue'
2
- import VuePlugin from '@bildvitta/quasar-ui-asteroid'
1
+ // TODO: Rever uso do build
2
+ // import VuePlugin from '@bildvitta/quasar-ui-asteroid/dist/asteroid.esm.js'
3
3
 
4
- Vue.use(VuePlugin)
4
+ import VuePlugin from '@bildvitta/quasar-ui-asteroid/src/index.esm.js'
5
+
6
+ export default ({ app }) => {
7
+ app.use(VuePlugin)
8
+ }
package/src/index.js CHANGED
@@ -1,32 +1,21 @@
1
- /**
2
- * Quasar App Extension index/runner script
3
- * (runs on each dev/build)
4
- *
5
- * Docs: https://quasar.dev/app-extensions/development-guide/index-api
6
- * API: https://github.com/quasarframework/quasar/blob/master/app/lib/app-extension/IndexAPI.js
7
- */
8
-
9
1
  const sourcePath = '~@bildvitta/quasar-app-extension-asteroid/src/'
10
2
  const resolve = (...paths) => paths.map(path => sourcePath + path)
11
3
 
12
4
  function extendQuasar (quasar) {
13
5
  // Boot
14
- quasar.boot.push(
15
- ...resolve(
16
- 'boot/register.js',
17
- 'boot/environment.js',
18
- 'boot/api.js',
19
- 'boot/error-pages.js',
20
- 'boot/force-https.js',
21
- 'boot/history.js',
22
- 'boot/router.js',
23
- 'boot/store.js'
24
- )
25
- )
6
+ quasar.boot.push(...resolve(
7
+ 'boot/api.js',
8
+ 'boot/register.js',
9
+ 'boot/history.js'
10
+ ))
26
11
 
27
12
  // Transpile!
28
13
  quasar.build.transpileDependencies.push(/quasar-app-extension-asteroid[\\/]src/)
29
14
 
15
+ // Preserve whitespaces!
16
+ // https://github.com/vuejs/core/pull/1600
17
+ quasar.build.vueLoaderOptions.whitespace = 'preserve'
18
+
30
19
  quasar.css.push(...resolve('index.scss'))
31
20
 
32
21
  const plugins = [
@@ -35,7 +24,7 @@ function extendQuasar (quasar) {
35
24
  'Notify'
36
25
  ]
37
26
 
38
- // Add all required quasar plugins
27
+ // Add all required Quasar plugins
39
28
  plugins.forEach(plugin => quasar.framework.plugins.push(plugin))
40
29
 
41
30
  // Settings
@@ -44,12 +33,12 @@ function extendQuasar (quasar) {
44
33
  )
45
34
 
46
35
  quasar.framework.iconSet = 'material-icons-outlined'
47
- quasar.framework.lang = 'pt-br'
36
+ quasar.framework.lang = 'pt-BR'
48
37
  }
49
38
 
50
39
  module.exports = function (api) {
51
- api.compatibleWith('quasar', '^1.1.1')
52
- api.compatibleWith('@quasar/app', '^1.1.0 || ^2.0.0')
40
+ api.compatibleWith('quasar', '^2.0.0')
41
+ api.compatibleWith('@quasar/app', '^3.0.0')
53
42
 
54
43
  api.extendQuasarConf(extendQuasar)
55
44
 
@@ -59,8 +48,7 @@ module.exports = function (api) {
59
48
  webpack.resolve.alias = {
60
49
  ...webpack.resolve.alias,
61
50
 
62
- asteroid: api.resolve.app(asteroid),
63
- extensions: api.resolve.app('quasar.extensions.json')
51
+ asteroid: api.resolve.app(asteroid)
64
52
  }
65
53
  })
66
54
  }
package/src/index.scss CHANGED
@@ -1 +1 @@
1
- @import '~@bildvitta/quasar-ui-asteroid/src/index.scss';
1
+ @import '~@bildvitta/quasar-ui-asteroid/src/index';
package/README.md DELETED
@@ -1,117 +0,0 @@
1
- <img src="https://img.shields.io/npm/v/@bildvitta/quasar-ui-asteroid.svg?label=quasar-ui-asteroid">
2
- <img src="https://img.shields.io/npm/v/@bildvitta/quasar-app-extension-asteroid.svg?label=quasar-app-extension-asteroid">
3
-
4
- # Asteroid
5
- This `App Extension` contains methods, components and styles that will assist in building a C.R.U.D. using *Vue* and *Quasar*. It was initially designed to be used in accordance with [our API] standards (http://github.com/bildvitta/api), but can be adapted to any _back-end_ as long as it maintains the original standards.
6
-
7
- Note: Some Quasar components must be imported manually inside [quasar.config.js](https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework) (e.g., when you are using `QasFormView` you have to import [QPage](https://quasar.dev/layout/page#Introduction)).
8
-
9
-
10
- ## Structure
11
- * [/app-extension](app-extension) - Quasar app extension
12
- * [/ui](ui) - standalone npm package
13
-
14
- ## Environment variables
15
-
16
- | Variables | Description |
17
- |:-|:-|
18
- | `BUCKET_URL` | Hosting address of _assets_. |
19
- | `SERVER_BASE_URL` | Base server access address. |
20
-
21
- ## Instalation
22
-
23
- ```
24
- $ quasar ext add @bildvitta/asteroid
25
- ```
26
-
27
- ## Usage
28
- After the installation the app-extension is ready to be used, check [here](https://asteroid-og52m.ondigitalocean.app) the documentation.
29
-
30
- ## Develop usage
31
- ```
32
- $ git clone https://github.com/bildvitta/asteroid
33
- ```
34
-
35
- In `root` folder:
36
- ```
37
- $ npm i
38
- ```
39
-
40
- Go to `/app-extension` folder:
41
- ```
42
- $ npm i
43
- $ npm link
44
- ```
45
-
46
- Now go to `/ui` folder:
47
- ```
48
- $ npm i
49
- $ npm link
50
- ```
51
-
52
- You have linked your app-extension and ui folder, go to the project that you are using `asteroid` and link them.
53
- Inside your project:
54
-
55
- ```
56
- $ npm link @bildvitta/quasar-app-extension-asteroid
57
- $ npm link @bildvitta/quasar-ui-asteroid
58
- ```
59
-
60
- Now your project is linked with asteroid directory and not anymore with is installed within node_modules of project.
61
- For unlink asteroid directory, inside your project:
62
-
63
- ```
64
- $ npm i
65
- ```
66
-
67
- ## Storybook and Jest develop usage
68
- ```
69
- $ git clone https://github.com/bildvitta/asteroid
70
- ```
71
-
72
- Go to `/ui` folder:
73
- ```
74
- $ npm i
75
- ```
76
-
77
- [Storybook](https://storybook.js.org/docs/vue/get-started/introduction) and [Jest](https://vue-test-utils.vuejs.org) needs vue as a dependency, to install it run the code inside `/ui` folder:
78
- ```
79
- $ npm run install-peer
80
- ```
81
-
82
- Run storybook:
83
- ```
84
- $ npm run storybook
85
- ```
86
-
87
- Run all tests:
88
- ```
89
- $ npm run test
90
- ```
91
-
92
- Run tests in watch mode:
93
- ```
94
- $ npm run test:watch
95
- ```
96
-
97
- Note: If asteroid is linked with some project and you run `npm run install-peer` the components will stop working inside the project because of vue dependency, to make they work again, inside the `/ui` folder run:
98
- ```
99
- $ npm i
100
- ```
101
-
102
- But now you have lost the link, run again:
103
- ```
104
- $ npm link
105
- ```
106
-
107
- ## Uninstall
108
-
109
- ```
110
- $ quasar ext remove @bildvitta/asteroid
111
- ```
112
-
113
- # Donate
114
- If you appreciate the work that went into this project, please consider [donating to Quasar](https://donate.quasar.dev).
115
-
116
- # License
117
- MIT (c) Caio Tarifa <caiotarifa@gmail.com>
@@ -1,4 +0,0 @@
1
- import Vue from 'vue'
2
- import environment from 'extensions'
3
-
4
- Vue.prototype.$environment = environment['@bildvitta/asteroid'] || {}
@@ -1,22 +0,0 @@
1
- import ForbiddenPage from '@bildvitta/quasar-ui-asteroid/src/pages/Forbidden.vue'
2
- import NotFound from '@bildvitta/quasar-ui-asteroid/src/pages/NotFound.vue'
3
-
4
- export default function ({ router }) {
5
- const routes = [
6
- {
7
- name: 'Forbidden',
8
- path: '/',
9
- component: ForbiddenPage
10
- }
11
- ]
12
-
13
- if (process.env.MODE !== 'ssr') {
14
- routes.push({
15
- name: 'NotFound',
16
- path: '*',
17
- component: NotFound
18
- })
19
- }
20
-
21
- router.addRoutes(routes)
22
- }
@@ -1,6 +0,0 @@
1
- const force = process.env.FORCE_HTTPS ?? process.env.PROD
2
- const protocol = 'https:'
3
-
4
- if (location.protocol !== protocol && force) {
5
- location.protocol = protocol
6
- }
@@ -1,21 +0,0 @@
1
- export default function ({ router }) {
2
- const push = router.push.bind(router)
3
- const replace = router.replace.bind(router)
4
- const resolve = router.resolve.bind(router)
5
-
6
- router.push = function (options) {
7
- const { route } = resolve(options)
8
-
9
- if (router.history.current.fullPath !== route.fullPath) {
10
- return push(options)
11
- }
12
- }
13
-
14
- router.replace = function (options) {
15
- const { route } = resolve(options)
16
-
17
- if (router.history.current.fullPath !== route.fullPath) {
18
- return replace(options)
19
- }
20
- }
21
- }
package/src/boot/store.js DELETED
@@ -1,3 +0,0 @@
1
- export default async ({ Vue, store }) => {
2
- Vue.prototype.$store = store
3
- }