react-state-monad 0.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/publish.yml +73 -0
- package/LICENSE +674 -0
- package/README.md +251 -247
- package/package.json +1 -1
- package/src/hooks/types.ts +12 -12
- package/src/hooks/useElementState.ts +25 -25
- package/src/hooks/useEmptyState.ts +12 -12
- package/src/hooks/useFieldState.ts +20 -20
- package/src/hooks/useRemapArray.ts +32 -32
- package/src/hooks/useStateObject.ts +14 -14
- package/src/implementations/emptyState.ts +42 -42
- package/src/implementations/validState.ts +59 -59
- package/src/index.ts +2 -2
- package/src/stateObject.ts +70 -70
- package/tsconfig.json +20 -20
- package/dist/index.cjs +0 -29
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -5
@@ -0,0 +1,73 @@
|
|
1
|
+
name: Publish to npm
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- release
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
release:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- name: Checkout repository
|
14
|
+
uses: actions/checkout@v3
|
15
|
+
|
16
|
+
- name: Setup Node.js
|
17
|
+
uses: actions/setup-node@v3
|
18
|
+
with:
|
19
|
+
node-version: 16
|
20
|
+
registry-url: https://registry.npmjs.org/
|
21
|
+
|
22
|
+
- name: Install dependencies
|
23
|
+
run: npm install
|
24
|
+
|
25
|
+
- name: Get package version
|
26
|
+
id: get_version
|
27
|
+
run: echo "PACKAGE_VERSION=$(node -p -e 'require(`./package.json`).version')" >> $GITHUB_ENV
|
28
|
+
|
29
|
+
- name: Get package name
|
30
|
+
id: get_name
|
31
|
+
run: echo "PACKAGE_NAME=$(node -p -e 'require(`./package.json`).name')" >> $GITHUB_ENV
|
32
|
+
|
33
|
+
- name: Check if version exists on npm
|
34
|
+
run: |
|
35
|
+
if npm view ${{ env.PACKAGE_NAME }}@${{ env.PACKAGE_VERSION }} > /dev/null 2>&1; then
|
36
|
+
echo "Version ${{ env.PACKAGE_VERSION }} already exists on npm. Exiting."
|
37
|
+
exit 0
|
38
|
+
fi
|
39
|
+
|
40
|
+
- name: Configure git
|
41
|
+
run: |
|
42
|
+
git config --global user.name "github-actions[bot]"
|
43
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
44
|
+
|
45
|
+
- name: Create GitHub tag
|
46
|
+
run: git tag v${{ env.PACKAGE_VERSION }}
|
47
|
+
|
48
|
+
- name: Push GitHub tag
|
49
|
+
run: git push origin --tags
|
50
|
+
|
51
|
+
- name: Create GitHub release
|
52
|
+
uses: actions/create-release@v1.1.0
|
53
|
+
with:
|
54
|
+
tag_name: v${{ env.PACKAGE_VERSION }}
|
55
|
+
release_name: Release v${{ env.PACKAGE_VERSION }}
|
56
|
+
body: |
|
57
|
+
Release of version ${{ env.PACKAGE_VERSION }} to npm.
|
58
|
+
- Package name: ${{ env.PACKAGE_NAME }}
|
59
|
+
- Version: ${{ env.PACKAGE_VERSION }}
|
60
|
+
- [View on npm](https://www.npmjs.com/package/${{ env.PACKAGE_NAME }}/v/${{ env.PACKAGE_VERSION }})
|
61
|
+
draft: false
|
62
|
+
prerelease: false
|
63
|
+
env:
|
64
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
65
|
+
|
66
|
+
- name: Publish to npm
|
67
|
+
env:
|
68
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
69
|
+
run: npm publish
|
70
|
+
|
71
|
+
- name: Print npm package URL
|
72
|
+
run: |
|
73
|
+
echo "Package published at: https://www.npmjs.com/package/${{ env.PACKAGE_NAME }}/v/${{ env.PACKAGE_VERSION }}"
|