Unverified Commit c0ee49b4 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Move type generating (#7147)

* Move types to run on prepublish in each package

* Update circleci to list dist
parent 463c8435
...@@ -74,16 +74,16 @@ commands: ...@@ -74,16 +74,16 @@ commands:
environment: environment:
BROWSERSTACK: 'true' BROWSERSTACK: 'true'
BROWSER_NAME: 'firefox' BROWSER_NAME: 'firefox'
generate_types:
steps:
- run:
name: Generate types
command: yarn run types-next-server && yarn run types-next
save_npm_token: save_npm_token:
steps: steps:
- run: - run:
name: Potentially save npm token name: Potentially save npm token
command: '([[ ! -z $NPM_TOKEN ]] && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc) || echo "Did not write npm token"' command: '([[ ! -z $NPM_TOKEN ]] && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc) || echo "Did not write npm token"'
list_dist:
steps:
- run:
name: List dist files
command: 'ls **/dist/*'
publish_canary: publish_canary:
steps: steps:
- run: - run:
...@@ -134,7 +134,7 @@ jobs: ...@@ -134,7 +134,7 @@ jobs:
steps: steps:
- *attach_workspace - *attach_workspace
- save_npm_token - save_npm_token
- generate_types - list_dist
- publish_canary - publish_canary
- publish_stable - publish_stable
......
...@@ -19,13 +19,11 @@ ...@@ -19,13 +19,11 @@
"lint-fix": "standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts", "lint-fix": "standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts",
"prettier": "prettier --single-quote --no-semi --write examples/**/*.js && yarn lint-fix", "prettier": "prettier --single-quote --no-semi --write examples/**/*.js && yarn lint-fix",
"typescript": "lerna run typescript", "typescript": "lerna run typescript",
"prepublish": "lerna run prepublish && yarn run types-next-server && yarn run types-next", "prepublish": "lerna run prepublish",
"publish-canary": "lerna version prerelease --preid canary --force-publish && release --pre", "publish-canary": "lerna version prerelease --preid canary --force-publish && release --pre",
"publish-stable": "lerna version --force-publish", "publish-stable": "lerna version --force-publish",
"lint-staged": "lint-staged", "lint-staged": "lint-staged",
"next": "./packages/next/dist/bin/next", "next": "./packages/next/dist/bin/next"
"types-next": "tsc --declaration --emitDeclarationOnly --declarationDir ./packages/next/dist --project ./packages/next",
"types-next-server": "tsc --declaration --emitDeclarationOnly --declarationDir ./packages/next-server/dist --project ./packages/next-server"
}, },
"pre-commit": "lint-staged", "pre-commit": "lint-staged",
"lint-staged": { "lint-staged": {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"scripts": { "scripts": {
"build": "taskr", "build": "taskr",
"release": "taskr release", "release": "taskr release",
"prepublish": "npm run release", "prepublish": "npm run release && yarn types",
"typescript": "tsc --noEmit --declaration", "typescript": "tsc --noEmit --declaration",
"types": "tsc --declaration --emitDeclarationOnly --declarationDir dist" "types": "tsc --declaration --emitDeclarationOnly --declarationDir dist"
}, },
......
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
"scripts": { "scripts": {
"build": "taskr", "build": "taskr",
"release": "taskr release", "release": "taskr release",
"prepublish": "npm run release", "prepublish": "npm run release && yarn types",
"typescript": "tsc --noEmit --declaration" "typescript": "tsc --noEmit --declaration",
"types": "tsc --declaration --emitDeclarationOnly --declarationDir dist"
}, },
"taskr": { "taskr": {
"requires": [ "requires": [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment