Skip to content

Commit 6c908a1

Browse files
authored
Initialize Project (#1)
1 parent b29bc99 commit 6c908a1

Some content is hidden

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

41 files changed

+3956
-1
lines changed

.eslintrc.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
const config = {
3+
root: true,
4+
parser: "@typescript-eslint/parser",
5+
plugins: ["isaacscript", "import"],
6+
extends: [
7+
"plugin:@typescript-eslint/recommended-type-checked",
8+
"plugin:@typescript-eslint/stylistic-type-checked",
9+
"plugin:prettier/recommended",
10+
],
11+
parserOptions: {
12+
ecmaVersion: "latest",
13+
sourceType: "module",
14+
tsconfigRootDir: __dirname,
15+
project: [
16+
"./tsconfig.json",
17+
"./packages/esbuild-stats/tsconfig.json",
18+
"./packages/vite-stats/tsconfig.json",
19+
"./packages/webpack-stats/tsconfig.json",
20+
],
21+
},
22+
rules: {
23+
"@typescript-eslint/no-unused-vars": [
24+
"error",
25+
{ argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" },
26+
],
27+
"@typescript-eslint/consistent-type-imports": [
28+
"error",
29+
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
30+
],
31+
"import/consistent-type-specifier-style": ["error", "prefer-inline"],
32+
"isaacscript/complete-sentences-jsdoc": "warn",
33+
"isaacscript/format-jsdoc-comments": "warn",
34+
"@typescript-eslint/no-confusing-void-expressions": "off",
35+
"@typescript-eslint/restrict-template-expressions": "off",
36+
},
37+
};
38+
39+
module.exports = config;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# bundle-stats-plugin
1+
# Codecov Bundle Stats Plugin

bundlers/esbuild/app.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as React from "react";
2+
import * as Server from "react-dom/server";
3+
4+
let Greet = () => <h1>Hello, world!</h1>;
5+
console.log(Server.renderToString(<Greet />));

bundlers/esbuild/esbuild.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as esbuild from "esbuild";
2+
3+
await esbuild.build({
4+
entryPoints: ["app.jsx"],
5+
bundle: true,
6+
outdir: "dist",
7+
});

bundlers/esbuild/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "esbuild",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"build": "node esbuild.config.mjs"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "Apache-2.0",
12+
"dependencies": {
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0"
15+
},
16+
"devDependencies": {
17+
"esbuild": "0.19.4"
18+
}
19+
}

bundlers/vite/.eslintrc.cjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['react-refresh'],
12+
rules: {
13+
'react-refresh/only-export-components': [
14+
'warn',
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
}

bundlers/vite/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

bundlers/vite/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13+
14+
- Configure the top-level `parserOptions` property like this:
15+
16+
```js
17+
parserOptions: {
18+
ecmaVersion: 'latest',
19+
sourceType: 'module',
20+
project: ['./tsconfig.json', './tsconfig.node.json'],
21+
tsconfigRootDir: __dirname,
22+
},
23+
```
24+
25+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
26+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
27+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list

bundlers/vite/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

bundlers/vite/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "vite",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"react": "^18.2.0",
14+
"react-dom": "^18.2.0"
15+
},
16+
"devDependencies": {
17+
"@types/react": "^18.2.15",
18+
"@types/react-dom": "^18.2.7",
19+
"@typescript-eslint/eslint-plugin": "^6.0.0",
20+
"@typescript-eslint/parser": "^6.0.0",
21+
"@vitejs/plugin-react": "^4.0.3",
22+
"eslint": "^8.45.0",
23+
"eslint-plugin-react-hooks": "^4.6.0",
24+
"eslint-plugin-react-refresh": "^0.4.3",
25+
"rollup": "^4.1.4",
26+
"rollup-stats": "workspace:^",
27+
"typescript": "^5.0.2",
28+
"vite": "^4.4.5"
29+
}
30+
}

0 commit comments

Comments
 (0)