Skip to content

Commit 36c8b57

Browse files
authored
feat: merge packages and build and test for composition-api plugin and v3 (#239)
* feat: Vue3 support - 1.0.0-beta.x (#75) * updated to vue-next * vue3 examples and alpha version * update readme with v3 support * v1.0.0-alpha.2 * v1.0.0-alpha.3 * v1.0.0-alpha.5 * build(deps): update all dependencies to latest * v1.0.0-alpha.7 * build(deps): update all dependencies to latest * chore: update example and readme * v1.0.0-alpha.8 * feat(validation): Add validation * improve validation * improvement on validate and add example * fix validate example * devops(deps): upgrade all dependencies to the latest * feat add validation * build(deps-dev): bump packages * build(deps-dev): bump packages * fix build * bump(deps): [email protected] * fix tests for core * adding test to web * add more tests and fix validation tests * fix tests 🎉 * merge @vue-composable/core and @vue-composable/web into vue-composable package * fix tests for vue-composable package * update package homepage * fix axios tests * add vue2 tests to circleci * build: fix build * update config * add build2 * few changes * fix building for 2 and 3 * kinda working * fix tests * add build-v2 job * more config * config * config * config.. * publish script * stuff * tests * fix build
1 parent 83de6bb commit 36c8b57

File tree

167 files changed

+9723
-1295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+9723
-1295
lines changed

.circleci/config.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@ jobs:
2727
- ~/.cache/yarn
2828
key: v1-dependencies-{{ checksum "yarn.lock" }}
2929

30+
- run:
31+
name: Run build v2
32+
command: yarn build --version=2
33+
34+
- run:
35+
name: "Vue2 tests"
36+
command: yarn test --ci --runInBand
37+
environment:
38+
- VUE: 2
39+
3040
- run:
3141
name: Run build
3242
command: yarn build
33-
3443
- run:
3544
name: "Run Jest and Collect Coverage Reports"
3645
command: yarn test --coverage --ci --runInBand --reporters=default --reporters=jest-junit

__tests__/setupTest.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
const Vue = require('vue/dist/vue.common');
1+
if (__VUE_2__) {
2+
const Vue = require("vue/dist/vue.common");
23

3-
const plugin = require('@vue/composition-api').default;
4+
const plugin = require("@vue/composition-api").default;
45

5-
Vue.config.productionTip = false;
6-
Vue.config.devtools = false;
7-
Vue.use(plugin);
6+
Vue.config.productionTip = false;
7+
Vue.config.devtools = false;
8+
Vue.use(plugin);
9+
}

docs/.vuepress/components/CssVariablesExample.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88
<input type="text" id="foreground-value" v-model="foreground" />
99
</div>
1010

11-
<div ref="textDiv" class="text" style="color: var(--color-foreground)">
11+
<div ref="textDiv" class="text" style="color: var(--color-foreground)">
1212
<span v-if="observing">I am a text with the following color:</span>
1313
<span v-else>My color will be updated but not my label:</span>
1414
{{ foreground }}
1515
</div>
1616

1717
<div>
18-
<button type="button" @click="stop" :disabled="!observing">Stop observing</button>
19-
<button type="button" @click="resume" :disabled="observing">Resume observing</button>
18+
<button type="button" @click="stop" :disabled="!observing">
19+
Stop observing
20+
</button>
21+
<button type="button" @click="resume" :disabled="observing">
22+
Resume observing
23+
</button>
2024
</div>
2125
</div>
2226
</template>

docs/api/axios.api.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,38 @@
33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
55
```ts
6-
7-
import { AxiosInstance } from 'axios';
8-
import { AxiosRequestConfig } from 'axios';
9-
import { AxiosResponse } from 'axios';
10-
import { PromiseResultFactory } from '@vue-composable/core';
11-
import { Ref } from '@vue/composition-api';
6+
import { AxiosInstance } from "axios";
7+
import { AxiosRequestConfig } from "axios";
8+
import { AxiosResponse } from "axios";
9+
import { ComputedRef } from "@vue/runtime-core";
10+
import { PromiseResultFactory } from "vue-composable";
11+
import { Ref } from "@vue/runtime-core";
1212

1313
// Warning: (ae-forgotten-export) The symbol "AxiosReturn" needs to be exported by the entry point index.d.ts
1414
//
1515
// @public (undocumented)
16-
export function useAxios<TData = any>(throwException?: boolean): AxiosReturn<TData>;
16+
export function useAxios<TData = any>(
17+
throwException?: boolean
18+
): AxiosReturn<TData>;
1719

1820
// @public (undocumented)
19-
export function useAxios<TData = any>(url: string, config?: AxiosRequestConfig, throwException?: boolean): AxiosReturn<TData>;
21+
export function useAxios<TData = any>(
22+
url: string,
23+
config?: AxiosRequestConfig,
24+
throwException?: boolean
25+
): AxiosReturn<TData>;
2026

2127
// @public (undocumented)
22-
export function useAxios<TData = any>(url: string, throwException?: boolean): AxiosReturn<TData>;
28+
export function useAxios<TData = any>(
29+
url: string,
30+
throwException?: boolean
31+
): AxiosReturn<TData>;
2332

2433
// @public (undocumented)
25-
export function useAxios<TData = any>(config?: AxiosRequestConfig, throwException?: boolean): AxiosReturn<TData>;
26-
34+
export function useAxios<TData = any>(
35+
config?: AxiosRequestConfig,
36+
throwException?: boolean
37+
): AxiosReturn<TData>;
2738

2839
// (No @packageDocumentation comment for this package)
29-
3040
```

docs/api/core.api.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
55
```ts
6-
import { Ref } from "@vue/composition-api";
6+
import { ComputedRef } from "@vue/runtime-core";
7+
import { Ref } from "@vue/runtime-core";
8+
import { UnwrapRef } from "@vue/runtime-core";
79

810
// @public (undocumented)
911
export interface ArrayPaginationResult<T extends Array<any>>
1012
extends PaginationResult {
1113
// (undocumented)
12-
result: Readonly<Ref<T>>;
14+
result: ComputedRef<T>;
1315
}
1416

1517
// Warning: (ae-forgotten-export) The symbol "I18nExtractLocale" needs to be exported by the entry point index.d.ts
@@ -257,9 +259,6 @@ export function setI18n<
257259
// @public (undocumented)
258260
export function unwrap<T>(o: RefTyped<T>): T;
259261

260-
// @public (undocumented)
261-
export type UnwrapRef<T> = T extends Ref<infer R> ? R : T;
262-
263262
// @public (undocumented)
264263
export function useArrayPagination<T extends Array<TR>, TR>(
265264
array: RefTyped<T>,
@@ -355,7 +354,7 @@ export function useCancellablePromise<T extends Promise<TR>, TR>(
355354
export function useDateNow(
356355
options?: NowOptions
357356
): {
358-
now: import("@vue/composition-api").Ref<number>;
357+
now: import("@vue/reactivity").Ref<number>;
359358
remove: () => void;
360359
};
361360

@@ -409,7 +408,7 @@ export function useI18n<T = i18n>(): i18nResult<string[], T>;
409408
export function useNow(
410409
options?: NowOptions & UseNowOptions
411410
): {
412-
now: import("@vue/composition-api").Ref<number>;
411+
now: import("@vue/reactivity").Ref<number>;
413412
remove: () => void;
414413
};
415414

@@ -441,7 +440,7 @@ export type UsePathNotFoundReturn<TSource> = (
441440
export function usePerformanceNow(
442441
options?: NowOptions
443442
): {
444-
now: import("@vue/composition-api").Ref<number>;
443+
now: import("@vue/reactivity").Ref<number>;
445444
remove: () => void;
446445
};
447446

0 commit comments

Comments
 (0)