reactjs-signal 1.0.0 → 1.0.1
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/{src/index.ts → dist/index.d.ts} +22 -170
- package/dist/index.js +1 -0
- package/package.json +6 -2
- package/.github/commit-convention.md +0 -95
- package/.github/workflows/main.yml +0 -21
- package/.github/workflows/release.yml +0 -29
- package/tsconfig.json +0 -26
- package/tsup.config.ts +0 -12
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { IWritableSignal, ISignal, Effect, EffectScope, Dependency, Computed } from 'alien-signals';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
4
5
|
* React Alien Signals is a **TypeScript** library that provides hooks built on top of [Alien Signals](https://github.com/stackblitz/alien-signals).
|
|
@@ -7,27 +8,10 @@
|
|
|
7
8
|
* @module reactjs-signal
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
-
computed as alienComputed,
|
|
12
|
-
effect as alienEffect,
|
|
13
|
-
effectScope as alienEffectScope,
|
|
14
|
-
signal as alienSignal,
|
|
15
|
-
unstable as alienUnstable,
|
|
16
|
-
type Effect,
|
|
17
|
-
type Computed,
|
|
18
|
-
type Dependency,
|
|
19
|
-
type EffectScope,
|
|
20
|
-
type ISignal,
|
|
21
|
-
type IWritableSignal,
|
|
22
|
-
} from 'alien-signals';
|
|
23
|
-
import { useEffect, useMemo, useState, useSyncExternalStore } from 'react';
|
|
24
|
-
|
|
25
11
|
declare class AsyncComputed<T = any> extends Computed {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
update(): Promise<boolean>;
|
|
12
|
+
get(): Promise<T>;
|
|
13
|
+
update(): Promise<boolean>;
|
|
29
14
|
}
|
|
30
|
-
|
|
31
15
|
/**
|
|
32
16
|
* Creates a writable Alien Signal.
|
|
33
17
|
*
|
|
@@ -41,10 +25,7 @@ declare class AsyncComputed<T = any> extends Computed {
|
|
|
41
25
|
* @param {T} initialValue - The initial value of the signal.
|
|
42
26
|
* @returns {IWritableSignal<T>} The created Alien Signal.
|
|
43
27
|
*/
|
|
44
|
-
|
|
45
|
-
return alienSignal<T>(initialValue);
|
|
46
|
-
}
|
|
47
|
-
|
|
28
|
+
declare function createSignal<T>(initialValue: T): IWritableSignal<T>;
|
|
48
29
|
/**
|
|
49
30
|
* Creates a computed Alien Signal based on a getter function.
|
|
50
31
|
*
|
|
@@ -58,10 +39,7 @@ export function createSignal<T>(initialValue: T): IWritableSignal<T> {
|
|
|
58
39
|
* @param {() => T} fn - A getter function returning a computed value.
|
|
59
40
|
* @returns {ISignal<T>} The created computed signal.
|
|
60
41
|
*/
|
|
61
|
-
|
|
62
|
-
return alienComputed<T>(fn);
|
|
63
|
-
}
|
|
64
|
-
|
|
42
|
+
declare function createComputed<T>(fn: () => T): ISignal<T>;
|
|
65
43
|
/**
|
|
66
44
|
* Creates a side effect in Alien Signals.
|
|
67
45
|
*
|
|
@@ -77,10 +55,7 @@ export function createComputed<T>(fn: () => T): ISignal<T> {
|
|
|
77
55
|
* @param {() => T} fn - A function that will run whenever its tracked signals update.
|
|
78
56
|
* @returns {Effect<T>} The created effect object.
|
|
79
57
|
*/
|
|
80
|
-
|
|
81
|
-
return alienEffect(fn);
|
|
82
|
-
}
|
|
83
|
-
|
|
58
|
+
declare function createEffect<T>(fn: () => T): Effect<T>;
|
|
84
59
|
/**
|
|
85
60
|
* Creates an Alien Signals effect scope. This scope can manage multiple effects,
|
|
86
61
|
* allowing you to stop or start them together.
|
|
@@ -95,10 +70,7 @@ export function createEffect<T>(fn: () => T): Effect<T> {
|
|
|
95
70
|
*
|
|
96
71
|
* @returns {EffectScope} The created effect scope.
|
|
97
72
|
*/
|
|
98
|
-
|
|
99
|
-
return alienEffectScope();
|
|
100
|
-
}
|
|
101
|
-
|
|
73
|
+
declare function createSignalScope(): EffectScope;
|
|
102
74
|
/**
|
|
103
75
|
* Creates an async computed signal in Alien Signals. The getter is an async generator
|
|
104
76
|
* that yields dependencies and finally resolves to a computed value.
|
|
@@ -116,12 +88,7 @@ export function createSignalScope(): EffectScope {
|
|
|
116
88
|
* @returns {AsyncComputed<T>} The created async computed signal.
|
|
117
89
|
* @experimental
|
|
118
90
|
*/
|
|
119
|
-
|
|
120
|
-
getter: () => AsyncGenerator<Dependency, T>,
|
|
121
|
-
): AsyncComputed<T> {
|
|
122
|
-
return alienUnstable.asyncComputed<T>(getter);
|
|
123
|
-
}
|
|
124
|
-
|
|
91
|
+
declare function unstable_createAsyncComputed<T>(getter: () => AsyncGenerator<Dependency, T>): AsyncComputed<T>;
|
|
125
92
|
/**
|
|
126
93
|
* Creates an async effect in Alien Signals. The function is an async generator
|
|
127
94
|
* that yields dependencies as they are discovered.
|
|
@@ -138,16 +105,7 @@ export function unstable_createAsyncComputed<T>(
|
|
|
138
105
|
* @param {() => AsyncGenerator<Dependency, T>} fn - An async generator returning dependencies.
|
|
139
106
|
* @returns {Promise<T>} The created async effect object.
|
|
140
107
|
*/
|
|
141
|
-
|
|
142
|
-
fn: () => AsyncGenerator<Dependency, T>,
|
|
143
|
-
): Promise<T> {
|
|
144
|
-
const eff = alienUnstable.asyncEffect(fn);
|
|
145
|
-
|
|
146
|
-
// Immediately run the effect and return its promise
|
|
147
|
-
const final = await eff.run();
|
|
148
|
-
return final;
|
|
149
|
-
}
|
|
150
|
-
|
|
108
|
+
declare function unstable_createAsyncEffect<T>(fn: () => AsyncGenerator<Dependency, T>): Promise<T>;
|
|
151
109
|
/**
|
|
152
110
|
* Creates a computed array signal in Alien Signals, deriving a reactive
|
|
153
111
|
* array from an original signal array.
|
|
@@ -167,13 +125,7 @@ export async function unstable_createAsyncEffect<T>(
|
|
|
167
125
|
* @returns {Readonly<O[]>} A proxied array signal.
|
|
168
126
|
* @experimental
|
|
169
127
|
*/
|
|
170
|
-
|
|
171
|
-
arr: ISignal<I[]>,
|
|
172
|
-
getGetter: (itemSignal: ISignal<I>, index: number) => () => O,
|
|
173
|
-
): Readonly<O[]> {
|
|
174
|
-
return alienUnstable.computedArray<I, O>(arr, getGetter);
|
|
175
|
-
}
|
|
176
|
-
|
|
128
|
+
declare function unstable_createComputedArray<I, O>(arr: ISignal<I[]>, getGetter: (itemSignal: ISignal<I>, index: number) => () => O): Readonly<O[]>;
|
|
177
129
|
/**
|
|
178
130
|
* Creates a computed Set signal in Alien Signals that tracks changes
|
|
179
131
|
* to a source Set signal.
|
|
@@ -189,10 +141,7 @@ export function unstable_createComputedArray<I, O>(
|
|
|
189
141
|
* @returns {ISignal<Set<T>>} A computed signal referencing that Set.
|
|
190
142
|
* @experimental
|
|
191
143
|
*/
|
|
192
|
-
|
|
193
|
-
return alienUnstable.computedSet<T>(source);
|
|
194
|
-
}
|
|
195
|
-
|
|
144
|
+
declare function unstable_createComputedSet<T>(source: IWritableSignal<Set<T>>): ISignal<Set<T>>;
|
|
196
145
|
/**
|
|
197
146
|
* Creates an equality-based computed signal, only updating when the new value
|
|
198
147
|
* is not deeply equal to the old value.
|
|
@@ -209,10 +158,7 @@ export function unstable_createComputedSet<T>(source: IWritableSignal<Set<T>>):
|
|
|
209
158
|
* @returns {ISignal<T>} An equality computed signal.
|
|
210
159
|
* @experimental
|
|
211
160
|
*/
|
|
212
|
-
|
|
213
|
-
return alienUnstable.equalityComputed(getter);
|
|
214
|
-
}
|
|
215
|
-
|
|
161
|
+
declare function unstable_createEqualityComputed<T>(getter: () => T): ISignal<T>;
|
|
216
162
|
/**
|
|
217
163
|
* React hook returning `[value, setValue]` for a given Alien Signal.
|
|
218
164
|
* Uses useSyncExternalStore for concurrency-safe re-renders.
|
|
@@ -230,32 +176,7 @@ export function unstable_createEqualityComputed<T>(getter: () => T): ISignal<T>
|
|
|
230
176
|
* @param {IWritableSignal<T>} alienSignal - The signal to read/write.
|
|
231
177
|
* @returns {[T, (val: T | ((oldVal: T) => T)) => void]} A tuple [currentValue, setValue].
|
|
232
178
|
*/
|
|
233
|
-
|
|
234
|
-
alienSignal: IWritableSignal<T>,
|
|
235
|
-
): [T, (val: T | ((oldVal: T) => T)) => void] {
|
|
236
|
-
const value = useSyncExternalStore(
|
|
237
|
-
(callback) => {
|
|
238
|
-
const eff = alienEffect(() => {
|
|
239
|
-
alienSignal.get(); // track
|
|
240
|
-
callback();
|
|
241
|
-
});
|
|
242
|
-
return () => eff.stop();
|
|
243
|
-
},
|
|
244
|
-
() => alienSignal.get(),
|
|
245
|
-
() => alienSignal.get(), // server snapshot
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
const setValue = (val: T | ((oldVal: T) => T)) => {
|
|
249
|
-
if (typeof val === 'function') {
|
|
250
|
-
alienSignal.set((val as (oldVal: T) => T)(alienSignal.get()));
|
|
251
|
-
} else {
|
|
252
|
-
alienSignal.set(val);
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
return [value, setValue];
|
|
257
|
-
}
|
|
258
|
-
|
|
179
|
+
declare function useSignal<T>(alienSignal: IWritableSignal<T>): [T, (val: T | ((oldVal: T) => T)) => void];
|
|
259
180
|
/**
|
|
260
181
|
* React hook returning only the current value of an Alien Signal (or computed).
|
|
261
182
|
* No setter is provided.
|
|
@@ -275,19 +196,7 @@ export function useSignal<T>(
|
|
|
275
196
|
* @param {IWritableSignal<T>} alienSignal - The signal to read.
|
|
276
197
|
* @returns {T} The current value.
|
|
277
198
|
*/
|
|
278
|
-
|
|
279
|
-
return useSyncExternalStore(
|
|
280
|
-
(callback) => {
|
|
281
|
-
const eff = alienEffect(() => {
|
|
282
|
-
alienSignal.get();
|
|
283
|
-
callback();
|
|
284
|
-
});
|
|
285
|
-
return () => eff.stop();
|
|
286
|
-
},
|
|
287
|
-
() => alienSignal.get(),
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
|
|
199
|
+
declare function useSignalValue<T>(alienSignal: IWritableSignal<T>): T;
|
|
291
200
|
/**
|
|
292
201
|
* React hook returning only a setter function for an Alien Signal.
|
|
293
202
|
* No current value is provided, similar to Jotai's useSetAtom.
|
|
@@ -305,18 +214,7 @@ export function useSignalValue<T>(alienSignal: IWritableSignal<T>): T {
|
|
|
305
214
|
* @param {IWritableSignal<T>} alienSignal - The signal to write.
|
|
306
215
|
* @returns {(val: T | ((oldVal: T) => T)) => void} A setter function.
|
|
307
216
|
*/
|
|
308
|
-
|
|
309
|
-
alienSignal: IWritableSignal<T>,
|
|
310
|
-
): (val: T | ((oldVal: T) => T)) => void {
|
|
311
|
-
return (val) => {
|
|
312
|
-
if (typeof val === 'function') {
|
|
313
|
-
alienSignal.set((val as (oldVal: T) => T)(alienSignal.get()));
|
|
314
|
-
} else {
|
|
315
|
-
alienSignal.set(val);
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
|
|
217
|
+
declare function useSetSignal<T>(alienSignal: IWritableSignal<T>): (val: T | ((oldVal: T) => T)) => void;
|
|
320
218
|
/**
|
|
321
219
|
* React hook for running a side effect whenever Alien Signals' dependencies
|
|
322
220
|
* used in `fn` change. The effect is cleaned up on component unmount.
|
|
@@ -333,13 +231,7 @@ export function useSetSignal<T>(
|
|
|
333
231
|
*
|
|
334
232
|
* @param {() => void} fn - The effect function to run.
|
|
335
233
|
*/
|
|
336
|
-
|
|
337
|
-
useEffect(() => {
|
|
338
|
-
const eff = alienEffect(fn);
|
|
339
|
-
return () => eff.stop();
|
|
340
|
-
}, [fn]);
|
|
341
|
-
}
|
|
342
|
-
|
|
234
|
+
declare function useSignalEffect(fn: () => void): void;
|
|
343
235
|
/**
|
|
344
236
|
* React hook for managing an Alien Signals effect scope.
|
|
345
237
|
* All signals/effects created inside this scope run when the component mounts,
|
|
@@ -362,16 +254,7 @@ export function useSignalEffect(fn: () => void): void {
|
|
|
362
254
|
*
|
|
363
255
|
* @returns {EffectScope} The created effect scope.
|
|
364
256
|
*/
|
|
365
|
-
|
|
366
|
-
const scope = useMemo(() => alienEffectScope(), []);
|
|
367
|
-
useEffect(() => {
|
|
368
|
-
return () => {
|
|
369
|
-
scope.stop();
|
|
370
|
-
};
|
|
371
|
-
}, [scope]);
|
|
372
|
-
return scope;
|
|
373
|
-
}
|
|
374
|
-
|
|
257
|
+
declare function useSignalScope(): EffectScope;
|
|
375
258
|
/**
|
|
376
259
|
* React hook to read from an async computed signal.
|
|
377
260
|
* The hook fetches the current value, subscribing to changes via useSyncExternalStore,
|
|
@@ -397,35 +280,7 @@ export function useSignalScope(): EffectScope {
|
|
|
397
280
|
* @returns {T | undefined} The resolved value (or undefined if not yet resolved).
|
|
398
281
|
* @experimental
|
|
399
282
|
*/
|
|
400
|
-
|
|
401
|
-
const [value, setValue] = useState<T | undefined>(alienAsyncComp.currentValue);
|
|
402
|
-
|
|
403
|
-
useSyncExternalStore(
|
|
404
|
-
(callback) => {
|
|
405
|
-
const eff = alienEffect(() => {
|
|
406
|
-
alienAsyncComp.currentValue; // track
|
|
407
|
-
callback();
|
|
408
|
-
});
|
|
409
|
-
return () => eff.stop();
|
|
410
|
-
},
|
|
411
|
-
() => alienAsyncComp.currentValue,
|
|
412
|
-
);
|
|
413
|
-
|
|
414
|
-
useEffect(() => {
|
|
415
|
-
let active = true;
|
|
416
|
-
const fetchValue = async () => {
|
|
417
|
-
const val = await alienAsyncComp.get();
|
|
418
|
-
if (active) setValue(val);
|
|
419
|
-
};
|
|
420
|
-
fetchValue();
|
|
421
|
-
return () => {
|
|
422
|
-
active = false;
|
|
423
|
-
};
|
|
424
|
-
}, [alienAsyncComp]);
|
|
425
|
-
|
|
426
|
-
return value;
|
|
427
|
-
}
|
|
428
|
-
|
|
283
|
+
declare function unstable_useAsyncComputedValue<T>(alienAsyncComp: AsyncComputed<T>): T | undefined;
|
|
429
284
|
/**
|
|
430
285
|
* React hook to run an asynchronous effect whenever the component mounts,
|
|
431
286
|
* cleaning up when it unmounts.
|
|
@@ -442,9 +297,6 @@ export function unstable_useAsyncComputedValue<T>(alienAsyncComp: AsyncComputed<
|
|
|
442
297
|
* @param {() => AsyncGenerator<Dependency, T>} fn - An async generator representing the effect logic.
|
|
443
298
|
* @experimental
|
|
444
299
|
*/
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
return () => eff.stop();
|
|
449
|
-
}, [fn]);
|
|
450
|
-
}
|
|
300
|
+
declare function unstable_useAsyncEffect<T>(fn: () => AsyncGenerator<Dependency, T>): void;
|
|
301
|
+
|
|
302
|
+
export { createComputed, createEffect, createSignal, createSignalScope, unstable_createAsyncComputed, unstable_createAsyncEffect, unstable_createComputedArray, unstable_createComputedSet, unstable_createEqualityComputed, unstable_useAsyncComputedValue, unstable_useAsyncEffect, useSetSignal, useSignal, useSignalEffect, useSignalScope, useSignalValue };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {signal,computed,effect,effectScope,unstable}from'alien-signals';import {useSyncExternalStore,useEffect,useMemo,useState}from'react';function g(e){return signal(e)}function m(e){return computed(e)}function x(e){return effect(e)}function b(){return effectScope()}function E(e){return unstable.asyncComputed(e)}async function I(e){return await unstable.asyncEffect(e).run()}function V(e,t){return unstable.computedArray(e,t)}function C(e){return unstable.computedSet(e)}function v(e){return unstable.equalityComputed(e)}function A(e){return [useSyncExternalStore(n=>{let c=effect(()=>{e.get(),n();});return ()=>c.stop()},()=>e.get(),()=>e.get()),n=>{typeof n=="function"?e.set(n(e.get())):e.set(n);}]}function _(e){return useSyncExternalStore(t=>{let o=effect(()=>{e.get(),t();});return ()=>o.stop()},()=>e.get())}function W(e){return t=>{typeof t=="function"?e.set(t(e.get())):e.set(t);}}function D(e){useEffect(()=>{let t=effect(e);return ()=>t.stop()},[e]);}function O(){let e=useMemo(()=>effectScope(),[]);return useEffect(()=>()=>{e.stop();},[e]),e}function G(e){let[t,o]=useState(e.currentValue);return useSyncExternalStore(n=>{let c=effect(()=>{e.currentValue,n();});return ()=>c.stop()},()=>e.currentValue),useEffect(()=>{let n=!0;return (async()=>{let l=await e.get();n&&o(l);})(),()=>{n=!1;}},[e]),t}function P(e){useEffect(()=>{let t=unstable.asyncEffect(e);return ()=>t.stop()},[e]);}export{m as createComputed,x as createEffect,g as createSignal,b as createSignalScope,E as unstable_createAsyncComputed,I as unstable_createAsyncEffect,V as unstable_createComputedArray,C as unstable_createComputedSet,v as unstable_createEqualityComputed,G as unstable_useAsyncComputedValue,P as unstable_useAsyncEffect,W as useSetSignal,A as useSignal,D as useSignalEffect,O as useSignalScope,_ as useSignalValue};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactjs-signal",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,9 +8,13 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js"
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.js"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
14
18
|
"scripts": {
|
|
15
19
|
"build": "tsup",
|
|
16
20
|
"watch": "npm run build -- --watch src",
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
## Git Commit Message Convention
|
|
2
|
-
|
|
3
|
-
> This is adapted from [Commit convention](https://www.conventionalcommits.org/en/v1.0.0/).
|
|
4
|
-
|
|
5
|
-
#### TL;DR:
|
|
6
|
-
|
|
7
|
-
Messages must be matched by the following regex:
|
|
8
|
-
|
|
9
|
-
```js
|
|
10
|
-
/^((feat|fix|docs|style|core|i18n|report|misc|cli|audits|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps?|merge|examples?|revert)(\(.+\))?(\:|\!\:)|(Merge|Revert|Version)) .{1,50}$/;
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
#### Examples
|
|
14
|
-
|
|
15
|
-
Appears under "Features" header, `compiler` subheader:
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
feat(compiler): add 'comments' option
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Appears under "Bug Fixes" header, `v-model` subheader, with a link to issue #28:
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
fix(v-model): handle events on blur
|
|
25
|
-
|
|
26
|
-
close #28
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
perf(core): improve vdom diffing by removing 'foo' option
|
|
33
|
-
|
|
34
|
-
BREAKING CHANGE: The 'foo' option has been removed.
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
revert: feat(compiler): add 'comments' option
|
|
41
|
-
|
|
42
|
-
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Full Message Format
|
|
46
|
-
|
|
47
|
-
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
<type>(<scope>): <subject>
|
|
51
|
-
<BLANK LINE>
|
|
52
|
-
<body>
|
|
53
|
-
<BLANK LINE>
|
|
54
|
-
<footer>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
The **header** is mandatory and the **scope** of the header is optional.
|
|
58
|
-
|
|
59
|
-
### Revert
|
|
60
|
-
|
|
61
|
-
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
|
62
|
-
|
|
63
|
-
### Type
|
|
64
|
-
|
|
65
|
-
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
|
|
66
|
-
|
|
67
|
-
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
|
|
68
|
-
|
|
69
|
-
### Scope
|
|
70
|
-
|
|
71
|
-
The scope could be anything specifying the place of the commit change. For example `core`, `compiler`, `ssr`, `v-model`, `transition` etc...
|
|
72
|
-
|
|
73
|
-
### Subject
|
|
74
|
-
|
|
75
|
-
The subject contains a succinct description of the change:
|
|
76
|
-
|
|
77
|
-
- use the imperative, present tense: "change" not "changed" nor "changes"
|
|
78
|
-
- don't capitalize the first letter
|
|
79
|
-
- no dot (.) at the end
|
|
80
|
-
|
|
81
|
-
### Body
|
|
82
|
-
|
|
83
|
-
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
|
84
|
-
The body should include the motivation for the change and contrast this with previous behavior.
|
|
85
|
-
|
|
86
|
-
### Footer
|
|
87
|
-
|
|
88
|
-
The footer should contain any information about **Breaking Changes** and is also the place to
|
|
89
|
-
reference GitHub issues that this commit **Closes**.
|
|
90
|
-
|
|
91
|
-
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
feat!: breaking change / feat(scope)!: rework API
|
|
95
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- master
|
|
6
|
-
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v3
|
|
16
|
-
- uses: actions/setup-node@v3
|
|
17
|
-
with:
|
|
18
|
-
node-version: 18.x
|
|
19
|
-
|
|
20
|
-
- run: npm install
|
|
21
|
-
- run: npm run lint && npm run build
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
permissions:
|
|
4
|
-
contents: write
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
tags:
|
|
9
|
-
- 'v*'
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
release:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v3
|
|
16
|
-
with:
|
|
17
|
-
fetch-depth: 0
|
|
18
|
-
|
|
19
|
-
- uses: actions/setup-node@v3
|
|
20
|
-
with:
|
|
21
|
-
node-version: 18.x
|
|
22
|
-
|
|
23
|
-
- run: npx changeloggithub@latest
|
|
24
|
-
env:
|
|
25
|
-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
26
|
-
|
|
27
|
-
- name: Publish
|
|
28
|
-
run: |
|
|
29
|
-
echo "Publishing"
|
package/tsconfig.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Enable latest features
|
|
4
|
-
"lib": ["ESNext", "DOM"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"allowJs": true,
|
|
9
|
-
|
|
10
|
-
// Bundler mode
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"noEmit": true,
|
|
15
|
-
|
|
16
|
-
// Best practices
|
|
17
|
-
"strict": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"noFallthroughCasesInSwitch": true,
|
|
20
|
-
|
|
21
|
-
// Some stricter flags (disabled by default)
|
|
22
|
-
"noUnusedLocals": false,
|
|
23
|
-
"noUnusedParameters": false,
|
|
24
|
-
"noPropertyAccessFromIndexSignature": false
|
|
25
|
-
}
|
|
26
|
-
}
|
package/tsup.config.ts
DELETED