Skip to content

Public typings only swapped on build:exp:release #3082

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

Merged
merged 3 commits into from
May 18, 2020
Merged

Conversation

hsubox76
Copy link
Contributor

Add/change scripts:

Root:

  • build:release - For prod release builds, excludes packages-exp
  • buld:release:exp - For exp releases, last step is to swap in public typings for app-exp.

These two scripts will only be run by our release scripts. Regular builds will no longer touch the typings field.

In app-exp:

  • build:release - Modified to not swap public typings. Should be done at end of all exp package builds.
  • typings:public - Swaps package.json field to point at public typings. Called by root build:release:exp.
  • typings:internal - Swaps package.json field to point at internal typings. Scripts do not use this but it may be a useful shortcut for devs or future scripts.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 18, 2020

Binary Size Report

Affected SDKs

No changes between base commit (3de5763) and head commit (408b81f).

Test Logs

package.json Outdated
@@ -24,6 +24,8 @@
"dev": "lerna run --parallel --scope @firebase/* --scope firebase --scope rxfire dev",
"build": "lerna run --scope @firebase/* --scope firebase --scope rxfire prepare",
"build:exp": "lerna run --scope @firebase/*-exp --scope firebase-exp build",
"build:release": "lerna run --scope @firebase/* --scope firebase --ignore @firebase/*-exp --scope firebase-exp build",
"build:exp:release": "yarn build:exp && yarn --cwd packages-exp/app-exp typings:public",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep the swapping typings step in @firebase/app-exp because I want this step to run when I run build:release in @firebase/app-exp.
How about "build:exp:release": "lerna run --scope @firebase/*-exp --scope firebase-exp prepare"?

Copy link
Contributor Author

@hsubox76 hsubox76 May 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, app-exp prepare, which is only run by the root script, will not swap typings, but app-exp build:release which is only run locally, will.

Need to prevent this from swapping typings when run by the root script until all the other -exp packages have built.

@@ -16,16 +17,23 @@
*/

const { writeFileSync } = require('fs');
const { argv } = require('yargs');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the script takes an argument now, rename it to use_typings.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

package.json Outdated
@@ -24,6 +24,8 @@
"dev": "lerna run --parallel --scope @firebase/* --scope firebase --scope rxfire dev",
"build": "lerna run --scope @firebase/* --scope firebase --scope rxfire prepare",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace prepare with build, so it doesn't run swapping public typings in local builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't (see comment above) but it is better to run the expected command. Changed.

@@ -15,19 +15,21 @@
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"build": "rollup -c && yarn api-report",
"build:release": "rollup -c rollup.config.release.js && node ./use_public_typings.js",
"build:release": "rollup -c rollup.config.release.js && yarn typings:public",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add yarn api-report as the second step? It generates the rollup d.ts files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@hsubox76 hsubox76 merged commit 1325b58 into master May 18, 2020
@firebase firebase locked and limited conversation to collaborators Jun 18, 2020
@hsubox76 hsubox76 deleted the ch-buildfix branch June 18, 2020 21:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants