Skip to content

Commit 563c49a

Browse files
authored
Merge pull request #110 from langleyfoxall/release-prep
Release prep
2 parents 8ed1b79 + 4410819 commit 563c49a

21 files changed

+7248
-2891
lines changed

.babelrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"@babel/preset-react",
44
[
55
"@babel/preset-env",
6-
{ "useBuiltIns": "usage" }
6+
{
7+
"useBuiltIns": "usage"
8+
}
79
]
810
]
9-
}
11+
}

.eslintrc.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"standard",
8+
"plugin:react/recommended"
9+
],
10+
"parserOptions": {
11+
"ecmaVersion": "latest",
12+
"sourceType": "module"
13+
},
14+
"plugins": [
15+
"react"
16+
],
17+
"globals": {
18+
"route": true
19+
},
20+
"settings": {
21+
"react": {
22+
"version": "detect"
23+
}
24+
}
25+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
pull_request:
5+
release:
6+
types: [created]
7+
jobs:
8+
lint-and-build:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: '21.7'
15+
registry-url: 'https://registry.npmjs.org'
16+
- run: npm ci
17+
- run: npm run-script lint
18+
- run: npm run-script build
19+
release:
20+
if: github.event_name == 'release' && github.event.action == 'created'
21+
needs: lint-and-build
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: actions/setup-node@v2
26+
with:
27+
node-version: '21.7'
28+
registry-url: 'https://registry.npmjs.org'
29+
- run: npm ci
30+
- run: npm run-script build
31+
- run: echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > ${NPM_CONFIG_USERCONFIG}
32+
- run: "sed -i \"s/\\\"version\\\": \\\"0.0.0\\\",/\\\"version\\\": \\\"${GITHUB_REF/refs\\/tags\\/v/}\\\",/g\" package.json"
33+
- run: npm publish

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
node_modules
2-
package-lock.json
3-
.idea
4-
*.tgz

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
src
22
.babelrc
33
.gitignore
4-
.idea

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": "explicit"
4+
},
5+
"editor.formatOnSave": true,
6+
"editor.detectIndentation": false,
7+
"editor.tabSize": 2,
8+
"editor.insertSpaces": true,
9+
"files.trimFinalNewlines": true,
10+
"files.trimTrailingWhitespace": true,
11+
"files.insertFinalNewline": true,
12+
"files.eol": "\n"
13+
}

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# React Dynamic Data Table
22

3-
[![npm version](https://badge.fury.io/js/%40langleyfoxall%2Freact-dynamic-data-table.svg)](https://badge.fury.io/js/%40langleyfoxall%2Freact-dynamic-data-table)
4-
[![npm](https://img.shields.io/npm/dt/@langleyfoxall/react-dynamic-data-table.svg)](https://npm-stat.com/charts.html?package=%40langleyfoxall%2Freact-dynamic-data-table)
3+
[![npm version](https://badge.fury.io/js/%40code-based%2Freact-dynamic-data-table.svg)](https://badge.fury.io/js/%40code-based%2Freact-dynamic-data-table)
4+
[![npm](https://img.shields.io/npm/dt/@code-based/react-dynamic-data-table.svg)](https://npm-stat.com/charts.html?package=%40code-based%2Freact-dynamic-data-table)
55

66

77
This package provides a React Dynamic Data Table component that supports sortable columns,
@@ -12,17 +12,17 @@ pagination, field mapping, data manipulation, and more.
1212
You can install this package with either `npm` or `yarn` as shown below.
1313

1414
```bash
15-
npm install @langleyfoxall/react-dynamic-data-table
15+
npm install @code-based/react-dynamic-data-table
1616
```
1717

1818
```bash
19-
yarn add @langleyfoxall/react-dynamic-data-table
19+
yarn add @code-based/react-dynamic-data-table
2020
```
2121

2222
Remember to import the `DynamicDataTable` component where it is needed.
2323

2424
```JSX
25-
import DynamicDataTable from "@langleyfoxall/react-dynamic-data-table";
25+
import DynamicDataTable from "@code-based/react-dynamic-data-table";
2626
```
2727

2828
## Usage
@@ -46,7 +46,7 @@ The `rows` prop expects an array of objects, such as the following.
4646
### Specifying a CSS class for the table
4747

4848
By default tables are assigned the bootstrap `table` and `table-striped` CSS classes.
49-
If you need a different table style, you can override these defaults by providing the
49+
If you need a different table style, you can override these defaults by providing the
5050
`className` prop:
5151

5252
```JSX
@@ -191,7 +191,7 @@ be pushed to the end of the ordered fields.
191191
```JSX
192192
<DynamicDataTable
193193
rows={[
194-
{ id: 1, email: 'info@langleyfoxall.co.uk', name: 'Langley Foxall' }
194+
{ id: 1, email: 'info@codebased.co.uk', name: 'Codebased' }
195195
]}
196196
fieldOrder={[
197197
'id', 'name'
@@ -206,7 +206,7 @@ Mixing strings and regex is also supported.
206206
```JSX
207207
<DynamicDataTable
208208
rows={[
209-
{ id: 1, email: 'info@langleyfoxall.co.uk', first_name: 'Langley', last_name: 'Foxall' }
209+
{ id: 1, email: 'info@codebased.co.uk', first_name: 'Code', last_name: 'Based' }
210210
]}
211211
fieldOrder={[
212212
'id', /_name/
@@ -229,7 +229,7 @@ it respects whatever unit is set.
229229
```jsx
230230
<DynamicDataTable
231231
rows={[
232-
{ id: 1, email: 'info@langleyfoxall.co.uk', first_name: 'Langley', last_name: 'Foxall' }
232+
{ id: 1, email: 'info@codebased.co.uk', first_name: 'Code', last_name: 'Foxall' }
233233
]}
234234
columnWidths={{
235235
// 10%
@@ -255,7 +255,7 @@ node into `orderByAscIcon` and `orderByDescIcon`.
255255
/>
256256
```
257257

258-
You can optionally specify an icon to appear when a sortable field is *not* the
258+
You can optionally specify an icon to appear when a sortable field is *not* the
259259
currently sorted field using the `orderByIcon` prop:
260260

261261
```JSX
@@ -511,7 +511,7 @@ For more complex interactions, such as supporting the ability to Middle-click, y
511511
#### Context Menus
512512

513513
The ability to right click rows can be enabled by using `onContextMenu` and `rowRenderer`.
514-
In the example we will use our own [`@langleyfoxall/react-dynamic-context-menu`](https://github.com/langleyfoxall/react-dynamic-context-menu):
514+
In the example we will use our own [`@code-based/react-dynamic-context-menu`](https://github.com/langleyfoxall/react-dynamic-context-menu):
515515

516516
```JSX
517517
<DynamicDataTable
@@ -986,3 +986,16 @@ matching the predicate is given the CSS class `table-active`:
986986
<DynamicDataTable
987987
rowIsActive={(row) => row.id === 3}
988988
/>
989+
```
990+
991+
## Development
992+
993+
### Linting
994+
995+
This package uses [ESLint](https://eslint.org/) for linting of JS/X. You can run ESLint at any time by executing `npm run-script lint-fix`. Install the [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to get real-time linting in Visual Studio Code.
996+
997+
These linters additionally run in continuous integration as a GitHub Action.
998+
999+
### Releases
1000+
1001+
To release a new version of this package, simply [create a new release](https://github.com/langleyfoxall/react-dynamic-data-table/releases/new).

0 commit comments

Comments
 (0)