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
@@ -1,18 +0,0 @@
1
- import { TMessage } from './TMessage'
2
- import { TUser } from './TUser'
3
- import { use } from '@/index'
4
-
5
- export class $TRouter {
6
-
7
- get user () { return use(TUser) }
8
-
9
- get message () { return use(TMessage) }
10
-
11
- }
12
-
13
- export class TRouter {
14
-
15
- get $ () { return use($TRouter) }
16
-
17
- test = 1
18
- }
@@ -1,19 +0,0 @@
1
- import { use } from '@/kernel'
2
- import { TApp } from "./TApp";
3
-
4
- export class TUser {
5
-
6
- get app () { return use(TApp) }
7
-
8
- email = 'a'
9
- token = ''
10
-
11
- get upperCaseEmail () {
12
- return String(this.email).toUpperCase()
13
- }
14
-
15
- get dashedUppercaseEmail () {
16
- return this.upperCaseEmail.split('')
17
- }
18
-
19
- }
@@ -1,86 +0,0 @@
1
-
2
- import { onActivated, onDeactivated, onMounted, onUnmounted, onUpdated, watch } from 'vue';
3
- import { init, use, Traits } from '@/index';
4
- import { UseApp } from '@/App/Traits/UseApp';
5
- import { UseCapsule } from '@/traits/UseCapsule';
6
- import { UseQuasar } from '@/App/Traits/UseQuasar';
7
- import { UseEmit } from '@/traits/UseEmit';
8
- import { UseMounting } from '@/traits/UseMounting';
9
- import { UseVue } from '@/traits/UseVue';
10
- import { UseRouting } from '@/traits/UseRouting';
11
- import { UseRouter } from '@/traits/UseRouter';
12
- import { Mouse } from './Mouse'
13
-
14
-
15
- export class $Test {
16
-
17
- constructor (public self: Test) {}
18
-
19
- mouse!: Mouse
20
- init () {
21
-
22
- // const { x, y } = useMouse()
23
-
24
- ({ x: this.x, y: this.y } = use(Mouse).toRefs())
25
- // ({ x: this.x, y: this.y } = refs(use(Mouse)))
26
- this.mouse = use(Mouse)
27
-
28
- // this.mouse = use(Mouse)
29
- }
30
-
31
- words = 'saying some words...'
32
-
33
- say (i: number) {
34
- console.log(this.words)
35
- }
36
-
37
-
38
- // get x () { return this.mouse.x }
39
-
40
- // get y () { return this.mouse.y }
41
-
42
- x = 0
43
- y = 0
44
- }
45
- Traits($Test, [UseApp])
46
- export interface $Test extends UseApp {}
47
-
48
-
49
- export class Test {
50
-
51
- capsule = $Test // detached
52
- constructor (emit: any, private n: number) {
53
- this.useCapsule(arguments)
54
- this.$emit = emit
55
- }
56
-
57
- async init () {
58
- watch(this, newValue => {
59
- console.log('newValue', newValue)
60
- })
61
- }
62
-
63
- get x () {
64
- console.log('this.$.x', this.$.x)
65
- return this.$.mouse.x
66
- }
67
-
68
- get y () {
69
- console.log('this.$.y', this.$.y)
70
- return this.$.mouse.y
71
- }
72
-
73
- get email () {
74
- return this.$.app.router.$.user.email
75
- }
76
-
77
- beforeMount () {
78
- console.log('# ' + this.n + ' before mounting...')
79
- }
80
-
81
- mounted () {
82
- console.log('mounted!!!')
83
- }
84
- }
85
- Traits(Test, [UseCapsule, UseMounting, UseEmit])
86
- export interface Test extends UseCapsule, UseMounting, UseEmit {}
@@ -1,82 +0,0 @@
1
- import { watch, onMounted, onUnmounted, ref, computed } from "vue";
2
- import { App } from "@/App/App";
3
- import { TRouter } from "./TRouter";
4
-
5
- import { use, init } from "@/index";
6
- import { TApp } from "./TApp";
7
-
8
- export const useField = () => {
9
-
10
- const app = computed(() => {
11
- return use(TApp)
12
- })
13
-
14
- const router = computed(() => {
15
- return use(TRouter)
16
- })
17
-
18
- const _prop = ref(0)
19
-
20
- const x = ref(0)
21
- const y = ref(1)
22
-
23
- const interceptableValue = ref('testing')
24
- const runWithInterceptResult = ref('')
25
-
26
- function runWithIntercept (variable = '') {
27
- return interceptableValue.value
28
- }
29
-
30
- function interceptable () {
31
- console.log('interceptable')
32
- }
33
-
34
- function increase () {
35
- _prop.value++
36
- }
37
-
38
- const email = computed(() => {
39
- return app.value.user.email
40
- })
41
-
42
- const prop = computed({
43
- get () {
44
- _prop.value
45
- },
46
- set (v) {
47
- _prop.value = v
48
- }
49
- })
50
-
51
- const update = function (event) {
52
-
53
- }
54
-
55
- function init () {}
56
-
57
-
58
- function privateFunc () {
59
- alert(prop.value)
60
- }
61
-
62
- watch(() => x.value, n => {
63
- console.log('n', n)
64
- })
65
-
66
- return {
67
- app,
68
- router,
69
- _prop,
70
- prop,
71
- x,
72
- y,
73
- interceptable,
74
- runWithInterceptResult,
75
- runWithIntercept,
76
- increase,
77
- privateFunc,
78
- update,
79
- init,
80
- email
81
- }
82
- }
@@ -1,57 +0,0 @@
1
-
2
- import { TAuth } from './TAuth'
3
- import { TApp } from "./TApp";
4
- import { TMessage } from './TMessage'
5
- import { TRouter } from './TRouter'
6
- import { ParentIVueTests } from "./ParentIVueTests";
7
- import { onUnmounted, toRaw, watch, onBeforeUnmount, computed, ref } from "vue";
8
- import { generateHugeArray } from "@/App/Generators/generators";
9
- import { TField } from "./TField";
10
- import { use, init, IVUE, unraw, before } from "@/index";
11
- import { useField } from './useField'
12
- import { App } from '@/App/App';
13
-
14
-
15
- export function useIVueTests () {
16
-
17
- const app = use(TApp)
18
- const transientFields = ref([])
19
-
20
- const timeTaken = ref(0)
21
-
22
- timeTaken.value = 0
23
-
24
- const start = Date.now();
25
-
26
- // setTimeout(() => {
27
-
28
- for (let i = 0; i < 50_000; i++) {
29
- transientFields.value.push(useField())
30
- }
31
-
32
- timeTaken.value = Date.now() - start;
33
-
34
- setInterval(() => {
35
- transientFields.value[10].x++
36
- }, 1000)
37
- // })
38
-
39
- function msToTime (ms: number) {
40
- const seconds = (ms / 1000)
41
- const minutes = (ms / (1000 * 60));
42
- const hours = (ms / (1000 * 60 * 60));
43
- const days = (ms / (1000 * 60 * 60 * 24));
44
-
45
- if (seconds < 60) return seconds.toFixed(3) + " Seconds";
46
- else if (minutes < 60) return minutes.toFixed(1) + " Minutes";
47
- else if (hours < 24) return hours.toFixed(1) + " Hrs";
48
- else return days.toFixed(1) + " Days"
49
- }
50
-
51
- return {
52
- app,
53
- transientFields,
54
- timeTaken,
55
- msToTime
56
- }
57
- }
package/dist/favicon.ico DELETED
Binary file