Skip to content

Commit fd5b1b9

Browse files
committed
feat: change prettier rules to use spaces instead of tabs + add more steps to github test action
1 parent 7b23760 commit fd5b1b9

Some content is hidden

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

71 files changed

+4140
-3807
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
/packages/hmr-plugin/client/clients
1+
/packages/hmr-plugin/src/client/clients
2+
examples/**
23
**/node_modules
34
node_modules

.eslintrc.json

+37-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
11
{
2-
"env": {
3-
"commonjs": true,
4-
"es2021": true,
5-
"node": true
6-
},
7-
"extends": "eslint:recommended",
8-
"parserOptions": {
9-
"ecmaVersion": 12
10-
},
11-
"overrides": [
12-
{
13-
"files": ["packages/hmr-plugin/hot/*.js", "packages/hmr-plugin/client/**/*.js"],
14-
"env": {
15-
"es6": false,
16-
"browser": true
17-
},
18-
"globals": {
19-
"Promise": false,
20-
"document": true,
21-
"window": true
22-
},
23-
"parserOptions": {
24-
"ecmaVersion": 5
25-
}
26-
}
27-
],
28-
"rules": {}
2+
"env": {
3+
"commonjs": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": "eslint:recommended",
8+
"parserOptions": {
9+
"ecmaVersion": 12
10+
},
11+
"overrides": [
12+
{
13+
"files": ["examples/**/*.js"],
14+
"env": {
15+
"es6": true,
16+
"browser": true
17+
}
18+
},
19+
{
20+
"files": [
21+
"packages/hmr-plugin/src/hot/*.js",
22+
"packages/hmr-plugin/src/client/**/*.js"
23+
],
24+
"env": {
25+
"es6": false,
26+
"browser": true
27+
},
28+
"globals": {
29+
"Promise": false,
30+
"document": true,
31+
"window": true
32+
},
33+
"parserOptions": {
34+
"ecmaVersion": 5
35+
}
36+
}
37+
],
38+
"rules": {}
2939
}

.github/workflows/test.yml

+58-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,71 @@ name: test
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
types: [ opened, synchronize ]
7+
types: [opened, synchronize]
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest]
14+
node: [10, 12]
15+
runs-on: ${{ matrix.os }}
1216
steps:
1317
- uses: actions/checkout@v2
1418
- run: yarn install --frozen-lockfile --check-files
15-
- uses: actions/cache@v2
19+
- name: cache workspace
20+
uses: actions/cache@v2
1621
id: cache-build
1722
with:
1823
path: ./*
19-
key: ${{ github.sha }}
24+
key: ${{ github.sha }}
25+
26+
lint:
27+
strategy:
28+
matrix:
29+
os: [ubuntu-latest]
30+
node: [10, 12]
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/cache@v2
34+
id: restore-build
35+
with:
36+
path: ./*
37+
key: ${{ github.sha }}
38+
- run: yarn lint
39+
needs: [build]
40+
41+
test-unit:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/cache@v2
45+
id: restore-build
46+
with:
47+
path: ./*
48+
key: ${{ github.sha }}
49+
- run: yarn test:unit
50+
needs: [build]
51+
52+
test-fixtures:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/cache@v2
56+
id: restore-build
57+
with:
58+
path: ./*
59+
key: ${{ github.sha }}
60+
- run: yarn test:fixtures --passWithNoTests
61+
needs: [build]
62+
63+
test-e2e:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/cache@v2
67+
id: restore-build
68+
with:
69+
path: ./*
70+
key: ${{ github.sha }}
71+
- run: yarn test:e2e --passWithNoTests
72+
needs: [build]

.prettierignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
22
lerna.json
3-
packages/hmr-plugin/hot
4-
packages/hmr-plugin/client
3+
packages/hmr-plugin/src/hot
4+
packages/hmr-plugin/src/client
55
**/node_modules

.prettierrc.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"printWidth": 120,
3-
"useTabs": true,
4-
"tabWidth": 2,
5-
"singleQuote": true,
6-
"semi": false
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"semi": false
75
}

examples/minimal/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "frontal-minimal-example",
3-
"scripts": {
4-
"dev": "frontal dev",
5-
"build": "frontal build",
6-
"serve": "frontal serve"
7-
},
8-
"devDependencies": {
9-
"frontal.js": "latest"
10-
}
2+
"name": "frontal-minimal-example",
3+
"scripts": {
4+
"dev": "frontal dev",
5+
"build": "frontal build",
6+
"serve": "frontal serve"
7+
},
8+
"devDependencies": {
9+
"frontal.js": "latest"
10+
}
1111
}

examples/minimal/pages/index.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<title>Hello World</title>
6-
</head>
7-
<body>
8-
<p>A Basic Frontal Application</p>
9-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Hello World</title>
6+
</head>
7+
<body>
8+
<p>A Basic Frontal Application</p>
9+
</body>
1010
</html>

jest.config.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ const path = require('path')
44
const corePackages = fs.readdirSync(path.resolve(__dirname, 'packages'))
55

66
module.exports = {
7-
testEnvironment: 'node',
8-
expand: true,
9-
forceExit: true,
10-
roots: ['<rootDir>/packages', '<rootDir>/test'],
11-
coverageDirectory: './coverage',
12-
collectCoverageFrom: ['**/packages/*/src/**/*.js'],
13-
coveragePathIgnorePatterns: [],
14-
testPathIgnorePatterns: ['examples/.*'],
15-
moduleFileExtensions: ['js', 'json'],
16-
moduleNameMapper: {
17-
[`@frontal/(${corePackages.join('|')})(/?.*)$`]: '<rootDir>/packages/$1/src/$2',
18-
},
7+
testEnvironment: 'node',
8+
expand: true,
9+
forceExit: true,
10+
roots: ['<rootDir>/packages', '<rootDir>/test'],
11+
coverageDirectory: './coverage',
12+
collectCoverageFrom: ['**/packages/*/src/**/*.js'],
13+
coveragePathIgnorePatterns: [],
14+
testPathIgnorePatterns: ['examples/.*'],
15+
moduleFileExtensions: ['js', 'json'],
16+
moduleNameMapper: {
17+
[`@frontal/(${corePackages.join(
18+
'|'
19+
)})(/?.*)$`]: '<rootDir>/packages/$1/src/$2',
20+
},
1921
}

package.json

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"name": "frontal.js",
3-
"private": true,
4-
"workspaces": [
5-
"packages/*"
6-
],
7-
"scripts": {
8-
"lint": "eslint . --ext js",
9-
"prettier-check": "prettier --check .",
10-
"prettier-fix": "prettier --write .",
11-
"test:unit": "cross-env jest packages --forceExit",
12-
"test:fixtures": "cross-env jest test/fixtures --forceExit",
13-
"test:e2e": "cross-env jest test/e2e --forceExit"
14-
},
15-
"devDependencies": {
16-
"cross-env": "7.0.2",
17-
"eslint": "^7.14.0",
18-
"jest": "26.6.3",
19-
"lerna": "^3.22.1",
20-
"prettier": "2.2.1"
21-
},
22-
"engines": {
23-
"node": ">= 10.13.0"
24-
}
2+
"name": "frontal.js",
3+
"private": true,
4+
"workspaces": [
5+
"packages/*"
6+
],
7+
"scripts": {
8+
"lint": "yarn prettier:check && eslint . --ext js",
9+
"prettier:check": "prettier --check .",
10+
"prettier:fix": "prettier --write .",
11+
"test:unit": "cross-env jest packages --forceExit",
12+
"test:fixtures": "cross-env jest test/fixtures --forceExit",
13+
"test:e2e": "cross-env jest test/e2e --forceExit"
14+
},
15+
"devDependencies": {
16+
"cross-env": "7.0.2",
17+
"eslint": "^7.14.0",
18+
"jest": "26.6.3",
19+
"lerna": "^3.22.1",
20+
"prettier": "2.2.1"
21+
},
22+
"engines": {
23+
"node": ">= 10.13.0"
24+
}
2525
}

packages/config/package.json

+34-34
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
2-
"name": "@frontal/config",
3-
"version": "0.1.15",
4-
"description": "Frontal's application's configuration parser",
5-
"homepage": "https://github.com/dlexio/frontal.js",
6-
"license": "MIT",
7-
"main": "src/config.js",
8-
"files": [
9-
"src"
10-
],
11-
"repository": {
12-
"type": "git",
13-
"url": "https://github.com/dlexio/frontal.js.git",
14-
"directory": "packages/config"
15-
},
16-
"publishConfig": {
17-
"access": "public"
18-
},
19-
"dependencies": {
20-
"@frontal/errors-plugin": "^0.1.7",
21-
"@frontal/files-plugin": "^0.1.4",
22-
"@frontal/hmr-plugin": "^0.1.7",
23-
"@frontal/icons-plugin": "^0.1.1",
24-
"@frontal/library-plugin": "^0.1.9",
25-
"@frontal/lint-plugin": "^0.1.4",
26-
"@frontal/nextjs-plugin": "^0.1.7",
27-
"@frontal/pages-plugin": "^0.1.10",
28-
"@frontal/style-plugin": "^0.1.7",
29-
"chokidar": "^3.4.3",
30-
"consola": "^2.15.0",
31-
"is": "^3.3.0",
32-
"lodash": "^4.17.20",
33-
"require-like": "^0.1.2",
34-
"schema-utils": "^3.0.0"
35-
}
2+
"name": "@frontal/config",
3+
"version": "0.1.15",
4+
"description": "Frontal's application's configuration parser",
5+
"homepage": "https://github.com/dlexio/frontal.js",
6+
"license": "MIT",
7+
"main": "src/config.js",
8+
"files": [
9+
"src"
10+
],
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/dlexio/frontal.js.git",
14+
"directory": "packages/config"
15+
},
16+
"publishConfig": {
17+
"access": "public"
18+
},
19+
"dependencies": {
20+
"@frontal/errors-plugin": "^0.1.7",
21+
"@frontal/files-plugin": "^0.1.4",
22+
"@frontal/hmr-plugin": "^0.1.7",
23+
"@frontal/icons-plugin": "^0.1.1",
24+
"@frontal/library-plugin": "^0.1.9",
25+
"@frontal/lint-plugin": "^0.1.4",
26+
"@frontal/nextjs-plugin": "^0.1.7",
27+
"@frontal/pages-plugin": "^0.1.10",
28+
"@frontal/style-plugin": "^0.1.7",
29+
"chokidar": "^3.4.3",
30+
"consola": "^2.15.0",
31+
"is": "^3.3.0",
32+
"lodash": "^4.17.20",
33+
"require-like": "^0.1.2",
34+
"schema-utils": "^3.0.0"
35+
}
3636
}

0 commit comments

Comments
 (0)