From 1d5e718ede50e5f9ce025ea356f49fcf54d01480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20=F0=9F=91=A8=F0=9F=8F=BD=E2=80=8D=F0=9F=92=BB=20Copl?= =?UTF-8?q?an?= Date: Mon, 19 Aug 2024 10:25:36 -0700 Subject: [PATCH] chore: distribute tsconfig and rollup config files Summary: We currently distribute the source code for the project, but not the configuration files, meaning that users cannot build the project. This commit adds the tsconfig.json and rollup.config.js files to the distributed package. Test Plan: - Run `npm run build` and ensure that the project builds successfully - In another project add this package as a dependency and run `npm install && cd node_modules/web-vitals && npm install --ignore-scripts && npm run build` and ensure that the project builds successfully Motivation: I am currently working on a [patch](https://github.com/GoogleChrome/web-vitals-extension/pull/184) for the web vitals Chrome extension and need to use a development build of this web-vitals package. To do that, I want to make a patch like ```diff diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "private": true, "scripts": { "lint": "npx eslint src --fix", - "build": "npm install; cp node_modules/web-vitals/dist/web-vitals.attribution.js src/browser_action/web-vitals.js" + "build": "npm install && (cd node_modules/web-vitals/ && npm install --ignore-scripts && npm run build) && cp node_modules/web-vitals/dist/web-vitals.attribution.js src/browser_action/web-vitals.js" }, "devDependencies": { "babel-eslint": "^10.1.0", @@ -21,6 +21,10 @@ "eslint-config-google": "^0.14.0" }, "dependencies": { - "web-vitals": "^4.0.0" + "web-vitals": "git://github.com/GoogleChrome/web-vitals.git#soft-navs" + }, ``` however, the `npm run build` part fails because we don't distribute `tsconfig.json` and `rollup.config.js`. This commit fixes that. --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ca57344a..4c734aea 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,9 @@ "attribution.js", "attribution.d.ts", "dist", - "src" + "src", + "tsconfig.json", + "rollup.config.js" ], "scripts": { "build": "run-s clean build:ts build:js",