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
@@ -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,5 @@
1
+ {
2
+ "printWidth": 80,
3
+ "singleQuote": true,
4
+ "semi": true
5
+ }
@@ -0,0 +1,56 @@
1
+ import { defineConfig } from 'vitepress'
2
+
3
+ // https://vitepress.vuejs.org/config/app-configs
4
+ export default defineConfig({
5
+ themeConfig: {
6
+ siteTitle: 'ivue ∞ Infinite Vue',
7
+ sidebar: [
8
+ {
9
+ collapsed: false,
10
+ text: 'Guide',
11
+ items: [
12
+ { text: 'What is ivue?', link: '/pages/introduction' },
13
+ { text: 'How it works?', link: '/pages/how-it-works' },
14
+ { text: 'Getting Started', link: '/pages/getting-started' },
15
+ ],
16
+ },
17
+ {
18
+ collapsed: false,
19
+ text: 'Usage',
20
+ items: [
21
+ { text: 'Basic Usage', link: '/pages/usage' },
22
+ { text: 'Class Inheritance', link: '/pages/usage' },
23
+ { text: 'Using Props', link: '/pages/usage' },
24
+ { text: 'Using Emits', link: '/pages/usage' },
25
+ { text: 'Using Composables', link: '/pages/usage' },
26
+ { text: 'Define Expose', link: '/pages/usage' },
27
+ { text: 'Extend Slots', link: '/pages/usage' },
28
+ ],
29
+ },
30
+ {
31
+ collapsed: false,
32
+ text: 'Functions',
33
+ items: [
34
+ { text: 'ivue', link: '/api/init' },
35
+ { text: '.toRefs()', link: '/api/init' },
36
+ { text: 'propsWithDefaults', link: '/api/propsWithDefaults' },
37
+ ],
38
+ },
39
+ {
40
+ text: 'Utility Types',
41
+ items: [
42
+ { text: 'UnwrapComposable', link: '/types/UnwrapComposable' },
43
+ { text: 'ExtractEmitTypes', link: '/types/ExtractEmitTypes' },
44
+ { text: 'ExtractPropDefaultTypes', link: '/types/ExtractPropDefaultTypes' },
45
+ { text: 'ExtendSlots', link: '/types/ExtendSlots' },
46
+ ],
47
+ },
48
+ ]
49
+ },
50
+ base: '/ivue/',
51
+ vite: { // To make vue-dd work, see https://github.com/vuetifyjs/vuetify/discussions/15735
52
+ ssr: {
53
+ noExternal: ["vue-dd"]
54
+ }
55
+ }
56
+ })
File without changes
@@ -0,0 +1,13 @@
1
+ <script lang="ts" setup>
2
+ defineProps({
3
+ href: String,
4
+ label: String,
5
+ inline: {
6
+ type: Boolean,
7
+ default: true
8
+ }
9
+ });
10
+ </script>
11
+ <template>
12
+ <a :href="'/ivue' + href" :style="`inline: ${inline};`">{{ label }}</a>
13
+ </template>
@@ -0,0 +1,20 @@
1
+ <script setup lang="ts">
2
+ import { ivue } from "../../../src/index";
3
+ import { VueDd } from "vue-dd";
4
+ import { ref } from 'vue';
5
+
6
+ class Test2 {
7
+ prop = ref(1);
8
+ prop2 = ref(2);
9
+ }
10
+ const test = ivue(Test2);
11
+ const a = "Coming soon";
12
+ </script>
13
+ <template>
14
+
15
+
16
+
17
+ <ClientOnly>
18
+ <vue-dd get-all-properties :save-focus="false" :open-level="1" :inline="false" v-model="test" name="class Test" />
19
+ </ClientOnly>
20
+ </template>
@@ -0,0 +1,17 @@
1
+ <script lang="ts" setup>
2
+ import { ref } from 'vue';
3
+ import { ivue } from '../../../../src/index';
4
+
5
+ class ToDo {
6
+ count = ref(0) as unknown as number;
7
+ increment() {
8
+ this.count++;
9
+ }
10
+ }
11
+
12
+ const todo = ivue(ToDo);
13
+ </script>
14
+ <template>
15
+ <a href="javascript:void" @click="() => todo.increment()">Increment</a>
16
+ Count: {{ todo.count }}
17
+ </template>
@@ -0,0 +1,32 @@
1
+ <script lang="ts" setup>
2
+ import Button from './components/Button.vue'
3
+
4
+ </script>
5
+ # Documentation
6
+
7
+
8
+ ## About
9
+
10
+ **Infinite Vue &ndash; ivue** is a class 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.
11
+
12
+ ## Features
13
+ <div style="padding-left:20px;">
14
+ &ndash; Simple & Elegant Architecture<br />
15
+ &ndash; Extendible Classes aligned with TypeScript Class design<br />
16
+ &ndash; Extendible Props Defaults<br />
17
+ &ndash; Extendible Emits<br />
18
+ &ndash; Extendible Slots<br />
19
+ &ndash; Extendible Components<br />
20
+ &ndash; Improves DX by elegantly dealing with .value in the background<br />
21
+ &ndash; Can be used both as a Store and a View Model for Components<br />
22
+ &ndash; Provides Full TypeScript Support<br />
23
+ &ndash; 100% Tested<br />
24
+ &ndash; Zero dependencies except Vue 3<br />
25
+ &ndash; Only 1kb(gzipped) in size!<br />
26
+ &ndash; Production Ready<br />
27
+ </div>
28
+
29
+ ## Next Step
30
+
31
+ <Button href="/pages/getting-started.html" label="Geting Started" /> &nbsp; or &nbsp; <Button href="/pages/introduction.html" label="Read Introduction" />
32
+
@@ -0,0 +1,14 @@
1
+ # Installation
2
+
3
+ In your terminal install ivue:
4
+ ```bash
5
+ # via yarn
6
+ yarn add ivue
7
+
8
+ # via npm
9
+ npm i ivue
10
+
11
+ # via pnpm
12
+ pnpm i ivue
13
+ ```
14
+
File without changes
@@ -0,0 +1,45 @@
1
+ # What is Infinite Vue (ivue) ?
2
+
3
+ ## The Purpose of Infinite Vue
4
+
5
+ With the development of React hooks and Vue following in its footsteps with introduction of Vue 3 Composition API, the ecosystem has moved away from Options API.
6
+
7
+ While providing greater flexibility and composability the Composition API has its own downsides, one of them is having to use `.value` to refer to the reactive variables which makes the development process more clunky when the App reaches a certain size.
8
+
9
+ As some of you may know, `reactvity-transform` macros were an attempt to mitigate those issues, which turned out to create even more issues, and was discontinued.
10
+
11
+ See: https://vuejs.org/guide/extras/reactivity-transform.html
12
+
13
+
14
+ ::: info IVUE UNIFIES COMPOSITION & OPTIONS API VIA CLASS BASED ARCHITECTURE
15
+ &mdash;&nbsp; ivue mitigates the downsides of both Composition API and Options API, uses only their strengths and brings back Object Oriented Programming to allow the development of complex and scallable apps.
16
+
17
+ &mdash;&nbsp; ivue is fully interoperable with Composition API and does not work against it but rather with it, so you can use all of ecosystems composables seamlessly.
18
+
19
+ &mdash;&nbsp; ivue also offers a set of functions and utility types to make extensible & exportable props defaults, extensible emits and extensible slots possible.
20
+ :::
21
+
22
+ ## Classes are Back with Full Vue 3 Compatibility & Beyond
23
+
24
+ With failed implementations of classes in React and also failed implementations using class components in Vue 2 / 3, the ecosystem decided that classes are bad and moved to pure procedural designs, while procedural programming has its strength, it also comes with its own weaknesses, like lack of inheritance and true composition.
25
+
26
+ ::: info IVUE IS DIFFERENT
27
+ &mdash; &nbsp;ivue does NOT inherit from a base class<br />
28
+ &mdash; &nbsp;ivue does NOT use decorators to achieve its objectives<br />
29
+ &mdash; &nbsp;ivue does NOT alter Vue 3 underlying behavior<br />
30
+ &mdash; &nbsp;ivue is NOT class components (though you can build components with it)<br />
31
+ :::
32
+
33
+ ## Infinite Vue Achitecture
34
+
35
+ ivue mimicks native JavaScript / TypeScript class implementation by extending descriptors up the whole prototype chain thus supporting classical inheritance.
36
+
37
+ By using TypeScript we are able to infer the arguments of the main `ivue` initializer function and pass the arguments to the constructor.
38
+
39
+ `ivue` initializer function returns a reactive object with getters converted to computeds and adds `.toRefs()` method to the object, `.toRefs()` allows the object to be converted to native composable structure, so it can interoperate as a composable if needed.
40
+
41
+
42
+ ## When to use Infinite Vue?
43
+
44
+ When complexity of your app or components becomes very high using **ivue** can become a natural choice to deal with that complexity. Because there is no `.value` in ivue, everything is simply a reactive object of unwrapped Refs.
45
+
@@ -0,0 +1,16 @@
1
+ <script lang="ts" setup>
2
+ import { createContentLoader } from 'vitepress'
3
+ import Counter from '../components/examples/Counter.vue'
4
+
5
+ </script>
6
+
7
+ # Basic Usage
8
+
9
+ Classic Counter example built with `ivue`:
10
+
11
+ <<< @/components/examples/Counter.vue{vue}
12
+ ```ts
13
+ {{counterContent}}
14
+ ```
15
+ Result:
16
+ <Counter />
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "vitepress-project",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vitepress dev docs",
7
+ "build": "vitepress build docs",
8
+ "serve": "vitepress serve docs",
9
+ "preview": "vitepress build docs && vitepress serve docs",
10
+ "deploy": "node scripts/gh-pages-deploy.js"
11
+ },
12
+ "devDependencies": {
13
+ "cpy-cli": "^4.2.0",
14
+ "execa": "^8.0.0",
15
+ "vitepress": "^1.0.0",
16
+ "vue": "3.2.44",
17
+ "vue-dd": "1.6.7",
18
+ "eslint": "^8.10.0",
19
+ "eslint-config-prettier": "^8.1.0",
20
+ "eslint-plugin-import": "^2.29.1",
21
+ "eslint-plugin-vue": "^9.14.1",
22
+ "@typescript-eslint/eslint-plugin": "^5.10.0",
23
+ "@typescript-eslint/parser": "^5.10.0",
24
+ "typescript": "^4.5.4",
25
+ "vite-plugin-dynamic-import": "^1.5.0",
26
+ "vite-tsconfig-paths": "^4.3.2"
27
+ },
28
+ "pnpm": {
29
+ "peerDependencyRules": {
30
+ "ignoreMissing": [
31
+ "@algolia/client-search"
32
+ ]
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,34 @@
1
+ import { execa } from 'execa'
2
+ // import fs from "fs"
3
+
4
+ (async () => {
5
+ try {
6
+ var datetime = new Date();
7
+
8
+ // this will save potential changes that might get lost if you didn't commit them
9
+ await execa("git", ["stash", "push", "-m", "before deploy on " + datetime]);
10
+ await execa("git", ["checkout", "--orphan", "gh-pages"]);
11
+
12
+ console.log("Building...")
13
+
14
+ await execa("yarn", ["run", "build"])
15
+ // Understand if it's dist or build folder
16
+ const folderName = "docs/.vitepress/dist"
17
+ await execa("git", ["--work-tree", folderName, "add", "--all"])
18
+ await execa("git", ["--work-tree", folderName, "commit", "-m", "gh-pages"])
19
+
20
+ console.log("Pushing to gh-pages...")
21
+
22
+ await execa("git", ["push", "origin", "HEAD:gh-pages", "--force"])
23
+ await execa("rm", ["-r", folderName])
24
+ await execa("git", ["fetch"])
25
+ await execa("git", ["checkout", "-f", "main"])
26
+ await execa("git", ["branch", "-D", "gh-pages"])
27
+
28
+ console.log("Successfully deployed")
29
+ } catch (e) {
30
+
31
+ console.log(e.message)
32
+ process.exit(1)
33
+ }
34
+ })();
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
@@ -0,0 +1,20 @@
1
+ import { fileURLToPath, URL } from 'node:url'
2
+
3
+ import { defineConfig } from 'vite'
4
+
5
+
6
+ // https://vitejs.dev/config/
7
+ export default defineConfig({
8
+
9
+ resolve: {
10
+ alias: {
11
+ '@': fileURLToPath(new URL('./src', import.meta.url))
12
+ }
13
+ },
14
+ server: {
15
+ fs: {
16
+ allow: ['..']
17
+ }
18
+ },
19
+
20
+ })
package/index.html CHANGED
@@ -1,11 +1,12 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <meta charset="UTF-8">
5
- <link rel="icon" href="/favicon.ico">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Vite App</title>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>MyComponent</title>
8
8
  </head>
9
+
9
10
  <body>
10
11
  <div id="app"></div>
11
12
  <script type="module" src="./demo/main.ts"></script>
package/package.json CHANGED
@@ -1,68 +1,57 @@
1
1
  {
2
2
  "name": "ivue",
3
- "version": "0.1.11",
4
- "description": "ivue – Infinite Vue. Advanced State Management & Class Architecture for Vue 3+.",
3
+ "version": "1.0.0",
4
+ "description": "Infinite Vue – Class Based Architecture for Vue 3",
5
+ "type": "module",
5
6
  "exports": {
6
7
  ".": {
7
8
  "require": "./dist/index.umd.js",
8
9
  "import": "./dist/index.es.js",
9
- "types": "./dist/src/index.d.ts",
10
- "style": "./dist/style.css"
10
+ "types": "./dist/src/index.d.ts"
11
11
  }
12
12
  },
13
13
  "main": "./dist/index.umd.js",
14
14
  "module": "./dist/index.es.js",
15
15
  "types": "./dist/src/index.d.ts",
16
16
  "scripts": {
17
- "dev": "vite",
18
- "build": "run-p type-check build-only",
19
- "preview": "vite preview",
20
- "test": "vitest --reporter=verbose",
21
- "build-only": "rm -rf ./dist/* && vite build",
22
- "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
23
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
17
+ "dev": "vite dev --host",
18
+ "test": "vitest --coverage.enabled=true --reporter=verbose --ui",
19
+ "coverage": "vitest run --coverage",
20
+ "cypress": "cypress run --component",
21
+ "cypress:headed": "cypress run --component --browser chrome --headed --no-exit",
22
+ "build": "vite build"
24
23
  },
25
24
  "peerDependencies": {
26
- "vue": "^3.0.0",
27
- "vue-router": "^4.0.0"
25
+ "vue": "^3.0.0"
28
26
  },
29
27
  "devDependencies": {
30
- "@rushstack/eslint-patch": "^1.2.0",
31
- "@tsconfig/node18": "^2.0.1",
32
- "@types/inversify": "^2.0.33",
33
- "@types/jsdom": "^21.1.1",
34
- "@types/node": "^18.16.8",
35
- "@vitejs/plugin-vue": "^4.2.3",
36
- "@vitejs/plugin-vue-jsx": "^3.0.1",
37
- "@vue/eslint-config-typescript": "^11.0.3",
38
- "@vue/test-utils": "^2.3.2",
39
- "@vue/tsconfig": "^0.4.0",
40
- "@vueuse/core": "^10.1.2",
41
- "babel-jest": "^29.5.0",
42
- "eslint": "^8.39.0",
43
- "eslint-plugin-vue": "^9.11.0",
44
- "infinite-vue": "^1.4.5",
45
- "inversify": "^6.0.1",
46
- "inversify-inject-decorators": "^3.1.0",
47
- "ivue": "npm:infinite-vue",
48
- "jsdom": "^22.0.0",
49
- "lodash": "^4.17.21",
50
- "npm-run-all": "^4.1.5",
51
- "pinia": "^2.0.36",
52
- "reflect-metadata": "^0.1.13",
53
- "rollup-plugin-terser": "^7.0.2",
54
- "transform-class-properties": "^1.0.0-beta",
55
- "tree-model": "^1.0.7",
56
- "typescript": "~5.0.4",
57
- "vite": "^4.3.5",
58
- "vite-plugin-dts": "^2.3.0",
59
- "vitest": "^0.31.0",
60
- "vue": "^3.3.4",
61
- "vue-dd": "^1.6.4",
62
- "vue-router": "^4.2.4",
63
- "vue-tsc": "^1.6.4",
64
- "vue-use": "^0.2.0",
65
- "wait-for-expect": "^3.0.2"
28
+ "@cypress/vite-dev-server": "^5.0.2",
29
+ "@cypress/vue": "^5.0.3",
30
+ "@typescript-eslint/eslint-plugin": "^5.10.0",
31
+ "@typescript-eslint/parser": "^5.10.0",
32
+ "@vitejs/plugin-vue": "^4.0.0",
33
+ "@vitest/coverage-c8": "^0.26.2",
34
+ "@vitest/coverage-v8": "^2.0.5",
35
+ "@vitest/ui": "^2.0.5",
36
+ "@vue/test-utils": "^2.2.7",
37
+ "cpy-cli": "^4.2.0",
38
+ "cypress": "^12.3.0",
39
+ "eslint": "^8.10.0",
40
+ "eslint-config-prettier": "^8.1.0",
41
+ "eslint-plugin-cypress": "^2.15.1",
42
+ "eslint-plugin-import": "^2.29.1",
43
+ "eslint-plugin-storybook": "^0.6.12",
44
+ "eslint-plugin-vue": "^9.14.1",
45
+ "jsdom": "^21.0.0",
46
+ "typescript": "^4.5.4",
47
+ "vite": "^4.0.4",
48
+ "vite-plugin-dts": "^1.7.1",
49
+ "vite-plugin-dynamic-import": "^1.5.0",
50
+ "vite-plugin-libcss": "^1.0.5",
51
+ "vite-tsconfig-paths": "^4.3.2",
52
+ "vitest": "^2.0.5",
53
+ "vue": "^3.2.45",
54
+ "vue-router": "^4.1.6"
66
55
  },
67
56
  "repository": {
68
57
  "type": "git",
@@ -74,22 +63,18 @@
74
63
  "email": "ekalashnikov@gmail.com"
75
64
  },
76
65
  "keywords": [
66
+ "Vue",
67
+ "Vue 3",
68
+ "VueJs",
77
69
  "ivue",
78
- "vuex",
79
- "mobx",
80
- "redux",
81
- "vue",
82
- "react",
83
- "vuejs",
84
- "vuex",
85
- "pinia",
86
- "state management",
87
- "reactive"
70
+ "class",
71
+ "reactive class",
72
+ "class composable",
73
+ "vue class based architecture"
88
74
  ],
89
75
  "author": {
90
76
  "name": "Evgeny Kalashnikov",
91
77
  "email": "ekalashnikov@gmail.com"
92
78
  },
93
- "license": "MIT",
94
- "dependencies": {}
79
+ "license": "MIT"
95
80
  }