Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Verify Production Types in Travis CI #900

Merged
merged 90 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
8a6e314
[WIP] Verify Production Types
Jun 3, 2019
525cfb5
Create verify-types-main.js
Jun 3, 2019
a225c8b
Update pre-release.sh
Jun 3, 2019
a55ee4a
Update .travis.yml
Jun 3, 2019
81809b0
Update pre-release.sh
Jun 3, 2019
a53bf1c
Update .travis.yml
Jun 3, 2019
5f0b8eb
Update verify-types-main.js
Jun 3, 2019
93d67a0
Update pre-release.sh
Jun 3, 2019
26dd20f
Update .travis.yml
Jun 3, 2019
73329a1
Update and rename verify-types-main.js to verify-types-main.ts
Jun 3, 2019
b5bed96
Update package.json
Jun 3, 2019
0ff3d3c
Update verify-types-main.ts
Jun 3, 2019
cb4388a
Update package.json
Jun 3, 2019
1fb4053
Update verify-types-main.ts
Jun 3, 2019
e3d49c7
Update verify-types-main.ts
Jun 3, 2019
49050f4
Update verify-types-main.ts
Jun 3, 2019
b26a582
Update verify-types-main.ts
Jun 3, 2019
14f1737
Delete verify-types-main.ts
Jun 3, 2019
b7b4498
Update pre-release.sh
Jun 3, 2019
fa0e784
Update .travis.yml
Jun 3, 2019
8019d7b
Update package.json
Jun 3, 2019
2356cbb
Create tsconfig.json
Jun 3, 2019
a9d065c
Update .travis.yml
Jun 3, 2019
e51eae5
Update tsconfig.json
Jun 3, 2019
c6b7e41
Update .travis.yml
Jun 3, 2019
b446314
Update tsconfig.json
Jun 3, 2019
bc42e63
Create index.ts
Jun 3, 2019
0134b04
Update tsconfig.json
Jun 3, 2019
ae60f7e
Update index.ts
Jun 3, 2019
48ecf37
Update tsconfig.json
Jun 3, 2019
c25463f
Update tsconfig.json
Jun 3, 2019
78ea599
Update tsconfig.json
Jun 3, 2019
443026b
Update .travis.yml
Jun 3, 2019
6e3ac73
Update package.json
Jun 3, 2019
dcf4548
Update .travis.yml
Jun 3, 2019
c73f33b
Update package.json
Jun 3, 2019
42f0fb5
Update tsconfig.json
Jun 3, 2019
82b5e9b
Update package.json
Jun 3, 2019
d2b56f4
Update .travis.yml
Jun 4, 2019
6753c2e
Update .travis.yml
Jun 4, 2019
a19e87e
Update package.json
Jun 4, 2019
29c2714
Update .travis.yml
Jun 4, 2019
64abf42
Update .travis.yml
Jun 4, 2019
4682da1
Update .travis.yml
Jun 4, 2019
48aeb90
Update .travis.yml
Jun 4, 2019
2425015
Update tsconfig.json
Jun 4, 2019
b7d37fd
Update .travis.yml
Jun 4, 2019
bb4f4cd
Update .travis.yml
Jun 4, 2019
3141100
Update .travis.yml
Jun 4, 2019
6ec95a3
Update index.ts
Jun 4, 2019
9f4b91e
Update tsconfig.json
Jun 4, 2019
842770e
Update .travis.yml
Jun 4, 2019
d51fc6e
Update tsconfig.json
Jun 5, 2019
b244fe3
Update index.ts
Jun 5, 2019
488c2ac
Update .travis.yml
Jun 5, 2019
04ebc11
Update .travis.yml
Jun 5, 2019
22b0cfd
Create gen-index.js
Jun 5, 2019
9b584c1
Delete index.ts
Jun 5, 2019
27e9216
Update gen-index.js
Jun 5, 2019
8fa5f13
Update .travis.yml
Jun 5, 2019
bc754df
Update .travis.yml
Jun 5, 2019
797003d
Update tsconfig.json
Jun 5, 2019
5a7691c
Update gen-index.js
Jun 5, 2019
5815719
Update .travis.yml
Jun 5, 2019
6fc83dd
Update gen-index.js
Jun 5, 2019
26c30bc
Update .travis.yml
Jun 5, 2019
cc9b119
Update gen-index.js
Jun 5, 2019
f734128
Update gen-index.js
Jun 5, 2019
99dff9c
Update tsconfig.json
Jun 5, 2019
fdbf95e
Update .travis.yml
Jun 5, 2019
cc41720
Update .travis.yml
Jun 5, 2019
5b6175f
Update .travis.yml
Jun 7, 2019
cf1c111
Update gen-index.js
Jun 10, 2019
db284d8
Update package.json
Jun 10, 2019
389f172
Update .travis.yml
Jun 10, 2019
cc60eaf
Update gen-index.js
Jun 10, 2019
aa547d1
Update package.json
Jun 10, 2019
b6a6cdb
Update gen-index.js
Jun 10, 2019
8021e78
Delete tsconfig.json
Jun 11, 2019
59c04e2
Update package.json
Jun 11, 2019
e7787eb
Update package.json
Jun 11, 2019
10d7d8e
Update package.json
Jun 11, 2019
7615485
Update gen-index.js
Jun 11, 2019
6dfe025
Update gen-index.js
Jun 11, 2019
213d9d6
Merge pull request #2 from material-components/rc0.14.0
Jun 11, 2019
1a941c0
Merge pull request #3 from arichiv/master
Jun 11, 2019
e9240a0
Update package.json
Jun 17, 2019
008a445
Update .travis.yml
Jun 17, 2019
f8fe48d
Update .travis.yml
Jun 17, 2019
e84f57c
Update running-tests.md
Jun 17, 2019
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
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ matrix:
install: npm i
script: npm run lint

#TODO(issues/936): Fix existing errors before requiring this to pass
#- node_js: 10
# env: TEST_SUITE=types
# install: npm i
# script: npm run test:types

- node_js: 10
install: npm i
services:
Expand Down
10 changes: 10 additions & 0 deletions docs/contributions/running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,13 @@ npm run lint
```

This will print any lines that do not follow the eslint standards, which you will need to fix before opeing a PR.

## Type Tests

Due to [multiple issues in production type files](https://github.com/material-components/material-components-web-react/issues/936) an easy way to [validate production type files has been added](https://github.com/material-components/material-components-web-react/pull/900):

```bash
npm run test:types
```

This command will perform a full production build, install the locally built versions, [generate a file that imports them all](../../test/types/gen-index.js), and then build it to expose any issues in the locally built `.d.ts` files.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"test:unit-ci": "karma start karma.ci.js --single-run",
"test:image-diff": "MDC_COMMIT_HASH=$(git rev-parse --short HEAD) MDC_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) mocha --require ts-node/register --require babel-core/register --ui tdd --timeout 60000 test/screenshot/diff-suite.tsx",
"test:screenshots": "docker run -it --rm --cap-add=SYS_ADMIN -e MDC_GCLOUD_SERVICE_ACCOUNT_KEY=\"${MDC_GCLOUD_SERVICE_ACCOUNT_KEY}\" mdcreact/screenshots /bin/sh -c 'git checkout .; git checkout master; git pull; npm i; /home/pptruser/material-components-web-react/test/screenshot/start.sh; sleep 40s; npm run test:image-diff'",
"test:types": "npm run build && node scripts/release/cp-pkgs.js && rm -rf packages/*/node_modules && npm install packages/ripple && ls -d ./packages/*/ | xargs -n1 -I{} npm install {} && node test/types/gen-index.js && cp tsconfig.json test/types/tsconfig.json && tsc --project test/types",
"upload:screenshots": "node ./test/screenshot/upload-screenshots.js"
},
"config": {
Expand Down
38 changes: 38 additions & 0 deletions test/types/gen-index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// The MIT License
//
// Copyright (c) 2019 Google, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/**
* @fileoverview Generates index.ts file with imports for all repo packages.
*/

const {join} = require('path');
const {readdirSync, statSync, writeFileSync} = require('fs');

let out = 'import "react";\n';
const dir = 'packages';
for (const subdir of readdirSync(dir)) {
if (!statSync(join(dir, subdir)).isDirectory()) {
continue;
}
out += 'import "@material/react-' + subdir + '";\n';
}
writeFileSync('test/types/index.ts', out, 'ascii');