ivue 0.1.11 → 1.0.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.
Files changed (150) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +7 -0
  3. package/.eslintrc copy.js +120 -0
  4. package/.eslintrc.js +120 -0
  5. package/.github/workflows/ci.yml +68 -0
  6. package/.prettierrc +5 -0
  7. package/LICENSE +2 -2
  8. package/README.md +20 -28
  9. package/demo/App.vue +113 -56
  10. package/demo/main.ts +5 -19
  11. package/demo/vite.config.ts +8 -1
  12. package/docs/.editorconfig +9 -0
  13. package/docs/.env +1 -0
  14. package/docs/.eslintignore +7 -0
  15. package/docs/.eslintrc.js +120 -0
  16. package/docs/.prettierrc +5 -0
  17. package/docs/docs/.vitepress/config.ts +56 -0
  18. package/docs/docs/api/propsWithDefaults.md +0 -0
  19. package/docs/docs/components/Button.vue +13 -0
  20. package/docs/docs/components/Component.vue +20 -0
  21. package/docs/docs/components/examples/Counter.vue +17 -0
  22. package/docs/docs/index.md +32 -0
  23. package/docs/docs/pages/getting-started.md +14 -0
  24. package/docs/docs/pages/how-it-works.md +0 -0
  25. package/docs/docs/pages/introduction.md +45 -0
  26. package/docs/docs/pages/usage.md +16 -0
  27. package/docs/package.json +35 -0
  28. package/docs/scripts/gh-pages-deploy.js +34 -0
  29. package/docs/vite-env.d.ts +7 -0
  30. package/docs/vite.config.ts +20 -0
  31. package/index.html +5 -4
  32. package/package.json +46 -61
  33. package/src/__tests__/ivue.vitest.spec.ts +426 -0
  34. package/src/index.ts +460 -80
  35. package/tsconfig.json +21 -11
  36. package/vite-env.d.ts +7 -0
  37. package/vite.config.ts +26 -26
  38. package/vitest.config.ts +13 -12
  39. package/.babelrc.json +0 -14
  40. package/.eslintrc.cjs +0 -24
  41. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  42. package/.idea/compiler.xml +0 -7
  43. package/.idea/inspectionProfiles/Project_Default.xml +0 -11
  44. package/.idea/ivue.iml +0 -10
  45. package/.idea/modules.xml +0 -8
  46. package/.idea/php.xml +0 -20
  47. package/.idea/vcs.xml +0 -6
  48. package/.vscode/extensions.json +0 -3
  49. package/PLAN.md +0 -39
  50. package/demo/components/IVueTest.vue +0 -301
  51. package/demo/components/PreComponent.vue +0 -13
  52. package/demo/components/SubComponent2.vue +0 -45
  53. package/demo/components/TraitsComponent.vue +0 -120
  54. package/demo/components/useIVueTest.vue +0 -136
  55. package/demo/router/index.ts +0 -14
  56. package/demo/tests/IVueTests.ts +0 -265
  57. package/demo/tests/Mouse.ts +0 -79
  58. package/demo/tests/ParentIVueTests.ts +0 -36
  59. package/demo/tests/TApp.ts +0 -15
  60. package/demo/tests/TAuth.ts +0 -23
  61. package/demo/tests/TField.ts +0 -84
  62. package/demo/tests/TMessage.ts +0 -52
  63. package/demo/tests/TRouter.ts +0 -18
  64. package/demo/tests/TUser.ts +0 -19
  65. package/demo/tests/Test.ts +0 -86
  66. package/demo/tests/useField.ts +0 -82
  67. package/demo/tests/useIVueTests.ts +0 -57
  68. package/dist/favicon.ico +0 -0
  69. package/dist/index.es.js +0 -516
  70. package/dist/index.umd.js +0 -1
  71. package/dist/src/behavior.d.ts +0 -72
  72. package/dist/src/config.d.ts +0 -6
  73. package/dist/src/index.d.ts +0 -21
  74. package/dist/src/ivue.d.ts +0 -36
  75. package/dist/src/kernel.d.ts +0 -182
  76. package/dist/src/traits/UseCapsule.d.ts +0 -9
  77. package/dist/src/traits/UseEmit.d.ts +0 -3
  78. package/dist/src/traits/UseInstance.d.ts +0 -6
  79. package/dist/src/traits/UseMounting.d.ts +0 -11
  80. package/dist/src/traits/UseRefs.d.ts +0 -8
  81. package/dist/src/traits/UseRoute.d.ts +0 -3
  82. package/dist/src/traits/UseRouter.d.ts +0 -3
  83. package/dist/src/traits/UseRouting.d.ts +0 -6
  84. package/dist/src/traits/UseTick.d.ts +0 -4
  85. package/dist/src/traits/UseVue.d.ts +0 -13
  86. package/dist/src/types/core.d.ts +0 -46
  87. package/dist/src/utils/dispose-garbage.d.ts +0 -12
  88. package/dist/src/utils/extend.d.ts +0 -12
  89. package/dist/src/utils/getters.d.ts +0 -21
  90. package/dist/src/utils/index.d.ts +0 -7
  91. package/dist/src/utils/is.d.ts +0 -14
  92. package/dist/src/utils/pre.d.ts +0 -9
  93. package/dist/src/utils/raw.d.ts +0 -12
  94. package/dist/src/utils/safe-class-name.d.ts +0 -7
  95. package/dist/src/utils/traits.d.ts +0 -41
  96. package/env.d.ts +0 -1
  97. package/package-lock.json +0 -14305
  98. package/public/favicon.ico +0 -0
  99. package/src/App/App.ts +0 -30
  100. package/src/App/Auth/Auth.ts +0 -105
  101. package/src/App/Auth/Auth.vue +0 -98
  102. package/src/App/Auth/Logout.vue +0 -14
  103. package/src/App/Auth/User.ts +0 -6
  104. package/src/App/BlackBox.ts +0 -82
  105. package/src/App/Config.ts +0 -6
  106. package/src/App/Generators/generators.ts +0 -47
  107. package/src/App/Home/Home.vue +0 -16
  108. package/src/App/Services/Http/FakeHttp.ts +0 -8
  109. package/src/App/Services/Http/Http.ts +0 -51
  110. package/src/App/Services/Message/Message.ts +0 -49
  111. package/src/App/Services/Message/Message.vue +0 -15
  112. package/src/App/Services/Navigation/Navigation.ts +0 -83
  113. package/src/App/Services/Navigation/Navigation.vue +0 -59
  114. package/src/App/Services/Routing/FakeRouter.ts +0 -7
  115. package/src/App/Services/Routing/NotFoundRoute.vue +0 -13
  116. package/src/App/Services/Routing/Router.ts +0 -263
  117. package/src/App/Services/Routing/Routes.ts +0 -49
  118. package/src/App/Stubs/SingleBookResultStub.ts +0 -13
  119. package/src/App/Traits/UseApp.ts +0 -6
  120. package/src/App/Traits/UseQuasar.ts +0 -8
  121. package/src/behavior.ts +0 -269
  122. package/src/config.ts +0 -15
  123. package/src/dev/dev-utils.ts +0 -78
  124. package/src/ivue.ts +0 -299
  125. package/src/kernel.ts +0 -815
  126. package/src/tests/auth.spec.ts +0 -87
  127. package/src/traits/UseCapsule.ts +0 -28
  128. package/src/traits/UseEmit.ts +0 -3
  129. package/src/traits/UseInstance.ts +0 -17
  130. package/src/traits/UseMounting.ts +0 -23
  131. package/src/traits/UseRefs.ts +0 -17
  132. package/src/traits/UseRoute.ts +0 -6
  133. package/src/traits/UseRouter.ts +0 -5
  134. package/src/traits/UseRouting.ts +0 -7
  135. package/src/traits/UseTick.ts +0 -5
  136. package/src/traits/UseVue.ts +0 -38
  137. package/src/types/core.ts +0 -66
  138. package/src/utils/dispose-garbage.ts +0 -34
  139. package/src/utils/extend.ts +0 -86
  140. package/src/utils/getters.ts +0 -59
  141. package/src/utils/index.ts +0 -16
  142. package/src/utils/is.ts +0 -22
  143. package/src/utils/pre.ts +0 -29
  144. package/src/utils/raw.ts +0 -19
  145. package/src/utils/safe-class-name.ts +0 -15
  146. package/src/utils/traits.ts +0 -121
  147. package/tsconfig.app.json +0 -47
  148. package/tsconfig.node.json +0 -14
  149. package/tsconfig.vitest.json +0 -9
  150. /package/{src/App/Traits/UseBlackline.ts → docs/docs/api/ivue.md} +0 -0
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
package/.eslintignore ADDED
@@ -0,0 +1,7 @@
1
+ /dist
2
+ /src-capacitor
3
+ /src-cordova
4
+ /.quasar
5
+ /node_modules
6
+ .eslintrc.js
7
+ /src-ssr
@@ -0,0 +1,120 @@
1
+ module.exports = {
2
+ // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
3
+ // This option interrupts the configuration hierarchy at this file
4
+ // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
5
+ root: true,
6
+ // https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
7
+ // Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
8
+ // `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
9
+ parserOptions: {
10
+ parser: require.resolve('@typescript-eslint/parser'),
11
+ extraFileExtensions: ['.vue'],
12
+ },
13
+ env: {
14
+ browser: true,
15
+ es2021: true,
16
+ node: true,
17
+ 'vue/setup-compiler-macros': true,
18
+ },
19
+ // Rules order is important, please avoid shuffling them
20
+ extends: [
21
+ 'plugin:@typescript-eslint/recommended',
22
+ 'plugin:vue/vue3-recommended',
23
+ 'prettier',
24
+ 'plugin:storybook/recommended',
25
+ ],
26
+ plugins: [
27
+ // required to apply rules which need type information
28
+ '@typescript-eslint',
29
+ // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
30
+ // required to lint *.vue files
31
+ 'vue',
32
+
33
+ // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
34
+ // Prettier has not been included as plugin to avoid performance impact
35
+ // add it as an extension for your IDE
36
+
37
+ 'import',
38
+ ],
39
+
40
+ globals: {
41
+ ga: 'readonly',
42
+ // Google Analytics
43
+ cordova: 'readonly',
44
+ __statics: 'readonly',
45
+ __QUASAR_SSR__: 'readonly',
46
+ __QUASAR_SSR_SERVER__: 'readonly',
47
+ __QUASAR_SSR_CLIENT__: 'readonly',
48
+ __QUASAR_SSR_PWA__: 'readonly',
49
+ process: 'readonly',
50
+ Capacitor: 'readonly',
51
+ chrome: 'readonly',
52
+ },
53
+ // add your custom rules here
54
+ rules: {
55
+ 'prefer-promise-reject-errors': 'off',
56
+ quotes: [
57
+ 'warn',
58
+ 'single',
59
+ {
60
+ avoidEscape: true,
61
+ },
62
+ ],
63
+ // this rule, if on, would require explicit return type on the `render` function
64
+ '@typescript-eslint/explicit-function-return-type': 'off',
65
+ // in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
66
+ '@typescript-eslint/no-var-requires': 'off',
67
+
68
+ '@typescript-eslint/no-empty-function': 'off',
69
+ // allow type any
70
+ '@typescript-eslint/no-explicit-any': 'off',
71
+ 'vue/no-v-html': 'off',
72
+ // The core 'no-unused-vars' rules (in the eslint:recommended ruleset)
73
+ // does not work with type definitions
74
+ 'no-unused-vars': 'off',
75
+ // allow debugger during development only
76
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
77
+ 'sort-imports': [
78
+ 'warn',
79
+ {
80
+ ignoreCase: false,
81
+ // don"t want to sort import lines, use eslint-plugin-import instead
82
+ ignoreDeclarationSort: true,
83
+ ignoreMemberSort: false,
84
+ memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
85
+ allowSeparatedGroups: true,
86
+ },
87
+ ],
88
+ 'import/no-duplicates': ['error'],
89
+ 'import/order': [
90
+ 'warn',
91
+ {
92
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
93
+ groups: [['builtin', 'external', 'internal']],
94
+ pathGroups: [
95
+ {
96
+ pattern: 'src/**',
97
+ group: 'internal',
98
+ position: 'after',
99
+ },
100
+ ],
101
+ pathGroupsExcludedImportTypes: ['builtin'],
102
+ 'newlines-between': 'always',
103
+ alphabetize: {
104
+ order: 'asc',
105
+ caseInsensitive: true,
106
+ },
107
+ },
108
+ ],
109
+ },
110
+ overrides: [
111
+ {
112
+ files: ['test/cypress/**/*.{js,jsx,ts,tsx}', '**/*.cy.{js,jsx,ts,tsx}'],
113
+ extends: [
114
+ // Add Cypress-specific lint rules, globals and Cypress plugin
115
+ // See https://github.com/cypress-io/eslint-plugin-cypress#rules
116
+ 'plugin:cypress/recommended',
117
+ ],
118
+ },
119
+ ],
120
+ };
package/.eslintrc.js ADDED
@@ -0,0 +1,120 @@
1
+ module.exports = {
2
+ // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
3
+ // This option interrupts the configuration hierarchy at this file
4
+ // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
5
+ root: true,
6
+ // https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
7
+ // Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
8
+ // `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
9
+ parserOptions: {
10
+ parser: require.resolve('@typescript-eslint/parser'),
11
+ extraFileExtensions: ['.vue'],
12
+ },
13
+ env: {
14
+ browser: true,
15
+ es2021: true,
16
+ node: true,
17
+ 'vue/setup-compiler-macros': true,
18
+ },
19
+ // Rules order is important, please avoid shuffling them
20
+ extends: [
21
+ 'plugin:@typescript-eslint/recommended',
22
+ 'plugin:vue/vue3-recommended',
23
+ 'prettier',
24
+ 'plugin:storybook/recommended',
25
+ ],
26
+ plugins: [
27
+ // required to apply rules which need type information
28
+ '@typescript-eslint',
29
+ // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
30
+ // required to lint *.vue files
31
+ 'vue',
32
+
33
+ // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
34
+ // Prettier has not been included as plugin to avoid performance impact
35
+ // add it as an extension for your IDE
36
+
37
+ 'import',
38
+ ],
39
+
40
+ globals: {
41
+ ga: 'readonly',
42
+ // Google Analytics
43
+ cordova: 'readonly',
44
+ __statics: 'readonly',
45
+ __QUASAR_SSR__: 'readonly',
46
+ __QUASAR_SSR_SERVER__: 'readonly',
47
+ __QUASAR_SSR_CLIENT__: 'readonly',
48
+ __QUASAR_SSR_PWA__: 'readonly',
49
+ process: 'readonly',
50
+ Capacitor: 'readonly',
51
+ chrome: 'readonly',
52
+ },
53
+ // add your custom rules here
54
+ rules: {
55
+ 'prefer-promise-reject-errors': 'off',
56
+ quotes: [
57
+ 'warn',
58
+ 'single',
59
+ {
60
+ avoidEscape: true,
61
+ },
62
+ ],
63
+ // this rule, if on, would require explicit return type on the `render` function
64
+ '@typescript-eslint/explicit-function-return-type': 'off',
65
+ // in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
66
+ '@typescript-eslint/no-var-requires': 'off',
67
+
68
+ '@typescript-eslint/no-empty-function': 'off',
69
+ // allow type any
70
+ '@typescript-eslint/no-explicit-any': 'off',
71
+ 'vue/no-v-html': 'off',
72
+ // The core 'no-unused-vars' rules (in the eslint:recommended ruleset)
73
+ // does not work with type definitions
74
+ 'no-unused-vars': 'off',
75
+ // allow debugger during development only
76
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
77
+ 'sort-imports': [
78
+ 'warn',
79
+ {
80
+ ignoreCase: false,
81
+ // don"t want to sort import lines, use eslint-plugin-import instead
82
+ ignoreDeclarationSort: true,
83
+ ignoreMemberSort: false,
84
+ memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
85
+ allowSeparatedGroups: true,
86
+ },
87
+ ],
88
+ 'import/no-duplicates': ['error'],
89
+ 'import/order': [
90
+ 'warn',
91
+ {
92
+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
93
+ groups: [['builtin', 'external', 'internal']],
94
+ pathGroups: [
95
+ {
96
+ pattern: 'src/**',
97
+ group: 'internal',
98
+ position: 'after',
99
+ },
100
+ ],
101
+ pathGroupsExcludedImportTypes: ['builtin'],
102
+ 'newlines-between': 'always',
103
+ alphabetize: {
104
+ order: 'asc',
105
+ caseInsensitive: true,
106
+ },
107
+ },
108
+ ],
109
+ },
110
+ overrides: [
111
+ {
112
+ files: ['test/cypress/**/*.{js,jsx,ts,tsx}', '**/*.cy.{js,jsx,ts,tsx}'],
113
+ extends: [
114
+ // Add Cypress-specific lint rules, globals and Cypress plugin
115
+ // See https://github.com/cypress-io/eslint-plugin-cypress#rules
116
+ 'plugin:cypress/recommended',
117
+ ],
118
+ },
119
+ ],
120
+ };
@@ -0,0 +1,68 @@
1
+ name: ci
2
+ on: [ push ]
3
+
4
+ jobs:
5
+ build:
6
+ name: vitest
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+
11
+ - name: Set Node.js 18.x
12
+ uses: actions/setup-node@v3
13
+ with:
14
+ node-version: 18.x
15
+
16
+ - name: yarn install
17
+ uses: borales/actions-yarn@v4
18
+ with:
19
+ cmd: install # will run `yarn install` command
20
+ # dir: 'ivue'
21
+ - name: vitest ivue
22
+ uses: borales/actions-yarn@v4
23
+ with:
24
+ cmd: test # will run `yarn test` command
25
+ # dir: 'ivue'
26
+ docs-deploy:
27
+ name: deploy docs
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v3
31
+
32
+ - name: Set Node.js 18.x
33
+ uses: actions/setup-node@v3
34
+ with:
35
+ node-version: 18.x
36
+
37
+ - name: Setup git
38
+ run: |
39
+ git config user.name "Evgeny Kalashnikov" && git config user.email "ekalashnikov@gmail.com"
40
+ - name: yarn install
41
+ uses: borales/actions-yarn@v4
42
+ with:
43
+ cmd: install # will run `yarn install` command
44
+ dir: 'docs'
45
+ - name: deploy docs
46
+ uses: borales/actions-yarn@v4
47
+ with:
48
+ cmd: deploy # will run `yarn deploy` command
49
+ dir: 'docs'
50
+ # docs-deploy:
51
+ # name: Deploying to gh-pages
52
+ # runs-on: ubuntu-latest
53
+ # steps:
54
+ # - name: Setup Node.js for use with actions
55
+ # uses: actions/setup-node@v2
56
+ # with:
57
+ # version: 12.x
58
+ # - name: Checkout branch
59
+ # uses: actions/checkout@v2
60
+ #
61
+ # - name: Clean install dependencies
62
+ # run: npm ci
63
+ #
64
+ # - name: Run deploy script
65
+ # run: |
66
+ # git config user.name "Evgeny Kalashnikov" && git config user.email "ekalashnikov@gmail.com"
67
+ #
68
+ # cmd: deploy
package/.prettierrc ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "printWidth": 80,
3
+ "singleQuote": true,
4
+ "semi": true
5
+ }
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2023 - ∞ Evgeny Kalashnikov
1
+ Copyright (c) 2023 ∞ Evgeny Kalashnikov
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
16
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
17
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
19
+ SOFTWARE.
package/README.md CHANGED
@@ -1,34 +1,26 @@
1
- # ivue Infinite Vue
1
+ ## ivue – Infinite Vue     [![npm](https://img.shields.io/npm/v/ivue.svg)](https://www.npmjs.com/package/ivue) [![build status](https://github.com/infinite-system/ivue/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/infinite-system/ivue/actions/workflows/ci.yml)
2
2
 
3
- Advanced State Management & Class Architecture for Vue 3+.
3
+ ## About
4
4
 
5
- ## Install
5
+ **ivue** is a TypeScript classes based composable architecture for Vue 3, that unlocks infinite scalability for Vue 3 based apps. It allows you to extend the regular Vue 3 in a simple and elegant way.
6
6
 
7
- ```sh
8
- # Using npm
9
- npm i ivue
10
- # or yarn
11
- yarn add ivue
12
- ```
7
+ ## Features
8
+ &ndash; Simple & Elegant Architecture<br />
9
+ &ndash; Extendible Classes aligned with TypeScript Class design<br />
10
+ &ndash; Extendible Props Defaults<br />
11
+ &ndash; Extendible Emits<br />
12
+ &ndash; Extendible Slots<br />
13
+ &ndash; Extendible Components<br />
14
+ &ndash; Improves DX by elegantly dealing with .value in the background<br />
15
+ &ndash; Can be used both as a Store and a View Model for Components<br />
16
+ &ndash; Provides Full TypeScript Support<br />
17
+ &ndash; 100% Tested<br />
18
+ &ndash; Zero dependencies except Vue 3<br />
19
+ &ndash; Only 1kb in size!<br />
20
+ &ndash; Production Ready<br />
13
21
 
14
- ## Run Dev Server
15
- ```
16
- yarn dev
17
- ```
22
+ ## How Does it Work
18
23
 
19
- ### Files to look at:
24
+ ## Examples
20
25
 
21
- Main logic for ivue:
22
- https://github.com/infinite-system/infinite-vue/blob/main/src/ivue.ts
23
-
24
- Utils:
25
- https://github.com/infinite-system/infinite-vue/blob/main/src/utils.ts
26
-
27
- Inversion of Control Container:
28
- https://github.com/infinite-system/infinite-vue/blob/main/src/kernel.ts
29
-
30
- App.vue:
31
- https://github.com/infinite-system/infinite-vue/blob/main/demo/App.vue
32
-
33
- Main class used for playground in App.vue:
34
- https://github.com/infinite-system/infinite-vue/blob/main/demo/tests/IVueTests.ts
26
+ ## Documentation
package/demo/App.vue CHANGED
@@ -1,72 +1,129 @@
1
1
  <script setup lang="ts">
2
- import { use } from '@/index'
3
- // import { Mouse } from './tests/Mouse';
4
- // import { IVueTests } from "./tests/IVueTests";
5
- import { TApp } from './tests/TApp';
6
- const app = use(TApp)
7
- </script>
8
- <template>
9
- <vue-dd v-model="app" name="app" open-level="1" />
10
- <router-view />
11
- </template>
12
- <style>
13
- @import 'https://fonts.googleapis.com/css?family=Montserrat:400,700,400italic,700italic';
14
- @import 'https://www.w3schools.com/w3css/4/w3.css';
2
+ import { reactive, ref } from 'vue'
3
+ import { action, computed, inject, makeObservable, observable } from "*";
15
4
 
5
+ const w = window
6
+ const test = reactive({ 'test': 'test' })
7
+ const test2 = { 'test': ref({ test: 'test' }), 'array': ['test', 'test2'] }
16
8
 
9
+ abstract class GrandParent {
10
+ grandParent = 'test'
17
11
 
18
- body {
19
- font-family: 'Montserrat';
20
- margin: 40px;
12
+ get grandParentGetter () {
13
+ return 'fun'
14
+ }
21
15
  }
22
16
 
23
- .navigation-container {
24
- width: 150px;
25
- float: left;
26
- }
17
+ abstract class MessagesPresenter extends GrandParent {
27
18
 
28
- .navigation-item-header {
29
- color: 'white';
30
- padding: 10px;
31
- margin-left: 3px;
32
- margin-top: 3px;
33
- }
19
+ showValidationWarning = null
34
20
 
35
- .navigation-item {
36
- color: 'white';
37
- padding: 10px;
38
- margin-left: 3px;
39
- margin-top: 3px;
40
- cursor: pointer;
41
- text-align: left;
42
- }
21
+ static _name = 'hi'
43
22
 
44
- .validation-message {
45
- padding: 13;
46
- color: 'black';
47
- }
23
+ constructor () {
24
+ super()
48
25
 
49
- .logo {
50
- padding-bottom: 20px;
51
- }
26
+ }
27
+
28
+ init = () => {}
29
+
30
+ abstract reset (): void
52
31
 
53
- .container input[type='text'] {
54
- width: 140px;
32
+ get messages () {
33
+ return 'yes'
34
+ }
35
+
36
+ unpackRepositoryPmToVm = (pm, userMessage) => {}
37
+ }
38
+ class Auth {
39
+ test = 1
55
40
  }
41
+ class LoginRegisterPresenter extends MessagesPresenter {
42
+
43
+ static test = 2
44
+ static test2 = 2
45
+
46
+ auth = new Auth()
47
+
48
+ static testF () {
49
+ return 1
50
+ }
51
+
52
+ email = null
53
+ password = null
54
+ option = null
55
+
56
+ constructor () {
57
+ super()
58
+ this.auth = new Auth()
59
+ }
60
+
61
+ //
62
+ get viewTest () {
63
+ this.auth.test = 2
64
+ console.log('yo')
65
+ return 'yes'
66
+ }
67
+
68
+ set viewTest (value) {
69
+
70
+ }
56
71
 
57
- .container {
58
- width: 650px;
59
- margin: auto;
72
+ setAuthRepoTest () {
73
+
74
+ }
75
+
76
+ reset () {
77
+
78
+ }
79
+
80
+ async login () {
81
+
82
+ }
83
+
84
+ register () {
85
+
86
+ }
87
+
88
+ logOut () {
89
+
90
+ }
60
91
  }
61
92
 
62
- .container .lr-submit {
63
- padding-left: 20px;
64
- padding-right: 20px;
65
- padding-top: 7px;
66
- padding-bottom: 7px;
67
- border: none;
68
- background-color: #5bca06;
69
- color: #ffffff;
70
- width: 100px;
93
+ const presenter = new LoginRegisterPresenter()
94
+
95
+ const proto = Object.getPrototypeOf(presenter)
96
+
97
+ let val = ref({ })
98
+ setTimeout(() => {
99
+ val.value = reactive({
100
+ test: 1
101
+ })
102
+ }, 1000)
103
+
104
+ </script>
105
+ <template>
106
+ <h1>vue-dd integration tests</h1>
107
+ <vue-dd name="val" v-model="val" />
108
+ <br />
109
+ <vue-dd name="window" :save-focus="false" :get-all-properties="false" v-model="w" />
110
+ <br />
111
+ <vue-dd name="test" get-all-properties v-model="test" />
112
+ <br />
113
+ <vue-dd name="test2" get-all-properties v-model="test2" />
114
+ <br />
115
+ <vue-dd name="presenter" :get-all-properties="true" v-model="presenter" />
116
+ <vue-dd name="LoginRegisterPresenter" :get-all-properties="true" v-model="LoginRegisterPresenter" />
117
+
118
+
119
+
120
+ </template>
121
+
122
+
123
+ <style>
124
+ .rendererParent {
125
+ width: 100%;
126
+ height: 580px;
127
+ border: 1px solid black;
71
128
  }
72
- </style>
129
+ </style>
package/demo/main.ts CHANGED
@@ -1,23 +1,9 @@
1
1
  import { createApp } from "vue";
2
- import { VueDd } from 'vue-dd'
2
+ import { install } from "../src/index";
3
+ import App from "./App.vue";
3
4
 
4
- import { setup, use } from '@/index'
5
+ const app = createApp(App);
5
6
 
6
- import AppComponent from "./App.vue";
7
- import { App } from '@/App/App';
8
- import { Auth } from '@/App/Auth/Auth';
7
+ install(app);
9
8
 
10
-
11
- const app = use(App).load()
12
- setup({ router: app.router, debug: true })
13
-
14
- use(Auth)
15
- export const vue = createApp(AppComponent);
16
-
17
- console.log('vue', vue);
18
-
19
- vue.use(app.router)
20
-
21
- vue.component('VueDd', VueDd)
22
-
23
- vue.mount("#app");
9
+ app.mount("#app");
@@ -1,12 +1,19 @@
1
1
  import { defineConfig } from "vite";
2
2
  import vue from "@vitejs/plugin-vue";
3
3
 
4
+ export const vueDocsPlugin = () => ({
5
+ name: "vue-docs",
6
+ transform(code: any, id: any) {
7
+ if (!/vue&type=docs/.test(id)) return;
8
+ return `export default ''`;
9
+ },
10
+ });
4
11
 
5
12
  export default defineConfig({
6
13
  root: "./",
7
14
  // keep the same name as your github repos
8
15
  mode: "production",
9
- plugins: [vue()],
16
+ plugins: [vue(), vueDocsPlugin()],
10
17
  build: {
11
18
  outDir: "./dist-demo",
12
19
  },
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
package/docs/.env ADDED
@@ -0,0 +1 @@
1
+ BASE="/ivue/"
@@ -0,0 +1,7 @@
1
+ /dist
2
+ /src-capacitor
3
+ /src-cordova
4
+ /.quasar
5
+ /node_modules
6
+ .eslintrc.js
7
+ /src-ssr