Skip to content

Commit 325eda8

Browse files
Modernize development tools (#21)
* Modernize development tools * Add github actions * Add QA and fix CI * Add Changeset * Modernise README
1 parent 2a64e88 commit 325eda8

File tree

116 files changed

+422
-586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+422
-586
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"presets": ["@babel/preset-env"],
33
"plugins": [
44
"@babel/plugin-transform-runtime",
5-
"transform-object-assign"
5+
"@babel/transform-object-assign"
66
]
77
}

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "3.x",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/quiet-cows-press.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@runroom/purejs": minor
3+
---
4+
5+
Modernise test build and release process

.editorconfig

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ root = true
33

44
[*]
55
indent_style = space
6-
indent_size = 2
6+
indent_size = 4
77
end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true
1010
insert_final_newline = true
1111

12+
[{*.ts,*.js,*.json,.*rc}]
13+
indent_size = 2
14+
1215
[{*.js,*.ts}]
13-
max_line_length = 120
1416
quote_type = single
17+
max_line_length = 100
1518

1619
[*.md]
1720
trim_trailing_whitespace = false

.eslintignore

-2
This file was deleted.

.eslintrc.js

+38-35
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
11
module.exports = {
2-
extends: ['airbnb-base', 'prettier'],
3-
plugins: ['import', 'prettier'],
2+
root: true,
3+
parserOptions: {
4+
parser: '@typescript-eslint/parser',
5+
},
46
env: {
7+
browser: true,
8+
node: true,
59
es6: true,
6-
node: true
710
},
8-
parserOptions: {
9-
ecmaVersion: 2016,
10-
sourceType: 'module',
11-
ecmaFeatures: {
12-
impliedStrict: true,
13-
globalReturn: true
14-
}
15-
},
16-
overrides: [
17-
{
18-
files: '*.spec.js',
19-
rules: {
20-
'no-unused-expressions': 'off',
21-
'no-undef': 'off'
22-
}
23-
}
11+
extends: [
12+
'eslint:recommended',
13+
'plugin:@typescript-eslint/eslint-recommended',
14+
'plugin:@typescript-eslint/recommended',
15+
'prettier',
2416
],
25-
parser: 'babel-eslint',
26-
globals: {
27-
document: false,
28-
escape: false,
29-
navigator: false,
30-
unescape: false,
31-
window: false,
32-
location: false,
33-
describe: true,
34-
before: true,
35-
after: true,
36-
it: true,
37-
expect: true,
38-
sinon: true,
39-
purejs: true
40-
}
17+
plugins: ['@typescript-eslint'],
18+
rules: {
19+
'no-console': 'warn',
20+
'no-debugger': 'warn',
21+
'no-unused-vars': 'warn',
22+
'no-param-reassign': 'error',
23+
'no-else-return': 'error',
24+
'no-return-assign': 'error',
25+
'no-template-curly-in-string': 'error',
26+
'no-extend-native': 'error',
27+
'no-multi-spaces': 'error',
28+
'no-new-func': 'error',
29+
'no-new-wrappers': 'error',
30+
'no-return-await': 'error',
31+
'no-self-compare': 'error',
32+
'no-useless-return': 'error',
33+
'no-undef-init': 'error',
34+
'no-duplicate-imports': 'error',
35+
'no-var': 'error',
36+
eqeqeq: 'error',
37+
yoda: ['error', 'never'],
38+
'prefer-arrow-callback': 'error',
39+
'prefer-const': 'error',
40+
'prefer-template': 'error',
41+
'require-await': 'error',
42+
semi: 'error',
43+
},
4144
};

.github/workflows/ci.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [3.x]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
name: Node ${{ matrix.node }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node: ["18.x"]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node }}
20+
- uses: bahmutov/npm-install@v1
21+
with:
22+
useLockFile: false
23+
- run: npm run test
24+
- uses: codecov/codecov-action@v3

.github/workflows/qa.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: QA
2+
3+
on:
4+
push:
5+
branches: [3.x]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
name: Node ${{ matrix.node }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node: ["18.x"]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node }}
20+
- uses: bahmutov/npm-install@v1
21+
with:
22+
useLockFile: false
23+
- run: npm run lint

.github/workflows/release.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish and release
2+
3+
on:
4+
push:
5+
branches: [3.x]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node: ["18.x"]
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: ${{ matrix.node }}
18+
registry-url: https://registry.npmjs.org
19+
- uses: bahmutov/npm-install@v1
20+
with:
21+
useLockFile: false
22+
- uses: changesets/action@master
23+
with:
24+
title: Release
25+
publish: npm run release
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NODE_AUTH_TOKEN: ${{ secrets.FE_USER_NPM_TOKEN }}

.gitignore

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
# OS GENERATED FILES
2-
.DS_Store
3-
.DS_Store?
4-
5-
# EDITOR
6-
.vscode
7-
81
# NODE
9-
dist
102
node_modules
3+
package-lock.json
114
npm-debug.log
12-
yarn-error.log
135

146
# NPM
157
pure-js*.tgz

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ node_modules
77
.DS_Store
88
.npmignore
99
LICENSE
10-
yarn.lock
10+
package-lock.json

.prettierignore

-1
This file was deleted.

.travis.yml

-16
This file was deleted.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Runroom Produccion Multimedia S.L.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# PureJS
22

3-
[![Build Status](https://travis-ci.org/Runroom/purejs.svg?branch=master)](https://travis-ci.org/Runroom/purejs.svg)
4-
[![Coverage Status](https://coveralls.io/repos/github/Runroom/purejs/badge.svg?branch=master)](https://img.shields.io/coveralls/github/Runroom/purejs/master.svg)
3+
[![npm version](https://img.shields.io/npm/v/@runroom/purejs.svg)](https://www.npmjs.com/package/@runroom/purejs)
4+
![node](https://img.shields.io/node/v/@runroom/purejs.svg)
5+
6+
[![CI](https://github.com/Runroom/purejs/actions/workflows/ci.yaml/badge.svg)](https://github.com/Runroom/purejs/actions/workflows/ci.yaml)
7+
[![QA](https://github.com/Runroom/purejs/actions/workflows/qa.yaml/badge.svg)](https://github.com/Runroom/purejs/actions/workflows/qa.yaml)
8+
[![codecov](https://codecov.io/gh/Runroom/purejs/branch/3.x/graph/badge.svg)](https://codecov.io/gh/Runroom/purejs)
59

610
PureJS is a pack of pure javascript, non-jquery, functions exported as [Node.js](https://nodejs.org/) modules.
711

@@ -10,27 +14,27 @@ PureJS is a pack of pure javascript, non-jquery, functions exported as [Node.js]
1014
Install the package as your project dependency
1115

1216
```bash
13-
$ yarn add @runroom/purejs
17+
npm install @runroom/purejs
1418
```
1519

1620
Use it importing the whole library or the methods you need
1721

1822
```javascript
19-
import events from '@runroom/purejs/lib/events'
23+
import events from "@runroom/purejs/lib/events";
2024

2125
events.onDocumentReady(() => {
22-
// your code
26+
// your code
2327
});
2428
```
2529

2630
## Supported modules
2731

28-
* [anchorTo](./doc/anchorTo.md)
29-
* [animateTo](./doc/animateTo.md)
30-
* [~~cookies~~ (Deprecated)](./doc/cookies.md)
31-
* [debounce](./doc/debounce.md)
32-
* [events](./doc/events.md)
33-
* [forEach](./forEach.md)
34-
* [safeScrollTop](./doc/safeScrollTop.md)
35-
* [scrollDirection](./doc/scrollDirection.md)
36-
* [touchable](./doc/touchable.md)
32+
- [anchorTo](./doc/anchorTo.md)
33+
- [animateTo](./doc/animateTo.md)
34+
- [~~cookies~~ (Deprecated)](./doc/cookies.md)
35+
- [debounce](./doc/debounce.md)
36+
- [events](./doc/events.md)
37+
- [forEach](./forEach.md)
38+
- [safeScrollTop](./doc/safeScrollTop.md)
39+
- [scrollDirection](./doc/scrollDirection.md)
40+
- [touchable](./doc/touchable.md)

index.d.ts dist/index.d.ts

File renamed without changes.

index.js dist/index.js

File renamed without changes.

dist/index.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

dist/lib/anchorTo.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lib/anchorTo.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)