Skip to content

Commit 7708885

Browse files
authored
Merge branch 'develop' into bugfix/isDateAfter
2 parents a048537 + 3f843b9 commit 7708885

File tree

77 files changed

+6742
-3081
lines changed

Some content is hidden

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

77 files changed

+6742
-3081
lines changed
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/build-check.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ name: Build Check
33
on: pull_request
44

55
jobs:
6-
build_check:
7-
runs-on: ubuntu-latest
8-
strategy:
9-
matrix:
10-
node: [ '12', '14', '15' ]
11-
name: Node ${{ matrix.node }}
12-
steps:
13-
- uses: actions/checkout@v2
14-
- name: Setup node
15-
uses: actions/setup-node@v2
16-
with:
17-
node-version: ${{ matrix.node }}
18-
- name: Installing dependencies
19-
run: npm ci
20-
- name: Testing
21-
run: npm test
22-
- name: Building
23-
run: npm run build
24-
6+
build_check:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node: ["12", "14", "15"]
11+
name: Node ${{ matrix.node }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: ${{ matrix.node }}
18+
- name: Installing dependencies
19+
run: npm ci
20+
- name: Testing
21+
run: npm test
22+
- name: Building
23+
run: npm run build

.github/workflows/publish.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- master
4+
push:
5+
branches:
6+
- master
77

88
jobs:
9-
publish:
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- uses: actions/checkout@v2
14-
15-
- name: Setup node
16-
uses: actions/setup-node@v2
17-
with:
18-
node-version: 15.x
19-
20-
- name: Installing dependencies
21-
run: npm ci
22-
23-
- name: Testing
24-
run: npm test
25-
26-
- name: Building
27-
run: npm run build
28-
29-
- name: Preparing to publish
30-
run: npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
31-
env:
32-
CI: true
33-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34-
35-
- name: Publish
36-
run: npm run semantic-release
37-
env:
38-
CI: true
39-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
40-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
41-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42-
43-
- name: publish coverage
44-
uses: coverallsapp/[email protected]
45-
with:
46-
github-token: ${{ secrets.GITHUB_TOKEN }}
47-
path-to-lcov: ./coverage/lcov.info
48-
env:
49-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Setup node
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: 15.x
19+
20+
- name: Installing dependencies
21+
run: npm ci
22+
23+
- name: Testing
24+
run: npm test
25+
26+
- name: Building
27+
run: npm run build
28+
29+
- name: Preparing to publish
30+
run: npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
31+
env:
32+
CI: true
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
35+
- name: Publish
36+
run: npm run semantic-release
37+
env:
38+
CI: true
39+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
40+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
43+
- name: publish coverage
44+
uses: coverallsapp/[email protected]
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
path-to-lcov: ./coverage/lcov.info
48+
env:
49+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![npm version](https://badge.fury.io/js/%40sebgroup%2Ffrontend-tools.svg)](https://www.npmjs.com/package/@sebgroup/frontend-tools)
66
![tree shakable](https://img.shields.io/badge/%F0%9F%8C%B2-tree--shakable-brightgreen)
77

8-
98
# **Frontend tools**
109

1110
A set of frontend utilities that can be used with any javascript application. It's lightweight and intuitive.

jest.config.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,34 @@ const { argv } = process;
44
* - The first two are `node` and `jest` URLs
55
* - Anything with `--` is an inline property such as `--watch` and `--detectOpenHandles`
66
*/
7-
const specific = argv.slice(2, argv.length).filter((value) => value.indexOf("--") === -1);
7+
const specific = argv
8+
.slice(2, argv.length)
9+
.filter((value) => value.indexOf("--") === -1);
810

911
const collectCoverageFrom = [];
1012
const testMatch = [];
1113

1214
function extractSpecifics(injectTo) {
13-
return specific.map((item) => injectTo.replace("%inject%", item))
15+
return specific.map((item) => injectTo.replace("%inject%", item));
1416
}
1517

1618
if (specific.length) {
1719
collectCoverageFrom.push(...extractSpecifics("src/**/%inject%.(ts|js)"));
18-
testMatch.push(...extractSpecifics("**/%inject%.test.(ts|js)"))
20+
testMatch.push(...extractSpecifics("**/%inject%.test.(ts|js)"));
1921
} else {
2022
collectCoverageFrom.push("src/**/*.(ts|js)");
2123
testMatch.push("**/*.test.(ts|js)");
2224
}
2325

24-
collectCoverageFrom.push("!src/index.js");
26+
collectCoverageFrom.push("!src/index.(ts|js)");
27+
collectCoverageFrom.push("!src/**/index.(ts|js)");
2528

2629
module.exports = {
2730
setupFilesAfterEnv: ["<rootDir>/setupTests.js"],
2831
testEnvironment: "jsdom",
2932
testMatch,
3033
modulePaths: ["<rootDir>/node_modules"],
31-
globals: { "NODE_ENV": "test" },
34+
globals: { NODE_ENV: "test" },
3235
verbose: true,
3336
moduleFileExtensions: ["ts", "js", "json"],
3437
transform: { "^.+\\.ts$": "ts-jest" },
@@ -38,5 +41,5 @@ module.exports = {
3841
collectCoverage: true,
3942
collectCoverageFrom,
4043
coverageDirectory: "./coverage",
41-
coverageReporters: ["json", "lcov", "text"]
42-
};
44+
coverageReporters: ["json", "lcov", "text"],
45+
};

prettier.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
semi: true,
3+
singleQuote: false,
4+
tabWidth: 4,
5+
trailingComma: "es5",
6+
};

rollup.config.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,24 @@ const components = require("./src/index.json");
88

99
const defaults = {
1010
input: ["./src/index.ts", ...components.indexes],
11-
external: [...Object.keys(pkg.peerDependencies || {}), ...Object.keys(pkg.dependencies || {}), ...Object.keys(commonPkg.dependencies || {})],
11+
external: [
12+
...Object.keys(pkg.peerDependencies || {}),
13+
...Object.keys(pkg.dependencies || {}),
14+
...Object.keys(commonPkg.dependencies || {}),
15+
],
1216
};
1317

14-
const resolveOnly = [new RegExp(`^((?!${defaults.external.map((item) => `(${item})`).join("|")}).)*$`, "g")];
18+
const resolveOnly = [
19+
new RegExp(
20+
`^((?!${defaults.external.map((item) => `(${item})`).join("|")}).)*$`,
21+
"g"
22+
),
23+
];
1524

1625
export default [
1726
{
1827
...defaults,
19-
plugins: [
20-
typescript(),
21-
resolve({ resolveOnly }),
22-
commonjs(),
23-
],
28+
plugins: [typescript(), resolve({ resolveOnly }), commonjs()],
2429
output: {
2530
dir: "dist",
2631
format: "cjs",
@@ -34,7 +39,12 @@ export default [
3439
{
3540
...defaults,
3641
plugins: [
37-
typescript({ compilerOptions: { declarationDir: "dist/esm", outDir: "dist/esm" } }),
42+
typescript({
43+
compilerOptions: {
44+
declarationDir: "dist/esm",
45+
outDir: "dist/esm",
46+
},
47+
}),
3848
resolve({ resolveOnly }),
3949
commonjs(),
4050
],

scripts/indexer.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@ const fs = require("fs");
33

44
const source = path.resolve(__dirname, "../src");
55

6-
const components = fs.readdirSync(source).filter((name) => fs.lstatSync(path.resolve(source, name)).isDirectory() && !name.startsWith("__"));
6+
const components = fs
7+
.readdirSync(source)
8+
.filter(
9+
(name) =>
10+
fs.lstatSync(path.resolve(source, name)).isDirectory() &&
11+
!name.startsWith("__")
12+
);
713

814
const paths = {};
915
components.forEach((name) => {
1016
paths[name] = `./src/${name}/index.ts`;
1117
});
1218
const indexes = components.map((name) => `./src/${name}/index.ts`);
1319

14-
fs.writeFileSync(path.resolve(source, "index.json"), JSON.stringify({ paths, indexes }, null, 4));
20+
fs.writeFileSync(
21+
path.resolve(source, "index.json"),
22+
JSON.stringify({ paths, indexes }, null, 4)
23+
);

scripts/post-build.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,44 @@ const pkg = require("../package.json");
55
const dist = path.resolve(__dirname, "../dist");
66
const root = path.resolve(__dirname, "../");
77

8-
const neededParams = ["name", "version", "description", "main", "typings", "repository", "keywords", "author", "license", "bugs", "dependencies", "module"];
8+
const neededParams = [
9+
"name",
10+
"version",
11+
"description",
12+
"main",
13+
"typings",
14+
"repository",
15+
"keywords",
16+
"author",
17+
"license",
18+
"bugs",
19+
"dependencies",
20+
"module",
21+
];
922

1023
Object.keys(pkg).forEach((param) => {
1124
if (!neededParams.includes(param)) {
1225
delete pkg[param];
1326
} else {
14-
if (!pkg[param] || (typeof pkg[param] === "object" && !Object.keys(pkg[param]).length)) {
27+
if (
28+
!pkg[param] ||
29+
(typeof pkg[param] === "object" && !Object.keys(pkg[param]).length)
30+
) {
1531
delete pkg[param];
1632
}
1733
}
1834
});
1935

20-
fs.writeFileSync(path.resolve(dist, "package.json"), JSON.stringify(pkg, null, 4));
36+
fs.writeFileSync(
37+
path.resolve(dist, "package.json"),
38+
JSON.stringify(pkg, null, 4)
39+
);
2140
console.info("✅ Created package.json in dist folder");
2241

23-
fs.copyFileSync(path.resolve(root, "README.md"), path.resolve(dist, "README.md"));
42+
fs.copyFileSync(
43+
path.resolve(root, "README.md"),
44+
path.resolve(dist, "README.md")
45+
);
2446
console.info("✅ Copied over README.md to dist");
2547

2648
fs.copyFileSync(path.resolve(root, "LICENSE"), path.resolve(dist, "LICENSE"));

0 commit comments

Comments
 (0)