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

misc(gulp): rename output files #6179

Merged
merged 5 commits into from
Oct 10, 2018
Merged

misc(gulp): rename output files #6179

merged 5 commits into from
Oct 10, 2018

Conversation

wardpeet
Copy link
Collaborator

@wardpeet wardpeet commented Oct 5, 2018

Summary
renaming consumer's files:
devtools-entry.js => lighthouse-dt-bundle.js
extension-entry.js => lighthouse-ext-bundle.js
lightrider-entry.js => lighthouse-lr-bundle.js

also removed debug from browserify which I accidentally added.

$ gulp build:production
[18:13:07] Using gulpfile /c/Users/WardPeeters/Projects/os/lighthouse/lighthouse-extension/gulpfile.js
[18:13:07] Starting 'build:production'...
[18:13:07] Starting 'build'...
[18:13:07] Starting 'lint'...
[18:13:07] Finished 'lint' after 647 ms
[18:13:07] Starting 'browserify'...
[18:13:07] Starting 'browserify-lighthouse'...
[18:13:07]  app/src/devtools-entry.js
[18:13:07] renamed into: app/src/lighthouse-dt-bundle.js
[18:13:07]  app/src/extension-entry.js
[18:13:07] renamed into: app/src/lighthouse-ext-bundle.js
[18:13:07]  app/src/lightrider-entry.js
[18:13:07] renamed into: app/src/lighthouse-lr-bundle.js
[18:13:07]  3 items
[18:13:07] renamed into: 3 items
[18:13:15] Finished 'browserify-lighthouse' after 7.67 s
[18:13:15] Starting 'browserify-other'...
[18:13:15] Finished 'browserify-other' after 86 ms
[18:13:15] Finished 'browserify' after 7.76 s
[18:13:15] Starting 'chromeManifest'...
[18:13:15] Finished 'chromeManifest' after 166 ms
[18:13:15] Starting 'html'...
[18:13:15] Starting 'images'...
[18:13:15] Starting 'css'...
[18:13:15] Starting 'extras'...
[18:13:15] copying to dist: app/_locales
[18:13:15] copying to dist: app/_locales/en
[18:13:15] copying to dist: app/_locales/en/messages.json
[18:13:15] copying to dist: app/_locales/en/messages_canary.json
[18:13:15] copying to dist: 4 items
[18:13:15] Finished 'html' after 19 ms
[18:13:15] Finished 'css' after 36 ms
[18:13:15] Finished 'extras' after 41 ms
[18:13:15] Finished 'images' after 60 ms
[18:13:15] Finished 'build' after 8.64 s
[18:13:15] Starting 'compilejs'...
[18:13:24] Finished 'compilejs' after 8.33 s
[18:13:24] Finished 'build:production' after 17 s

sizes are intact, there is a small diff but it's just whitespace

-rw-rw-rw- 1 0 0 1354774 Oct  5 18:28 lighthouse-background.js
-rw-rw-rw- 1 0 0 1354379 Oct  5 18:27 lighthouse-dt-bundle.js
-rw-rw-rw- 1 0 0 1525837 Oct  5 18:28 lighthouse-ext-background.js
-rw-rw-rw- 1 0 0 1525425 Oct  5 18:27 lighthouse-ext-bundle.js
-rw-rw-rw- 1 0 0 2568125 Oct  5 18:28 lighthouse-lr-background.js
-rw-rw-rw- 1 0 0 2567727 Oct  5 18:27 lighthouse-lr-bundle.js

Related Issues/PRs

#6170

package.json Outdated
@@ -157,7 +157,15 @@
},
"bundlesize": [
{
"path": "./lighthouse-extension/dist/scripts/lighthouse-background.js",
"path": "./lighthouse-extension/dist/scripts/lighthouse-dt-bundle.js",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unsure which one to check or if we should check them all 3

Copy link
Member

Choose a reason for hiding this comment

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

let's check ext bundle since it's the most of our code but without worrying about string changes

@wardpeet
Copy link
Collaborator Author

wardpeet commented Oct 5, 2018

I tried using gulp-rename but it did not copy my whole file for some reason so I switched to a tap instance.

@wardpeet
Copy link
Collaborator Author

wardpeet commented Oct 5, 2018

@paulirish could you check roll out to devtools?

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

works great. thx!

package.json Outdated
@@ -157,7 +157,15 @@
},
"bundlesize": [
{
"path": "./lighthouse-extension/dist/scripts/lighthouse-background.js",
"path": "./lighthouse-extension/dist/scripts/lighthouse-dt-bundle.js",
Copy link
Member

Choose a reason for hiding this comment

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

let's check ext bundle since it's the most of our code but without worrying about string changes

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

excited about this!

@@ -93,8 +93,8 @@ git push --tags
echo "Rebuild extension and viewer to get the latest, tagged master commit"
yarn build-all;

# zip the extension files, but remove lh-background as it's not needed
cd lighthouse-extension; command rm -f dist/scripts/lighthouse-background.js; gulp package; cd ..
Copy link
Member

Choose a reason for hiding this comment

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

we should really update gulp package to do this for us. I've definitely never remembered to delete the other files :):)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i'll add a new PR that fixes this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

const isDevtools = file => file.endsWith(CONSUMERS.DEVTOOLS);
const isExtension = file => file.endsWith(CONSUMERS.EXTENSION);
const isDevtools = file =>
file.endsWith(CONSUMERS.DEVTOOLS.src) || file.endsWith(CONSUMERS.DEVTOOLS.dist);
Copy link
Member

Choose a reason for hiding this comment

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

can the dist file really ever go through this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

probably not but wanted to be save but i'm removing it

@@ -6,12 +6,12 @@
'use strict';
Copy link
Member

Choose a reason for hiding this comment

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

I think you missed a / in the git mv :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh nice thanks

@@ -6,7 +6,7 @@
'use strict';

const lighthouse = require('../../../lighthouse-core/index');
const background = require('./lighthouse-background');
const background = require('./devtools-entry');
Copy link
Member

Choose a reason for hiding this comment

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

it's unfortunate to have to keep calling this background, but I can't think of a better name right now :)

Copy link
Collaborator Author

@wardpeet wardpeet Oct 10, 2018

Choose a reason for hiding this comment

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

if I move getDefaultConfigForCategories & getDefaultCategories to it's own file called one of them below I could rename the variable which gives more meaning to it.

  • config.js,
  • helpers/config.js
  • optionsHelper.js
  • runOptions.js
  • lighthouseOptions.js
  • ...

Copy link
Member

Choose a reason for hiding this comment

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

yeah, I think that makes sense, but I think we should just wait on it (at least until LR shakes out and we can fully see the shape of these files for the medium-term future).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants