2022-08-16 18:37:16 +03:00
|
|
|
{
|
|
|
|
"name": "@material/web",
|
2024-04-15 22:50:58 +03:00
|
|
|
"version": "1.4.1",
|
2022-08-27 02:38:19 +03:00
|
|
|
"publishConfig": {
|
|
|
|
"access": "public"
|
|
|
|
},
|
2022-08-16 18:37:16 +03:00
|
|
|
"description": "Material web components",
|
2023-08-23 02:26:59 +03:00
|
|
|
"keywords": [
|
|
|
|
"material",
|
|
|
|
"material design",
|
|
|
|
"design system",
|
|
|
|
"components",
|
|
|
|
"web components",
|
|
|
|
"lit"
|
|
|
|
],
|
2022-08-16 18:37:16 +03: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-16 00:35:16 +03:00
|
|
|
"build": "wireit",
|
|
|
|
"build:ts": "wireit",
|
|
|
|
"build:css-to-ts": "wireit",
|
2022-11-30 03:09:11 +03:00
|
|
|
"build:sass": "wireit",
|
2023-05-18 05:18:29 +03:00
|
|
|
"test": "wireit",
|
2023-09-20 07:05:08 +03:00
|
|
|
"build:catalog": "wireit",
|
2023-12-13 04:25:03 +03:00
|
|
|
"build:scripts": "wireit",
|
|
|
|
"update-docs": "wireit",
|
|
|
|
"update-size": "wireit"
|
2022-08-16 18:37:16 +03:00
|
|
|
},
|
2022-11-30 03:18:41 +03: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-25 01:03:43 +03:00
|
|
|
"files": [
|
|
|
|
"**/*.js",
|
|
|
|
"**/*.js.map",
|
|
|
|
"**/*.d.ts",
|
|
|
|
"**/*.scss",
|
2024-03-21 02:39:27 +03:00
|
|
|
"**/*.css",
|
|
|
|
"**/*.css.map",
|
2022-11-30 03:09:11 +03:00
|
|
|
"!web-test-runner.config.js",
|
2023-12-21 02:19:23 +03: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-25 01:03:43 +03:00
|
|
|
"!**/test/**",
|
2022-11-16 00:35:16 +03:00
|
|
|
"!**/*_test.*",
|
2023-06-14 01:42:07 +03:00
|
|
|
"!.wireit/**",
|
2024-03-05 22:51:54 +03:00
|
|
|
"!catalog/",
|
2024-01-19 20:35:32 +03:00
|
|
|
"!scripts/",
|
|
|
|
"!**/testing/**",
|
|
|
|
"testing/harness.{js,js.map,d.ts}",
|
|
|
|
"testing/transform-pseudo-classes.{js,js.map,d.ts}"
|
2023-05-18 05:18:29 +03:00
|
|
|
],
|
2023-09-27 00:49:18 +03:00
|
|
|
"workspaces": [
|
|
|
|
"catalog"
|
|
|
|
],
|
2022-08-16 18:37:16 +03:00
|
|
|
"dependencies": {
|
2023-08-24 03:37:16 +03:00
|
|
|
"lit": "^2.7.4 || ^3.0.0",
|
2022-08-16 18:37:16 +03:00
|
|
|
"tslib": "^2.4.0"
|
|
|
|
},
|
|
|
|
"devDependencies": {
|
2023-09-20 07:05:08 +03:00
|
|
|
"@lit-labs/analyzer": "^0.9.2",
|
2023-12-13 04:25:03 +03:00
|
|
|
"@rollup/plugin-multi-entry": "^6.0.1",
|
|
|
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
|
|
"@rollup/plugin-terser": "^0.4.4",
|
2022-08-16 18:37:16 +03:00
|
|
|
"@types/jasmine": "^4.0.3",
|
2022-11-30 03:08:45 +03:00
|
|
|
"@web/test-runner": "^0.15.0",
|
|
|
|
"@web/test-runner-playwright": "^0.9.0",
|
2022-11-30 03:57:05 +03:00
|
|
|
"jasmine": "^4.5.0",
|
2023-12-13 04:25:03 +03:00
|
|
|
"rollup": "^2.79.1",
|
2022-08-16 18:37:16 +03:00
|
|
|
"sass": "^1.52.3",
|
|
|
|
"sass-true": "^6.1.0",
|
2023-09-08 22:10:45 +03:00
|
|
|
"typescript": "5.1.6",
|
2022-11-30 03:08:45 +03:00
|
|
|
"web-test-runner-jasmine": "^0.0.2",
|
2023-09-09 01:25:09 +03:00
|
|
|
"wireit": "^0.13.0"
|
2022-11-16 00:35:16 +03:00
|
|
|
},
|
|
|
|
"wireit": {
|
|
|
|
"build": {
|
2023-09-27 00:49:18 +03:00
|
|
|
"dependencies": [
|
|
|
|
"build:ts"
|
|
|
|
]
|
2022-11-16 00:35:16 +03:00
|
|
|
},
|
|
|
|
"build:ts": {
|
|
|
|
"command": "tsc --pretty",
|
|
|
|
"files": [
|
|
|
|
"tsconfig.json",
|
|
|
|
"**/*.ts",
|
|
|
|
"!**/*.d.ts",
|
2024-02-29 03:19:39 +03:00
|
|
|
"!**/*-styles.ts",
|
2024-03-05 22:51:54 +03:00
|
|
|
"!catalog/",
|
|
|
|
"!scripts/"
|
2022-11-16 00:35:16 +03:00
|
|
|
],
|
|
|
|
"output": [
|
|
|
|
".tsbuildinfo",
|
|
|
|
"**/*.js",
|
|
|
|
"**/*.js.map",
|
|
|
|
"**/*.d.ts",
|
2023-07-21 01:01:55 +03:00
|
|
|
"!web-test-runner.config.js",
|
2023-12-21 02:19:23 +03:00
|
|
|
"!commitlint.config.js",
|
2023-05-18 05:18:29 +03:00
|
|
|
"!types/",
|
2024-03-05 22:51:54 +03:00
|
|
|
"!catalog/",
|
2023-09-20 07:05:08 +03:00
|
|
|
"!scripts/"
|
2022-11-16 00:35:16 +03:00
|
|
|
],
|
|
|
|
"clean": "if-file-deleted",
|
2023-09-27 00:49:18 +03:00
|
|
|
"dependencies": [
|
|
|
|
"build:css-to-ts"
|
|
|
|
]
|
2022-11-16 00:35:16 +03:00
|
|
|
},
|
|
|
|
"build:css-to-ts": {
|
2024-03-05 22:51:54 +03: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-27 00:49:18 +03:00
|
|
|
"files": [
|
2024-03-05 22:51:54 +03:00
|
|
|
"**/*-styles.css",
|
|
|
|
"!catalog/"
|
2023-09-27 00:49:18 +03:00
|
|
|
],
|
|
|
|
"output": [
|
2024-02-29 03:19:39 +03:00
|
|
|
"**/*-styles.ts",
|
2024-03-05 22:51:54 +03:00
|
|
|
"!catalog/"
|
2023-09-27 00:49:18 +03:00
|
|
|
],
|
|
|
|
"dependencies": [
|
2024-03-05 22:51:54 +03:00
|
|
|
"build:scripts",
|
2023-09-27 00:49:18 +03:00
|
|
|
"build:sass"
|
|
|
|
]
|
2022-11-16 00:35:16 +03:00
|
|
|
},
|
|
|
|
"build:sass": {
|
2023-06-28 22:03:21 +03: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-27 00:49:18 +03:00
|
|
|
"files": [
|
|
|
|
"**/*.scss",
|
2024-03-05 22:51:54 +03:00
|
|
|
"!catalog/"
|
2023-09-27 00:49:18 +03:00
|
|
|
],
|
|
|
|
"output": [
|
|
|
|
"**/*.css",
|
|
|
|
"**/*.css.map",
|
2024-03-05 22:51:54 +03:00
|
|
|
"!catalog/"
|
2023-09-27 00:49:18 +03:00
|
|
|
]
|
2022-11-30 03:09:11 +03:00
|
|
|
},
|
|
|
|
"test": {
|
|
|
|
"command": "wtr",
|
2023-09-27 00:49:18 +03:00
|
|
|
"dependencies": [
|
|
|
|
"build:ts"
|
|
|
|
],
|
|
|
|
"files": [
|
|
|
|
"web-test-runner.config.js"
|
|
|
|
],
|
2022-11-30 03:09:11 +03:00
|
|
|
"output": []
|
2023-05-18 05:18:29 +03:00
|
|
|
},
|
|
|
|
"build:catalog": {
|
2023-09-27 00:49:18 +03:00
|
|
|
"dependencies": [
|
|
|
|
"./catalog:build:prod"
|
|
|
|
]
|
2023-09-20 07:05:08 +03:00
|
|
|
},
|
2023-12-13 04:25:03 +03:00
|
|
|
"build:scripts": {
|
2023-09-20 07:25:17 +03:00
|
|
|
"command": "tsc -b scripts/tsconfig.json --pretty",
|
2023-09-20 07:05:08 +03:00
|
|
|
"files": [
|
|
|
|
"scripts/tsconfig.json",
|
2023-12-13 04:25:03 +03:00
|
|
|
"scripts/**/*.ts",
|
2023-09-20 07:05:08 +03:00
|
|
|
"!**/*.d.ts",
|
2024-02-29 03:19:39 +03:00
|
|
|
"!**/*-styles.ts"
|
2023-09-20 07:05:08 +03:00
|
|
|
],
|
|
|
|
"output": [
|
|
|
|
"scripts/.tsbuildinfo",
|
2023-12-13 04:25:03 +03:00
|
|
|
"scripts/**/*.js",
|
|
|
|
"scripts/**/*.js.map",
|
|
|
|
"scripts/**/*.d.ts"
|
2023-09-20 07:05:08 +03:00
|
|
|
],
|
|
|
|
"clean": "if-file-deleted"
|
|
|
|
},
|
|
|
|
"update-docs": {
|
|
|
|
"command": "node scripts/analyzer/update-docs.js",
|
|
|
|
"files": [
|
|
|
|
"docs/components/*.md",
|
|
|
|
"**/*.ts",
|
|
|
|
"!**/*.d.ts",
|
2024-02-29 03:19:39 +03:00
|
|
|
"!**/*-styles.ts",
|
2024-03-05 22:51:54 +03:00
|
|
|
"!catalog/",
|
2023-09-20 07:05:08 +03:00
|
|
|
"!scripts/",
|
2024-03-05 22:51:54 +03:00
|
|
|
"scripts/analyzer/update-docs.js"
|
2023-09-20 07:05:08 +03:00
|
|
|
],
|
|
|
|
"output": [],
|
2023-09-27 00:49:18 +03:00
|
|
|
"dependencies": [
|
2023-12-13 04:25:03 +03:00
|
|
|
"build:scripts"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"update-size": {
|
|
|
|
"command": "node scripts/size/update-size.js",
|
|
|
|
"dependencies": [
|
2023-12-13 22:27:32 +03:00
|
|
|
"build:scripts",
|
|
|
|
"build"
|
2023-09-27 00:49:18 +03:00
|
|
|
]
|
2022-11-16 00:35:16 +03:00
|
|
|
}
|
2022-08-16 18:37:16 +03:00
|
|
|
}
|
2023-06-27 02:03:07 +03:00
|
|
|
}
|