Skip to content

Commit 4050a6c

Browse files
authored
Publish to NPM (#14)
* build: refactor to scoped package name * docs: rename for scoped package * build: publish to npm * build: version 2.0.3 tagged
1 parent c893c37 commit 4050a6c

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to NPM
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
environment: deploy
9+
runs-on: ubuntu-latest
10+
11+
name: Publish
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 14
19+
cache: 'yarn'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Yarn Install
23+
run: yarn install --network-concurrency 1
24+
25+
- name: Publish (NPM)
26+
run: npm publish --access public
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,15 @@ Need advanced task functionality like dedicated worker threads or OS services? E
5353
## Installation
5454

5555
```bash
56-
$ npm install --save react-native-queue
56+
$ npm install --save @sourcetoad/react-native-queue
5757
```
5858

5959
Or
6060

6161
```bash
62-
$ yarn add react-native-queue
62+
$ yarn add @sourcetoad/react-native-queue
6363
```
6464

65-
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:
66-
67-
```bash
68-
$ react-native link realm
69-
```
70-
71-
Linking realm **should only be done once**, reinstalling node_modules with npm or yarn does not require running the above command again.
72-
73-
To troubleshoot linking, refer to [the realm installation instructions](https://realm.io/docs/javascript/latest/#getting-started).
74-
7565
## Basic Usage
7666

7767
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:
8474
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.
8575

8676
```js
87-
import queueFactory from 'react-native-queue';
77+
import queueFactory from '@sourcetoad/react-native-queue';
8878

8979
// Of course this line needs to be in the context of an async function,
9080
// otherwise use queueFactory.then((queue) => { console.log('add workers and jobs here'); });
@@ -249,7 +239,7 @@ import {
249239
Button
250240
} from 'react-native';
251241

252-
import queueFactory from 'react-native-queue';
242+
import queueFactory from '@sourcetoad/react-native-queue';
253243

254244
export default class App extends Component<{}> {
255245

@@ -420,7 +410,7 @@ import {
420410
} from 'react-native';
421411

422412
import BackgroundTask from 'react-native-background-task'
423-
import queueFactory from 'react-native-queue';
413+
import queueFactory from '@sourcetoad/react-native-queue';
424414

425415
BackgroundTask.define(async () => {
426416

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
{
2-
"name": "react-native-queue",
3-
"version": "2.0.2",
2+
"name": "@sourcetoad/react-native-queue",
3+
"version": "2.0.3",
44
"description": "A React Native Job Queue",
55
"main": "index.js",
6+
"files": [
7+
"config",
8+
"Models",
9+
"index.js",
10+
"!**/__tests__",
11+
"!**/__fixtures__",
12+
"!**/__mocks__",
13+
"!**/.*"
14+
],
615
"scripts": {
716
"test": "jest --coverage --detectOpenHandles --forceExit",
817
"lint": "eslint ."

0 commit comments

Comments
 (0)