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.
- package/.editorconfig +9 -0
- package/.eslintignore +7 -0
- package/.eslintrc copy.js +120 -0
- package/.eslintrc.js +120 -0
- package/.github/workflows/ci.yml +68 -0
- package/.prettierrc +5 -0
- package/LICENSE +2 -2
- package/README.md +20 -28
- package/demo/App.vue +113 -56
- package/demo/main.ts +5 -19
- package/demo/vite.config.ts +8 -1
- package/docs/.editorconfig +9 -0
- package/docs/.env +1 -0
- package/docs/.eslintignore +7 -0
- package/docs/.eslintrc.js +120 -0
- package/docs/.prettierrc +5 -0
- package/docs/docs/.vitepress/config.ts +56 -0
- package/docs/docs/api/propsWithDefaults.md +0 -0
- package/docs/docs/components/Button.vue +13 -0
- package/docs/docs/components/Component.vue +20 -0
- package/docs/docs/components/examples/Counter.vue +17 -0
- package/docs/docs/index.md +32 -0
- package/docs/docs/pages/getting-started.md +14 -0
- package/docs/docs/pages/how-it-works.md +0 -0
- package/docs/docs/pages/introduction.md +45 -0
- package/docs/docs/pages/usage.md +16 -0
- package/docs/package.json +35 -0
- package/docs/scripts/gh-pages-deploy.js +34 -0
- package/docs/vite-env.d.ts +7 -0
- package/docs/vite.config.ts +20 -0
- package/index.html +5 -4
- package/package.json +46 -61
- package/src/__tests__/ivue.vitest.spec.ts +426 -0
- package/src/index.ts +460 -80
- package/tsconfig.json +21 -11
- package/vite-env.d.ts +7 -0
- package/vite.config.ts +26 -26
- package/vitest.config.ts +13 -12
- package/.babelrc.json +0 -14
- package/.eslintrc.cjs +0 -24
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/compiler.xml +0 -7
- package/.idea/inspectionProfiles/Project_Default.xml +0 -11
- package/.idea/ivue.iml +0 -10
- package/.idea/modules.xml +0 -8
- package/.idea/php.xml +0 -20
- package/.idea/vcs.xml +0 -6
- package/.vscode/extensions.json +0 -3
- package/PLAN.md +0 -39
- package/demo/components/IVueTest.vue +0 -301
- package/demo/components/PreComponent.vue +0 -13
- package/demo/components/SubComponent2.vue +0 -45
- package/demo/components/TraitsComponent.vue +0 -120
- package/demo/components/useIVueTest.vue +0 -136
- package/demo/router/index.ts +0 -14
- package/demo/tests/IVueTests.ts +0 -265
- package/demo/tests/Mouse.ts +0 -79
- package/demo/tests/ParentIVueTests.ts +0 -36
- package/demo/tests/TApp.ts +0 -15
- package/demo/tests/TAuth.ts +0 -23
- package/demo/tests/TField.ts +0 -84
- package/demo/tests/TMessage.ts +0 -52
- package/demo/tests/TRouter.ts +0 -18
- package/demo/tests/TUser.ts +0 -19
- package/demo/tests/Test.ts +0 -86
- package/demo/tests/useField.ts +0 -82
- package/demo/tests/useIVueTests.ts +0 -57
- package/dist/favicon.ico +0 -0
- package/dist/index.es.js +0 -516
- package/dist/index.umd.js +0 -1
- package/dist/src/behavior.d.ts +0 -72
- package/dist/src/config.d.ts +0 -6
- package/dist/src/index.d.ts +0 -21
- package/dist/src/ivue.d.ts +0 -36
- package/dist/src/kernel.d.ts +0 -182
- package/dist/src/traits/UseCapsule.d.ts +0 -9
- package/dist/src/traits/UseEmit.d.ts +0 -3
- package/dist/src/traits/UseInstance.d.ts +0 -6
- package/dist/src/traits/UseMounting.d.ts +0 -11
- package/dist/src/traits/UseRefs.d.ts +0 -8
- package/dist/src/traits/UseRoute.d.ts +0 -3
- package/dist/src/traits/UseRouter.d.ts +0 -3
- package/dist/src/traits/UseRouting.d.ts +0 -6
- package/dist/src/traits/UseTick.d.ts +0 -4
- package/dist/src/traits/UseVue.d.ts +0 -13
- package/dist/src/types/core.d.ts +0 -46
- package/dist/src/utils/dispose-garbage.d.ts +0 -12
- package/dist/src/utils/extend.d.ts +0 -12
- package/dist/src/utils/getters.d.ts +0 -21
- package/dist/src/utils/index.d.ts +0 -7
- package/dist/src/utils/is.d.ts +0 -14
- package/dist/src/utils/pre.d.ts +0 -9
- package/dist/src/utils/raw.d.ts +0 -12
- package/dist/src/utils/safe-class-name.d.ts +0 -7
- package/dist/src/utils/traits.d.ts +0 -41
- package/env.d.ts +0 -1
- package/package-lock.json +0 -14305
- package/public/favicon.ico +0 -0
- package/src/App/App.ts +0 -30
- package/src/App/Auth/Auth.ts +0 -105
- package/src/App/Auth/Auth.vue +0 -98
- package/src/App/Auth/Logout.vue +0 -14
- package/src/App/Auth/User.ts +0 -6
- package/src/App/BlackBox.ts +0 -82
- package/src/App/Config.ts +0 -6
- package/src/App/Generators/generators.ts +0 -47
- package/src/App/Home/Home.vue +0 -16
- package/src/App/Services/Http/FakeHttp.ts +0 -8
- package/src/App/Services/Http/Http.ts +0 -51
- package/src/App/Services/Message/Message.ts +0 -49
- package/src/App/Services/Message/Message.vue +0 -15
- package/src/App/Services/Navigation/Navigation.ts +0 -83
- package/src/App/Services/Navigation/Navigation.vue +0 -59
- package/src/App/Services/Routing/FakeRouter.ts +0 -7
- package/src/App/Services/Routing/NotFoundRoute.vue +0 -13
- package/src/App/Services/Routing/Router.ts +0 -263
- package/src/App/Services/Routing/Routes.ts +0 -49
- package/src/App/Stubs/SingleBookResultStub.ts +0 -13
- package/src/App/Traits/UseApp.ts +0 -6
- package/src/App/Traits/UseQuasar.ts +0 -8
- package/src/behavior.ts +0 -269
- package/src/config.ts +0 -15
- package/src/dev/dev-utils.ts +0 -78
- package/src/ivue.ts +0 -299
- package/src/kernel.ts +0 -815
- package/src/tests/auth.spec.ts +0 -87
- package/src/traits/UseCapsule.ts +0 -28
- package/src/traits/UseEmit.ts +0 -3
- package/src/traits/UseInstance.ts +0 -17
- package/src/traits/UseMounting.ts +0 -23
- package/src/traits/UseRefs.ts +0 -17
- package/src/traits/UseRoute.ts +0 -6
- package/src/traits/UseRouter.ts +0 -5
- package/src/traits/UseRouting.ts +0 -7
- package/src/traits/UseTick.ts +0 -5
- package/src/traits/UseVue.ts +0 -38
- package/src/types/core.ts +0 -66
- package/src/utils/dispose-garbage.ts +0 -34
- package/src/utils/extend.ts +0 -86
- package/src/utils/getters.ts +0 -59
- package/src/utils/index.ts +0 -16
- package/src/utils/is.ts +0 -22
- package/src/utils/pre.ts +0 -29
- package/src/utils/raw.ts +0 -19
- package/src/utils/safe-class-name.ts +0 -15
- package/src/utils/traits.ts +0 -121
- package/tsconfig.app.json +0 -47
- package/tsconfig.node.json +0 -14
- package/tsconfig.vitest.json +0 -9
- /package/{src/App/Traits/UseBlackline.ts → docs/docs/api/ivue.md} +0 -0
package/.editorconfig
ADDED
package/.eslintignore
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
|
+
};
|
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
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2023
|
|
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
|
-
|
|
1
|
+
## ivue – Infinite Vue [](https://www.npmjs.com/package/ivue) [](https://github.com/infinite-system/ivue/actions/workflows/ci.yml)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## About
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
## Features
|
|
8
|
+
– Simple & Elegant Architecture<br />
|
|
9
|
+
– Extendible Classes aligned with TypeScript Class design<br />
|
|
10
|
+
– Extendible Props Defaults<br />
|
|
11
|
+
– Extendible Emits<br />
|
|
12
|
+
– Extendible Slots<br />
|
|
13
|
+
– Extendible Components<br />
|
|
14
|
+
– Improves DX by elegantly dealing with .value in the background<br />
|
|
15
|
+
– Can be used both as a Store and a View Model for Components<br />
|
|
16
|
+
– Provides Full TypeScript Support<br />
|
|
17
|
+
– 100% Tested<br />
|
|
18
|
+
– Zero dependencies except Vue 3<br />
|
|
19
|
+
– Only 1kb in size!<br />
|
|
20
|
+
– Production Ready<br />
|
|
13
21
|
|
|
14
|
-
##
|
|
15
|
-
```
|
|
16
|
-
yarn dev
|
|
17
|
-
```
|
|
22
|
+
## How Does it Work
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
## Examples
|
|
20
25
|
|
|
21
|
-
|
|
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 {
|
|
3
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
get grandParentGetter () {
|
|
13
|
+
return 'fun'
|
|
14
|
+
}
|
|
21
15
|
}
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
width: 150px;
|
|
25
|
-
float: left;
|
|
26
|
-
}
|
|
17
|
+
abstract class MessagesPresenter extends GrandParent {
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
color: 'white';
|
|
30
|
-
padding: 10px;
|
|
31
|
-
margin-left: 3px;
|
|
32
|
-
margin-top: 3px;
|
|
33
|
-
}
|
|
19
|
+
showValidationWarning = null
|
|
34
20
|
|
|
35
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
color: 'black';
|
|
47
|
-
}
|
|
23
|
+
constructor () {
|
|
24
|
+
super()
|
|
48
25
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
init = () => {}
|
|
29
|
+
|
|
30
|
+
abstract reset (): void
|
|
52
31
|
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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 {
|
|
2
|
+
import { install } from "../src/index";
|
|
3
|
+
import App from "./App.vue";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const app = createApp(App);
|
|
5
6
|
|
|
6
|
-
|
|
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");
|
package/demo/vite.config.ts
CHANGED
|
@@ -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
|
},
|
package/docs/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BASE="/ivue/"
|