-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from scout-ch/configure-react-from-scratch
Configure react from scratch
- Loading branch information
Showing
93 changed files
with
40,647 additions
and
40,530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
# production | ||
/build | ||
/dist | ||
|
||
# misc | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = (api) => { | ||
const isTest = api.env("test"); | ||
const isDev = api.env("development"); | ||
return { | ||
plugins: [...(isDev ? ["react-refresh/babel"] : [])], | ||
presets: [ | ||
[ | ||
"@babel/env", | ||
{ | ||
bugfixes: true, | ||
useBuiltIns: "usage", | ||
corejs: 3, | ||
shippedProposals: true, | ||
...(isTest | ||
? { | ||
targets: { | ||
node: "current", | ||
}, | ||
} | ||
: {}), | ||
}, | ||
], | ||
[ | ||
"@babel/react", | ||
{ | ||
useBuiltIns: true, | ||
runtime: "automatic", | ||
}, | ||
], | ||
[ | ||
"@babel/typescript", | ||
{ | ||
allowDeclareFields: true, | ||
onlyRemoveTypeImports: true, | ||
}, | ||
], | ||
], | ||
retainLines: isTest, | ||
assumptions: { | ||
ignoreFunctionLength: true, | ||
constantReexports: true, | ||
noClassCalls: true, | ||
noDocumentAll: true, | ||
}, | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "0.2", | ||
"words": ["browserconfig", "corejs", "lcov", "loglevel", "msapplication", "mstile", "transpiling"], | ||
"ignorePaths": ["package.json", "package-lock.json"], | ||
"useGitignore": true, | ||
"validateDirectives": true, | ||
"cache": { | ||
"useCache": true, | ||
"cacheLocation": "./node_modules/.cache/cspell/.cspell" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-env node */ | ||
|
||
const inspector = require("inspector"); | ||
const isDebuggerAttached = inspector.url() !== undefined; | ||
|
||
module.exports = { | ||
restoreMocks: true, | ||
collectCoverage: true, | ||
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}"], | ||
coverageDirectory: "coverage", | ||
coverageReporters: ["text-summary", "lcov"], | ||
coverageThreshold: { | ||
global: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100, | ||
}, | ||
}, | ||
errorOnDeprecated: true, | ||
moduleNameMapper: { | ||
"\\.(css|less|scss|sass)$": "identity-obj-proxy", | ||
"test/(.*)$": "<rootDir>/test/$1", | ||
"~/(.*)$": "<rootDir>/src/$1", | ||
}, | ||
transform: { | ||
"\\.[jt]sx?$": "babel-jest", | ||
"\\.(jpg|jpeg|png|gif|webp|svg|bmp|woff|woff2|ttf)$": "<rootDir>/test/transformers/importPathTransformer.js", | ||
}, | ||
setupFilesAfterEnv: ["<rootDir>/test/setup.ts"], | ||
globalTeardown: "<rootDir>/test/teardown.ts", | ||
fakeTimers: { | ||
enableGlobally: true, | ||
}, | ||
verbose: true, | ||
testEnvironment: "jsdom", | ||
testTimeout: isDebuggerAttached ? 10000000 : 5000, | ||
randomize: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-env node */ | ||
|
||
const path = require("path"); | ||
|
||
module.exports = { | ||
"*.{js,ts,jsx,tsx,json,html,xml,svg,css,scss,sass,md}": "cspell --no-progress --no-must-find-files", | ||
"*.{js,ts,jsx,tsx}": "eslint --max-warnings 0 --fix", | ||
"*": "prettier --write --ignore-unknown --loglevel warn", | ||
"src/**/*.{js,ts,jsx,tsx}": (paths) => { | ||
const relativePaths = paths.map((filePath) => | ||
path.relative(__dirname, filePath).split(path.sep).join(path.posix.sep) | ||
); | ||
// Running unit tests is the largest contributor to the speed of a commit. | ||
// If you are running all of your validations in PR before merging then remove this and depend on PR checks. | ||
// This is only useful if you are directly pushing code and not creating PRs. | ||
return `jest --runInBand --bail --collectCoverageFrom '(${relativePaths.join( | ||
"|" | ||
)})' --coverage --findRelatedTests ${paths.join(" ")}`; | ||
}, | ||
}; |
Oops, something went wrong.