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/demo/tests/TRouter.ts
DELETED
|
@@ -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
|
-
}
|
package/demo/tests/TUser.ts
DELETED
|
@@ -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
|
-
}
|
package/demo/tests/Test.ts
DELETED
|
@@ -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 {}
|
package/demo/tests/useField.ts
DELETED
|
@@ -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
|