Skip to content

Commit 3bb3e57

Browse files
committed
chore: add manual publish as well
1 parent 3edaba5 commit 3bb3e57

4 files changed

Lines changed: 39 additions & 11 deletions

File tree

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"import/no-extraneous-dependencies": 0,
66
"react/boolean-prop-naming": 0,
77
"unicorn/expiring-todo-comments": 0,
8-
"@typescript-eslint/sort-type-union-intersection-members": 0
8+
"@typescript-eslint/sort-type-union-intersection-members": 0,
9+
"comment-length/limit-multi-line-comments": 0
910
}
1011
}

.github/workflows/publish-auto.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: Publish to NPM
42

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
73
on:
4+
workflow_dispatch:
5+
inputs:
6+
description:
7+
description: Description of the release
8+
required: true
9+
type: string
10+
release_type:
11+
description: Release type
12+
required: true
13+
type: choice
14+
default: patch
15+
options:
16+
- patch
17+
- minor
18+
- major
819
push:
920
branches:
1021
- main
1122

12-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1323
jobs:
1424
test:
1525
uses: ./.github/workflows/test.yml
16-
# This workflow contains a single job called "build"
17-
publish:
26+
27+
publish-auto:
1828
# The type of runner that the job will run on
1929
needs: test
30+
if: ${{ github.event_name != 'workflow_dispatch' }}
2031
uses: Kingstinct/utils/.github/workflows/publish.yml@main
2132
secrets:
2233
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -25,3 +36,15 @@ jobs:
2536
description: Autorelease
2637
release_type: patch
2738
package_manager: yarn
39+
publish-manual:
40+
# The type of runner that the job will run on
41+
needs: test
42+
if: ${{ github.event_name == 'workflow_dispatch' }}
43+
uses: Kingstinct/utils/.github/workflows/publish.yml@main
44+
secrets:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
npm_token: ${{ secrets.npm_token }}
47+
with:
48+
description: ${{ inputs.description }}
49+
release_type: ${{ inputs.release_type }}
50+
package_manager: yarn

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"*.js": "eslint --fix",
3535
"*.json": "eslint --fix",
3636
"*.graphql": "eslint --fix",
37-
"*.yml": "eslint"
37+
"*.yml": "eslint --fix"
3838
},
3939
"publishConfig": {
4040
"access": "public",

src/utils/createThemedStylesHook.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,19 @@ type OptimizedFactoryProps = {
9191
readonly size: ScaledSize,
9292
readonly insets: EdgeInsets,
9393
}
94-
type OptimizedFactory<TProps extends FactoryCustomProps, TIncludedProps extends ReadonlyArray<keyof OptimizedFactoryProps>, T extends StyleSheet.NamedStyles<T>> = (props: TProps & Pick<OptimizedFactoryProps, TIncludedProps>) => T | StyleSheet.NamedStyles<T>
94+
* type OptimizedFactory<TProps extends FactoryCustomProps, TIncludedProps extends ReadonlyArray<keyof
95+
* OptimizedFactoryProps>, T extends StyleSheet.NamedStyles<T>> = (props: TProps & Pick<OptimizedFactoryProps,
96+
* TIncludedProps>) => T | StyleSheet.NamedStyles<T>
9597
9698
Maybe 1: would probably be good to shallow memoize custom props (so users don't need to worry about memoizing)
9799
Maybe 2: specify requirements, something in the area of:
98100
createStylesHook(({ theme, size, insets }) => {
99101
...styles
100102
}, ['theme', 'size', 'insets'])
101103
102-
export function createOptimizedThemedStylesHook<TProps extends FactoryCustomProps, TIncludedProps extends ReadonlyArray<keyof OptimizedFactoryProps>, TStyle extends StyleSheet.NamedStyles<TStyle>>(factory: OptimizedFactory<TProps, TIncludedProps, TStyle>, includedProps?: TIncludedProps) {
104+
* export function createOptimizedThemedStylesHook<TProps extends FactoryCustomProps, TIncludedProps extends
105+
* ReadonlyArray<keyof OptimizedFactoryProps>, TStyle extends StyleSheet.NamedStyles<TStyle>>(factory:
106+
* OptimizedFactory<TProps, TIncludedProps, TStyle>, includedProps?: TIncludedProps) {
103107
return (props?: TProps) => {
104108
const theme = useTheme(),
105109
size = useWindowDimensions(),

0 commit comments

Comments
 (0)