2022-08-16 08:37:16 -07:00
|
|
|
{
|
|
|
|
|
"name": "@material/web",
|
2024-09-17 17:02:37 +00:00
|
|
|
"version": "2.2.0",
|
2022-08-26 16:38:19 -07:00
|
|
|
"publishConfig": {
|
|
|
|
|
"access": "public"
|
|
|
|
|
},
|
2022-08-16 08:37:16 -07:00
|
|
|
"description": "Material web components",
|
2023-08-22 16:26:59 -07:00
|
|
|
"keywords": [
|
|
|
|
|
"material",
|
|
|
|
|
"material design",
|
|
|
|
|
"design system",
|
|
|
|
|
"components",
|
|
|
|
|
"web components",
|
|
|
|
|
"lit"
|
|
|
|
|
],
|
2022-08-16 08:37:16 -07:00
|
|
|
"repository": {
|
|
|
|
|
"type": "git",
|
|
|
|
|
"url": "git+https://github.com/material-components/material-web.git"
|
|
|
|
|
},
|
|
|
|
|
"license": "Apache-2.0",
|
|
|
|
|
"bugs": {
|
|
|
|
|
"url": "https://github.com/material-components/material-web/issues"
|
|
|
|
|
},
|
|
|
|
|
"homepage": "https://github.com/material-components/material-web#readme",
|
|
|
|
|
"scripts": {
|
2022-11-15 13:35:16 -08:00
|
|
|
"build": "wireit",
|
|
|
|
|
"build:ts": "wireit",
|
|
|
|
|
"build:css-to-ts": "wireit",
|
2022-11-29 16:09:11 -08:00
|
|
|
"build:sass": "wireit",
|
2023-05-17 19:18:29 -07:00
|
|
|
"test": "wireit",
|
2023-09-19 21:05:08 -07:00
|
|
|
"build:catalog": "wireit",
|
2023-12-12 17:25:03 -08:00
|
|
|
"build:scripts": "wireit",
|
|
|
|
|
"update-docs": "wireit",
|
|
|
|
|
"update-size": "wireit"
|
2022-08-16 08:37:16 -07:00
|
|
|
},
|
2022-11-29 16:18:41 -08:00
|
|
|
"type": "module",
|
chore: Don't publish .ts or testing files
Before this change, we publish .ts source files to the same directory as the .js/.d.ts files to npm.
That means when a consumer imports a @material/web module with TypeScript, TypeScript prefers the .ts file over the .d.ts file when to load that module's types.
That in turn means the consumer's TypeScript type-checks the entire @material/web .ts file, including its private implementation details (private fields, etc.). If the consumer's tsconfig.json is configured more strictly than @material/web's was (e.g. if noUnusedParameters is true), or if some additional ambient types are loaded (e.g. @types/node is installed, which changes the signature of setTimeout), they would get a compile error.
This change stops publishing .ts files to npm to solve that problem for consumers.
This also includes some related changes:
- Sets inlineSources to true. This puts the .ts file contents directly inside the .js.map file, instead of linking to the .ts path. Otherwise sourcemaps would not work.
- Sets declarationMap to false. This removes the .d.ts.map files, which are not useful without the .ts paths, because there is no equivalent to inlineSources for declarationMap (see https://github.com/microsoft/TypeScript/issues/38966).
- Replaces .npmignore blocklist with package.json files allowlist (which I find to be a bit safer), and adds new omissions for testing files, which don't need to be published.
Note that this doesn't solve the problem when using "npm link" for local cross-package development, because in that case the .ts files will still be present. So a better solution to this problem would be to have a separate src/ directory for .ts source files. That will require a Copybara transform to move the files. We can discuss this separately and do it as a followup if agreed.
PiperOrigin-RevId: 469833263
2022-08-24 15:03:43 -07:00
|
|
|
"files": [
|
|
|
|
|
"**/*.js",
|
|
|
|
|
"**/*.js.map",
|
|
|
|
|
"**/*.d.ts",
|
|
|
|
|
"**/*.scss",
|
2024-03-20 16:39:27 -07:00
|
|
|
"**/*.css",
|
|
|
|
|
"**/*.css.map",
|
2022-11-29 16:09:11 -08:00
|
|
|
"!web-test-runner.config.js",
|
2023-12-20 15:19:23 -08:00
|
|
|
"!commitlint.config.js",
|
chore: Don't publish .ts or testing files
Before this change, we publish .ts source files to the same directory as the .js/.d.ts files to npm.
That means when a consumer imports a @material/web module with TypeScript, TypeScript prefers the .ts file over the .d.ts file when to load that module's types.
That in turn means the consumer's TypeScript type-checks the entire @material/web .ts file, including its private implementation details (private fields, etc.). If the consumer's tsconfig.json is configured more strictly than @material/web's was (e.g. if noUnusedParameters is true), or if some additional ambient types are loaded (e.g. @types/node is installed, which changes the signature of setTimeout), they would get a compile error.
This change stops publishing .ts files to npm to solve that problem for consumers.
This also includes some related changes:
- Sets inlineSources to true. This puts the .ts file contents directly inside the .js.map file, instead of linking to the .ts path. Otherwise sourcemaps would not work.
- Sets declarationMap to false. This removes the .d.ts.map files, which are not useful without the .ts paths, because there is no equivalent to inlineSources for declarationMap (see https://github.com/microsoft/TypeScript/issues/38966).
- Replaces .npmignore blocklist with package.json files allowlist (which I find to be a bit safer), and adds new omissions for testing files, which don't need to be published.
Note that this doesn't solve the problem when using "npm link" for local cross-package development, because in that case the .ts files will still be present. So a better solution to this problem would be to have a separate src/ directory for .ts source files. That will require a Copybara transform to move the files. We can discuss this separately and do it as a followup if agreed.
PiperOrigin-RevId: 469833263
2022-08-24 15:03:43 -07:00
|
|
|
"!**/test/**",
|
2022-11-15 13:35:16 -08:00
|
|
|
"!**/*_test.*",
|
2023-06-13 17:42:07 -05:00
|
|
|
"!.wireit/**",
|
2024-03-05 11:51:54 -08:00
|
|
|
"!catalog/",
|
2024-01-19 18:35:32 +01:00
|
|
|
"!scripts/",
|
|
|
|
|
"!**/testing/**",
|
|
|
|
|
"testing/harness.{js,js.map,d.ts}",
|
|
|
|
|
"testing/transform-pseudo-classes.{js,js.map,d.ts}"
|
2023-05-17 19:18:29 -07:00
|
|
|
],
|
2023-09-26 21:49:18 +00:00
|
|
|
"workspaces": [
|
|
|
|
|
"catalog"
|
|
|
|
|
],
|
2022-08-16 08:37:16 -07:00
|
|
|
"dependencies": {
|
2023-08-23 17:37:16 -07:00
|
|
|
"lit": "^2.7.4 || ^3.0.0",
|
2022-08-16 08:37:16 -07:00
|
|
|
"tslib": "^2.4.0"
|
|
|
|
|
},
|
|
|
|
|
"devDependencies": {
|
2024-06-04 21:57:37 -07:00
|
|
|
"@lit-labs/analyzer": "^0.12.1",
|
2023-12-12 17:25:03 -08:00
|
|
|
"@rollup/plugin-multi-entry": "^6.0.1",
|
|
|
|
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
|
|
|
"@rollup/plugin-terser": "^0.4.4",
|
2022-08-16 08:37:16 -07:00
|
|
|
"@types/jasmine": "^4.0.3",
|
2024-06-18 21:35:34 +00:00
|
|
|
"@web/test-runner": "^0.18.2",
|
2022-11-29 16:08:45 -08:00
|
|
|
"@web/test-runner-playwright": "^0.9.0",
|
2022-11-29 16:57:05 -08:00
|
|
|
"jasmine": "^4.5.0",
|
2023-12-12 17:25:03 -08:00
|
|
|
"rollup": "^2.79.1",
|
2022-08-16 08:37:16 -07:00
|
|
|
"sass": "^1.52.3",
|
|
|
|
|
"sass-true": "^6.1.0",
|
2023-09-08 12:10:45 -07:00
|
|
|
"typescript": "5.1.6",
|
2024-06-18 21:35:34 +00:00
|
|
|
"web-test-runner-jasmine": "^0.0.6",
|
2023-09-08 15:25:09 -07:00
|
|
|
"wireit": "^0.13.0"
|
2022-11-15 13:35:16 -08:00
|
|
|
},
|
|
|
|
|
"wireit": {
|
|
|
|
|
"build": {
|
2023-09-26 21:49:18 +00:00
|
|
|
"dependencies": [
|
|
|
|
|
"build:ts"
|
|
|
|
|
]
|
2022-11-15 13:35:16 -08:00
|
|
|
},
|
|
|
|
|
"build:ts": {
|
|
|
|
|
"command": "tsc --pretty",
|
|
|
|
|
"files": [
|
|
|
|
|
"tsconfig.json",
|
|
|
|
|
"**/*.ts",
|
|
|
|
|
"!**/*.d.ts",
|
2024-02-28 16:19:39 -08:00
|
|
|
"!**/*-styles.ts",
|
2024-03-05 11:51:54 -08:00
|
|
|
"!catalog/",
|
|
|
|
|
"!scripts/"
|
2022-11-15 13:35:16 -08:00
|
|
|
],
|
|
|
|
|
"output": [
|
|
|
|
|
".tsbuildinfo",
|
|
|
|
|
"**/*.js",
|
|
|
|
|
"**/*.js.map",
|
|
|
|
|
"**/*.d.ts",
|
2023-07-20 15:01:55 -07:00
|
|
|
"!web-test-runner.config.js",
|
2023-12-20 15:19:23 -08:00
|
|
|
"!commitlint.config.js",
|
2023-05-17 19:18:29 -07:00
|
|
|
"!types/",
|
2024-03-05 11:51:54 -08:00
|
|
|
"!catalog/",
|
2023-09-19 21:05:08 -07:00
|
|
|
"!scripts/"
|
2022-11-15 13:35:16 -08:00
|
|
|
],
|
|
|
|
|
"clean": "if-file-deleted",
|
2023-09-26 21:49:18 +00:00
|
|
|
"dependencies": [
|
|
|
|
|
"build:css-to-ts"
|
|
|
|
|
]
|
2022-11-15 13:35:16 -08:00
|
|
|
},
|
|
|
|
|
"build:css-to-ts": {
|
2024-03-05 11:51:54 -08:00
|
|
|
"command": "find . \\( -path ./.wireit -o -path ./node_modules -o -path ./catalog \\) -prune -o -name '*-styles.css' -print | xargs -L1 node scripts/css-to-ts.js",
|
2023-09-26 21:49:18 +00:00
|
|
|
"files": [
|
2024-03-05 11:51:54 -08:00
|
|
|
"**/*-styles.css",
|
|
|
|
|
"!catalog/"
|
2023-09-26 21:49:18 +00:00
|
|
|
],
|
|
|
|
|
"output": [
|
2024-02-28 16:19:39 -08:00
|
|
|
"**/*-styles.ts",
|
2024-03-05 11:51:54 -08:00
|
|
|
"!catalog/"
|
2023-09-26 21:49:18 +00:00
|
|
|
],
|
|
|
|
|
"dependencies": [
|
2024-03-05 11:51:54 -08:00
|
|
|
"build:scripts",
|
2023-09-26 21:49:18 +00:00
|
|
|
"build:sass"
|
|
|
|
|
]
|
2022-11-15 13:35:16 -08:00
|
|
|
},
|
|
|
|
|
"build:sass": {
|
2023-06-28 21:03:21 +02:00
|
|
|
"command": "sass --style=compressed --load-path=node_modules --load-path=node_modules/sass-true/sass $(ls -d */ | grep -vE 'node_modules|catalog')",
|
2023-09-26 21:49:18 +00:00
|
|
|
"files": [
|
|
|
|
|
"**/*.scss",
|
2024-03-05 11:51:54 -08:00
|
|
|
"!catalog/"
|
2023-09-26 21:49:18 +00:00
|
|
|
],
|
|
|
|
|
"output": [
|
|
|
|
|
"**/*.css",
|
|
|
|
|
"**/*.css.map",
|
2024-03-05 11:51:54 -08:00
|
|
|
"!catalog/"
|
2023-09-26 21:49:18 +00:00
|
|
|
]
|
2022-11-29 16:09:11 -08:00
|
|
|
},
|
|
|
|
|
"test": {
|
|
|
|
|
"command": "wtr",
|
2023-09-26 21:49:18 +00:00
|
|
|
"dependencies": [
|
|
|
|
|
"build:ts"
|
|
|
|
|
],
|
|
|
|
|
"files": [
|
|
|
|
|
"web-test-runner.config.js"
|
|
|
|
|
],
|
2022-11-29 16:09:11 -08:00
|
|
|
"output": []
|
2023-05-17 19:18:29 -07:00
|
|
|
},
|
|
|
|
|
"build:catalog": {
|
2023-09-26 21:49:18 +00:00
|
|
|
"dependencies": [
|
|
|
|
|
"./catalog:build:prod"
|
|
|
|
|
]
|
2023-09-19 21:05:08 -07:00
|
|
|
},
|
2023-12-12 17:25:03 -08:00
|
|
|
"build:scripts": {
|
2023-09-19 21:25:17 -07:00
|
|
|
"command": "tsc -b scripts/tsconfig.json --pretty",
|
2023-09-19 21:05:08 -07:00
|
|
|
"files": [
|
|
|
|
|
"scripts/tsconfig.json",
|
2023-12-12 17:25:03 -08:00
|
|
|
"scripts/**/*.ts",
|
2023-09-19 21:05:08 -07:00
|
|
|
"!**/*.d.ts",
|
2024-02-28 16:19:39 -08:00
|
|
|
"!**/*-styles.ts"
|
2023-09-19 21:05:08 -07:00
|
|
|
],
|
|
|
|
|
"output": [
|
|
|
|
|
"scripts/.tsbuildinfo",
|
2023-12-12 17:25:03 -08:00
|
|
|
"scripts/**/*.js",
|
|
|
|
|
"scripts/**/*.js.map",
|
|
|
|
|
"scripts/**/*.d.ts"
|
2023-09-19 21:05:08 -07:00
|
|
|
],
|
|
|
|
|
"clean": "if-file-deleted"
|
|
|
|
|
},
|
|
|
|
|
"update-docs": {
|
|
|
|
|
"command": "node scripts/analyzer/update-docs.js",
|
|
|
|
|
"files": [
|
|
|
|
|
"docs/components/*.md",
|
|
|
|
|
"**/*.ts",
|
|
|
|
|
"!**/*.d.ts",
|
2024-02-28 16:19:39 -08:00
|
|
|
"!**/*-styles.ts",
|
2024-03-05 11:51:54 -08:00
|
|
|
"!catalog/",
|
2023-09-19 21:05:08 -07:00
|
|
|
"!scripts/",
|
2024-03-05 11:51:54 -08:00
|
|
|
"scripts/analyzer/update-docs.js"
|
2023-09-19 21:05:08 -07:00
|
|
|
],
|
|
|
|
|
"output": [],
|
2023-09-26 21:49:18 +00:00
|
|
|
"dependencies": [
|
2023-12-12 17:25:03 -08:00
|
|
|
"build:scripts"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"update-size": {
|
|
|
|
|
"command": "node scripts/size/update-size.js",
|
|
|
|
|
"dependencies": [
|
2023-12-13 11:27:32 -08:00
|
|
|
"build:scripts",
|
|
|
|
|
"build"
|
2023-09-26 21:49:18 +00:00
|
|
|
]
|
2022-11-15 13:35:16 -08:00
|
|
|
}
|
2022-08-16 08:37:16 -07:00
|
|
|
}
|
2023-06-26 16:03:07 -07:00
|
|
|
}
|