Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[types] Add LICENSE files #23162

Merged
merged 3 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/material-ui-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
},
"homepage": "https://github.com/mui-org/material-ui/tree/next/packages/material-ui-types",
"scripts": {
"release": "npm publish --tag next",
"build": "mkdir build && cp index.d.ts build/ && yarn build:copy-files",
"build:copy-files": "node ../../scripts/copy-files.js",
"prebuild": "rimraf build",
"release": "yarn build && npm publish build --tag next",
"test": "echo 'No runtime test. Type tests are run with the `typescript` script.'",
"typescript": "tslint -p tsconfig.json \"*.{ts,tsx}\""
},
Expand Down
1 change: 1 addition & 0 deletions packages/material-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "5.0.0-alpha.13",
"private": false,
"author": "Material-UI Team",
"main": "./src/index.ts",
"description": "React components that implement Google's Material Design.",
"keywords": [
"react",
Expand Down
20 changes: 12 additions & 8 deletions scripts/copy-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function createModulePackages({ from, to }) {
sideEffects: false,
module: './index.js',
main: path.join('../node', directoryPackage, 'index.js'),
typings: './index.d.ts',
types: './index.d.ts',
};
const packageJsonPath = path.join(to, directoryPackage, 'package.json');

Expand Down Expand Up @@ -69,13 +69,17 @@ async function createPackageFile() {
const newPackageData = {
...packageDataOther,
private: false,
main: fse.existsSync(path.resolve(buildPath, './node/index.js'))
? './node/index.js'
: './index.js',
module: fse.existsSync(path.resolve(buildPath, './esm/index.js'))
? './esm/index.js'
: './index.js',
typings: './index.d.ts',
...(packageDataOther.main
? {
main: fse.existsSync(path.resolve(buildPath, './node/index.js'))
? './node/index.js'
: './index.js',
module: fse.existsSync(path.resolve(buildPath, './esm/index.js'))
? './esm/index.js'
: './index.js',
}
: {}),
types: './index.d.ts',
};
const targetPath = path.resolve(buildPath, './package.json');

Expand Down