Skip to content

Commit 755ebc7

Browse files
authored
ref: Restructuring the Packages and Plugin (#2)
Restructure a lot of the things, move away from tsup to unbuild.
1 parent 6c908a1 commit 755ebc7

37 files changed

+2219
-406
lines changed

.eslintrc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ const config = {
1414
tsconfigRootDir: __dirname,
1515
project: [
1616
"./tsconfig.json",
17-
"./packages/esbuild-stats/tsconfig.json",
18-
"./packages/vite-stats/tsconfig.json",
19-
"./packages/webpack-stats/tsconfig.json",
17+
"./packages/bundler-plugin-core/tsconfig.json",
18+
"./packages/esbuild-plugin/tsconfig.json",
19+
"./packages/rollup-plugin/tsconfig.json",
20+
"./packages/vite-plugin/tsconfig.json",
21+
"./packages/webpack-plugin/tsconfig.json",
2022
],
2123
},
2224
rules: {

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
# Codecov Bundle Stats Plugin
1+
<p align="center">
2+
<a href="https://about.codecov.io" target="_blank">
3+
<img src="https://about.codecov.io/wp-content/themes/codecov/assets/brand/sentry-cobranding/logos/codecov-by-sentry-logo.svg" alt="Codecov by Sentry logo" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Codecov Bundler Plugins
8+
9+
TODO

bundlers/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"eslint-plugin-react-hooks": "^4.6.0",
2424
"eslint-plugin-react-refresh": "^0.4.3",
2525
"rollup": "^4.1.4",
26-
"rollup-stats": "workspace:^",
26+
"@codecov/vite-plugin": "workspace:^",
2727
"typescript": "^5.0.2",
2828
"vite": "^4.4.5"
2929
}

bundlers/vite/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";
3-
import { rollupStatsPlugin } from "rollup-stats";
3+
import { viteStatsPlugin } from "@codecov/vite-plugin";
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7-
plugins: [react(), rollupStatsPlugin()],
7+
plugins: [react(), viteStatsPlugin()],
88
});

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,11 @@
2828
"eslint-plugin-prettier": "^5.0.1",
2929
"prettier": "^3.0.3",
3030
"typescript": "^5.2.2"
31+
},
32+
"volta": {
33+
"node": "20.9.0"
34+
},
35+
"engines": {
36+
"node": ">=20.0.0"
3137
}
3238
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<p align="center">
2+
<a href="https://about.codecov.io" target="_blank">
3+
<img src="https://about.codecov.io/wp-content/themes/codecov/assets/brand/sentry-cobranding/logos/codecov-by-sentry-logo.svg" alt="Codecov by Sentry logo" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Codecov Bundler Plugin Core
8+
9+
TODO
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineBuildConfig } from "unbuild";
2+
3+
export default defineBuildConfig({
4+
entries: ["./src/index"],
5+
outDir: "dist",
6+
declaration: "compatible",
7+
sourcemap: true,
8+
rollup: {
9+
emitCJS: true,
10+
esbuild: {
11+
minify: true,
12+
},
13+
},
14+
});
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "@codecov/bundler-plugin-core",
3+
"version": "0.0.1",
4+
"description": "",
5+
"type": "module",
6+
"exports": {
7+
".": {
8+
"import": {
9+
"types": "./dist/index.d.mts",
10+
"default": "./dist/index.mjs"
11+
},
12+
"require": {
13+
"types": "./dist/index.d.ts",
14+
"default": "./dist/index.cjs"
15+
}
16+
}
17+
},
18+
"main": "./dist/index.cjs",
19+
"module": "./dist/index.mjs",
20+
"types": "./dist/index.d.ts",
21+
"files": [
22+
"dist"
23+
],
24+
"scripts": {
25+
"typecheck": "tsc",
26+
"build": "unbuild",
27+
"dev": "unbuild --stub && node --watch-path=src dist/index.mjs",
28+
"clean": "rm -rf dist .turbo node_modules",
29+
"lint": "eslint . --ext .ts,.tsx",
30+
"lint:fix": "pnpm lint --fix",
31+
"format": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --write",
32+
"format:check": "prettier '**/*.{cjs,mjs,ts,tsx,md,json}' --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern --check"
33+
},
34+
"keywords": [],
35+
"author": "",
36+
"license": "Apache-2.0",
37+
"dependencies": {
38+
"unplugin": "^1.5.0"
39+
},
40+
"devDependencies": {
41+
"@types/node": "^20.8.6",
42+
"typescript": "^5.0.4",
43+
"unbuild": "^2.0.0"
44+
},
45+
"volta": {
46+
"extends": "../../package.json"
47+
},
48+
"engines": {
49+
"node": ">=20.0.0"
50+
}
51+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createUnplugin } from "unplugin";
2+
3+
export const unplugin = createUnplugin((_options) => {
4+
return {
5+
name: "unplugin-stats",
6+
};
7+
});

packages/vite-stats/tsconfig.json renamed to packages/bundler-plugin-core/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
},
88
"checkJs": true
99
},
10-
"include": ["src", "tsup.config.ts", "../../reset.d.ts"]
10+
"include": ["src", "build.config.ts", "../../reset.d.ts"]
1111
}

0 commit comments

Comments
 (0)