From c42f7a4702e5c1459de79d6fc2aa4599ff8f7ff0 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Tue, 13 Dec 2022 10:21:52 -0500 Subject: [PATCH 1/4] build: refactor to scoped package name --- package.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a537132..771acc9 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,17 @@ { - "name": "react-native-queue", + "name": "@sourcetoad/react-native-queue", "version": "2.0.2", "description": "A React Native Job Queue", "main": "index.js", + "files": [ + "config", + "Models", + "index.js", + "!**/__tests__", + "!**/__fixtures__", + "!**/__mocks__", + "!**/.*" + ], "scripts": { "test": "jest --coverage --detectOpenHandles --forceExit", "lint": "eslint ." From af00a6d0398b1f28730bfb1a98ad702fdc8c9215 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Tue, 13 Dec 2022 10:21:58 -0500 Subject: [PATCH 2/4] docs: rename for scoped package --- README.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3e4dec4..0bd6816 100644 --- a/README.md +++ b/README.md @@ -53,25 +53,15 @@ Need advanced task functionality like dedicated worker threads or OS services? E ## Installation ```bash -$ npm install --save react-native-queue +$ npm install --save @sourcetoad/react-native-queue ``` Or ```bash -$ yarn add react-native-queue +$ yarn add @sourcetoad/react-native-queue ``` -Then, because this package has a depedency on [Realm](https://github.com/realm/realm-js) you will need to link this native package by running: - -```bash -$ react-native link realm -``` - -Linking realm **should only be done once**, reinstalling node_modules with npm or yarn does not require running the above command again. - -To troubleshoot linking, refer to [the realm installation instructions](https://realm.io/docs/javascript/latest/#getting-started). - ## Basic Usage React Native Queue is a standard job/task queue built specifically for react native applications. If you have a long-running task, or a large number of tasks, consider turning that task into a job(s) and throwing it/them onto the queue to be processed in the background instead of blocking your UI until task(s) complete. @@ -84,7 +74,7 @@ Creating and processing jobs consists of: 4. Starting the queue (note this happens automatically on job creation, but sometimes the queue must be explicitly started such as in a OS background task or on app restart). Queue can be started with a lifespan in order to limit queue processing time. ```js -import queueFactory from 'react-native-queue'; +import queueFactory from '@sourcetoad/react-native-queue'; // Of course this line needs to be in the context of an async function, // otherwise use queueFactory.then((queue) => { console.log('add workers and jobs here'); }); @@ -249,7 +239,7 @@ import { Button } from 'react-native'; -import queueFactory from 'react-native-queue'; +import queueFactory from '@sourcetoad/react-native-queue'; export default class App extends Component<{}> { @@ -420,7 +410,7 @@ import { } from 'react-native'; import BackgroundTask from 'react-native-background-task' -import queueFactory from 'react-native-queue'; +import queueFactory from '@sourcetoad/react-native-queue'; BackgroundTask.define(async () => { From 9bcde3ca8c6c4a0c3ace879630a8fdf3aa88ab6f Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Tue, 13 Dec 2022 10:22:07 -0500 Subject: [PATCH 3/4] build: publish to npm --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..18045d4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish to NPM +on: + release: + types: [published] + +jobs: + publish: + environment: deploy + runs-on: ubuntu-latest + + name: Publish + steps: + - uses: actions/checkout@v3 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 14 + cache: 'yarn' + registry-url: 'https://registry.npmjs.org' + + - name: Yarn Install + run: yarn install --network-concurrency 1 + + - name: Publish (NPM) + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From a9cedddd33d69d0ba27bb1ec1ead319026829334 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Tue, 13 Dec 2022 10:22:28 -0500 Subject: [PATCH 4/4] build: version 2.0.3 tagged --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 771acc9..b8dd5ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sourcetoad/react-native-queue", - "version": "2.0.2", + "version": "2.0.3", "description": "A React Native Job Queue", "main": "index.js", "files": [