Skip to content

Commit

Permalink
Merge pull request #44 from mitsuharu/develop
Browse files Browse the repository at this point in the history
release 2.2.0
  • Loading branch information
mitsuharu authored Jul 19, 2024
2 parents 746bb3e + 86fce10 commit 9eb8080
Show file tree
Hide file tree
Showing 17 changed files with 814 additions and 1,258 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ babel.config.js
metro.config.js
local-package-source
jest/*
lib/*
example/react-native.config.js
example/index.js
*.yml
80 changes: 31 additions & 49 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
module.exports = {
'env': {
'browser': true,
'es2021': true
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
'extends': [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended'
],
'overrides': [
{
'env': {
'node': true
},
'files': [
'.eslintrc.{js,cjs}'
],
'parserOptions': {
'sourceType': 'script'
}
}
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 'latest',
'sourceType': 'module'
},
'plugins': [
'@typescript-eslint',
'react'
],
'rules': {
'indent': [
'error',
2
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'never'
]
}
};
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single'],
'semi': ['error', 'never'],
},
}
13 changes: 0 additions & 13 deletions .github/FUNDING.yml

This file was deleted.

93 changes: 49 additions & 44 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,52 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile

# - name: Test
# run: yarn test

- name: Check for existing tag
id: tag-check
run: |
VERSION=$(jq -r '.version' package.json)
TAG="$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists"
echo "::set-output name=tag_exists::true"
else
echo "Tag $TAG does not exist"
echo "::set-output name=tag_exists::false"
fi
- name: Create and push tag
id: create-tag
if: steps.tag-check.outputs.tag_exists == 'false'
run: |
VERSION=$(jq -r '.version' package.json)
TAG="$VERSION"
git config user.name 'github-actions'
git config user.email '[email protected]'
git tag -a "$TAG" -m "Release version $VERSION"
git push origin "$TAG"
- name: Publish to npm
if: steps.tag-check.outputs.tag_exists == 'false'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access=public
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: |
yarn typecheck
yarn lint
- name: Test
run: yarn test

- name: Check for existing tag
id: tag-check
run: |
VERSION=$(jq -r '.version' package.json)
TAG="$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists"
echo "::set-output name=tag_exists::true"
else
echo "Tag $TAG does not exist"
echo "::set-output name=tag_exists::false"
fi
- name: Create and push tag
id: create-tag
if: steps.tag-check.outputs.tag_exists == 'false'
run: |
VERSION=$(jq -r '.version' package.json)
TAG="$VERSION"
git config user.name 'github-actions'
git config user.email '[email protected]'
git tag -a "$TAG" -m "Release version $VERSION"
git push origin "$TAG"
- name: Publish to npm
if: steps.tag-check.outputs.tag_exists == 'false'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access=public
8 changes: 2 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
],
"unwantedRecommendations": [
"eg2.tslint",
]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
"unwantedRecommendations": ["eg2.tslint"]
}
43 changes: 20 additions & 23 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
{
"files.insertFinalNewline": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"cSpell.words": [
"Consts",
"Emoto",
"gradlew",
"grayscale",
"mitsuharu",
"podspec",
"pressable",
"sunmi",
"typecheck",
"Woyou"
],
}

"files.insertFinalNewline": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"cSpell.words": [
"Consts",
"Emoto",
"gradlew",
"grayscale",
"mitsuharu",
"podspec",
"pressable",
"sunmi",
"typecheck",
"Woyou"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Mitsuharu Emoto
Copyright (c) 2024 Mitsuharu Emoto
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,19 @@ yarn
yarn example android
```

### example

- Example supports React Native 0.74.
- It uses this example to develop this library.

### Guides

I recommend that also modify test, readme and example.
- It creates Pull Requests to be merged into the develop branch.
- I recommend that add or fix test, readme and example.

### リリース

(管理者のみ)develop ブランチのバージョン更新して、main ブランチへPRを作ってください。マージを行うと、自動で npm にリリースされます。

## License

Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ PODS:
- React-Mapbuffer (0.74.3):
- glog
- React-debug
- react-native-sunmi-printer-library (2.1.1):
- react-native-sunmi-printer-library (2.2.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1395,7 +1395,7 @@ SPEC CHECKSUMS:
React-jsitracing: 6b3c8c98313642140530f93c46f5a6ca4530b446
React-logger: fa92ba4d3a5d39ac450f59be2a3cec7b099f0304
React-Mapbuffer: 9f68550e7c6839d01411ac8896aea5c868eff63a
react-native-sunmi-printer-library: 8f82fec3b0f3f8f6fc6012d30e4f5512d1fecd4f
react-native-sunmi-printer-library: 80eb3e6a9dfce9633e87cb904a9f676ef0ddba80
React-nativeconfig: fa5de9d8f4dbd5917358f8ad3ad1e08762f01dcb
React-NativeModulesApple: 585d1b78e0597de364d259cb56007052d0bda5e5
React-perflogger: 7bb9ba49435ff66b666e7966ee10082508a203e8
Expand Down
Loading

0 comments on commit 9eb8080

Please sign in to comment.