Skip to content

Commit ac9e78f

Browse files
committed
fix: typings and publish script
1 parent 21334ff commit ac9e78f

File tree

5 files changed

+25
-58
lines changed

5 files changed

+25
-58
lines changed

docs/api/vue-composable.api.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
```ts
66
import { Ref } from "@vue/composition-api";
7-
import { Ref as Ref_2 } from "vue3";
87

98
// @public (undocumented)
109
export interface ArrayPaginationResult<T extends Array<any>>
@@ -642,16 +641,14 @@ export function refShared<T = any>(
642641
defaultValue?: RefTyped<T>,
643642
id?: string
644643
):
645-
| import("@vue/composition-api/dist/reactivity/ref").Ref<
644+
| Ref<
646645
| T
647-
| (T extends import("@vue/composition-api/dist/reactivity/ref").Ref<
648-
infer V
649-
>
646+
| (T extends Ref<infer V>
650647
? V
651648
: import("@vue/composition-api/dist/reactivity").UnwrapRef<T>)
652649
| undefined
653650
>
654-
| Ref_2<RefTyped<T>>;
651+
| Ref<RefTyped<T>>;
655652

656653
// @public (undocumented)
657654
export type RefSharedMessage<T = any> =
@@ -1522,13 +1519,11 @@ export function useSharedRef<T = any>(
15221519
): {
15231520
supported: boolean;
15241521
id: number;
1525-
data: Ref_2<T>;
1526-
master: import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>;
1527-
mind: import("@vue/composition-api/dist/reactivity/ref").Ref<SharedRefMind>;
1528-
editable: Readonly<
1529-
import("@vue/composition-api/dist/reactivity/ref").Ref<boolean>
1530-
>;
1531-
targets: import("@vue/composition-api/dist/reactivity/ref").Ref<number[]>;
1522+
data: Ref<T>;
1523+
master: Ref<boolean>;
1524+
mind: Ref<SharedRefMind>;
1525+
editable: Readonly<Ref<boolean>>;
1526+
targets: Ref<number[]>;
15321527
ping: () => void;
15331528
setMind: (t: SharedRefMind) => void;
15341529
addListener: (

packages/vue-composable/src/misc/sharedRef.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
import { ref, watch, onUnmounted, computed, getCurrentInstance } from "../api";
1+
import {
2+
ref,
3+
Ref,
4+
watch,
5+
onUnmounted,
6+
computed,
7+
getCurrentInstance
8+
} from "../api";
29
import { PASSIVE_EV, isObject, RefTyped, isClient } from "../utils";
310
import { useBroadcastChannel, BroadcastMessageEvent } from "../web";
4-
import { Ref } from "vue3";
511

612
export const enum RefSharedMessageType {
713
INIT,

scripts/build-2.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

scripts/build-3.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/publish.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ const buildTargets = targets.length > 0 ? targets : allTargets;
1515
async function publish(package, targetVersion) {
1616
assert([2, 3].includes(targetVersion));
1717

18+
const mainPkg = require(path.resolve("package.json"));
19+
1820
const pkgDir = resolvePkgDir(package);
1921
await build(package, targetVersion);
2022
const pkg = require(`${pkgDir}/package.json`);
2123

22-
const currentMinor = +pkg.version.split(".").slice(-1);
23-
const majorVersion = pkg.version.split("-")[0];
24+
const currentMinor = +mainPkg.version.split(".").slice(-1);
25+
const majorVersion = mainPkg.version.split("-")[0];
2426

2527
const tag = targetVersion === 3 ? "next" : false;
2628
const tempVersion = targetVersion === 3 ? "alpha" : "dev";
@@ -33,18 +35,20 @@ async function publish(package, targetVersion) {
3335
try {
3436
const args = ["publish", "--access public"];
3537
if (tag) {
36-
args.push(`--tag ${next}`);
38+
args.push(`--tag ${tag}`);
3739
}
3840

41+
console.log("publishing for ", package, version, tag || "");
42+
3943
const otp = await prompt({
4044
type: "input",
4145
name: "otp",
42-
message: "OTP"
46+
message: "Enter OTP"
4347
});
4448

4549
args.push(`--otp`, otp.otp);
4650

47-
await execa("npm", ["publish", "--access public", tag && `--tag ${next}`], {
51+
await execa("yarn", args, {
4852
stdio: "inherit",
4953
cwd: pkgDir
5054
});

0 commit comments

Comments
 (0)