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

build: move packaging in separate folder #4719

Merged
merged 2 commits into from
May 22, 2017

Conversation

devversion
Copy link
Member

Moves all related packaging code into a packaging folder inside of gulp.

At some point we can move the folder completely to tools/ and can share it with other repositories like flex-layout.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 22, 2017
@devversion devversion requested a review from jelbourn May 22, 2017 17:42
@@ -0,0 +1,85 @@
import {writeFileSync, readFileSync} from 'fs-extra';
import {join} from 'path';
import {LICENSE_BANNER, MATERIAL_VERSION} from '../constants';
Copy link
Member

Choose a reason for hiding this comment

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

I really dislike grab-bag "util" files. Can we break this up into individual files?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I'm a bit afraid of having 5 files just for small functions. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Small, single-purpose files are just much easier to grok than have a bunch of unrelated stuff in one file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay I will try to see how I can split them up.

}

/** Builds the bundles for the specified package. */
export async function buildPackageBundles(entryFile: string, packageName: string) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe put composeRelease and buildPackageBundles into their own files?

Copy link
Member Author

Choose a reason for hiding this comment

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

I like that idea. Do you have any good ideas for the file names?

  • build-release.ts
  • build-normal.ts

Something like that?

Copy link
Member

Choose a reason for hiding this comment

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

Why not build-bundles.ts and compose-release.ts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I like that



/** Inlines HTML and CSS resources into `metadata.json` files. */
export function inlinePackageMetadataFiles(packagePath: string) {
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 prefer this to stay in its own file

}

/** Formats the TypeScript diagnostics into a error string. */
export function formatDiagnostics(diagnostics: ts.Diagnostic[], baseDir: string): string {
Copy link
Member

Choose a reason for hiding this comment

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

Separate transpile and diagnostics into separate files?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ugh this ends up in a lot of files. If we do this then we should have a folder packaging/typescript?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it would need a a separate directory- maybe just transpile.ts and typescript-diagnostics.ts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds a bit unnecessary to be honest. The diagnostics are actually part of the "custom" ts-compiler.

Copy link
Member

Choose a reason for hiding this comment

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

If they're not used outside this file then they can stay there without being exported.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah good point with the export.

Moves all related packaging code into a `packaging` folder inside of gulp.

At some point we can move the folder completely to `tools/` and can share it with other repositories like `flex-layout`.
@devversion
Copy link
Member Author

devversion commented May 22, 2017

@jelbourn Moved the different build utils into separate files. Let me know if you want any further changes

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels May 22, 2017
@tinayuangao tinayuangao merged commit 3569805 into angular:master May 22, 2017
@devversion devversion deleted the build/move-packaging branch May 23, 2017 19:25
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants