├── .gitattributes
├── src
├── pages
│ ├── AboutPage
│ │ ├── AboutPage.scss
│ │ ├── AboutPage.spec.js
│ │ ├── AboutPage.i18n.js
│ │ └── AboutPage.js
│ ├── AssetsPage
│ │ ├── AssetsPage.scss
│ │ ├── AssetsPage.spec.js
│ │ ├── AssetsPage.i18n.js
│ │ └── AssetsPage.js
│ ├── ChunkPage
│ │ ├── ChunkPage.scss
│ │ ├── ChunkPage.spec.js
│ │ ├── ChunkPage.i18n.js
│ │ └── ChunkPage.js
│ ├── ChunksPage
│ │ ├── ChunksPage.scss
│ │ ├── ChunksPage.spec.js
│ │ ├── ChunksPage.i18n.js
│ │ └── ChunksPage.js
│ ├── ErrorPage
│ │ ├── ErrorPage.scss
│ │ ├── ErrorPage.spec.js
│ │ ├── ErrorPage.i18n.js
│ │ └── ErrorPage.js
│ ├── ErrorsPage
│ │ ├── ErrorsPage.scss
│ │ ├── ErrorsPage.spec.js
│ │ ├── ErrorsPage.i18n.js
│ │ └── ErrorsPage.js
│ ├── HintsPage
│ │ ├── HintsPage.scss
│ │ ├── HintsPage.spec.js
│ │ ├── HintsPage.i18n.js
│ │ └── HintsPage.js
│ ├── ModulePage
│ │ ├── ModulePage.scss
│ │ ├── ModulePage.spec.js
│ │ ├── ModulePage.i18n.js
│ │ └── ModulePage.js
│ ├── ModulesPage
│ │ ├── ModulesPage.scss
│ │ ├── ModulesPage.spec.js
│ │ ├── ModulesPage.i18n.js
│ │ └── ModulesPage.js
│ ├── SelectPage
│ │ ├── SelectPage.scss
│ │ ├── SelectPage.spec.js
│ │ ├── SelectPage.i18n.js
│ │ └── SelectPage.js
│ ├── UploadPage
│ │ ├── UploadPage.scss
│ │ ├── UploadPage.spec.js
│ │ ├── UploadPage.i18n.js
│ │ └── UploadPage.js
│ ├── WarningsPage
│ │ ├── WarningsPage.scss
│ │ ├── WarningsPage.spec.js
│ │ ├── WarningsPage.i18n.js
│ │ └── WarningsPage.js
│ ├── ProfileEditPage
│ │ ├── ProfileEditPage.i18n.js
│ │ └── ProfileEditPage.js
│ └── HomePage
│ │ ├── HomePage.scss
│ │ ├── HomePage.i18n.js
│ │ ├── HomePageHero.js
│ │ └── HomePage.js
├── containers
│ ├── MainHeader
│ │ ├── MainHeader.scss
│ │ └── MainHeader.js
│ ├── DevTools.js
│ ├── ProfileEditForm
│ │ ├── ProfileEditForm.scss
│ │ ├── ProfileEditForm.validations.js
│ │ ├── ProfileEditForm.i18n.js
│ │ └── ProfileEditForm.js
│ ├── HeroPageLayout.js
│ ├── AdminPageLayout.js
│ ├── Root.js
│ ├── AppContainer.js
│ ├── Sidebar
│ │ └── Sidebar.js
│ ├── AuthenticatedComponent.js
│ └── LanguageSelectionDropdown
│ │ └── LanguageSelectionDropdown.js
├── static
│ ├── robots.txt
│ ├── humans.txt
│ ├── favicon.ico
│ ├── favicon.png
│ ├── images
│ │ ├── network-ai.jpg
│ │ ├── network-bg.png
│ │ ├── facebook_logo.png
│ │ ├── twitter_logo.png
│ │ ├── default-profile.png
│ │ ├── twitter_logo_2x.png
│ │ ├── facebook_logo_2x.png
│ │ └── webpack-r3analyse.png
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
│ └── api
│ │ └── profile.json
├── settings.js
├── _BIN
│ ├── pages
│ │ ├── error
│ │ │ ├── error.jade
│ │ │ └── page.js
│ │ ├── errors
│ │ │ ├── errors.jade
│ │ │ └── page.js
│ │ ├── home
│ │ │ ├── page.js
│ │ │ └── home.jade
│ │ ├── warnings
│ │ │ ├── warnings.jade
│ │ │ └── page.js
│ │ ├── assets
│ │ │ ├── page.js
│ │ │ └── assets.jade
│ │ ├── chunks
│ │ │ ├── page.js
│ │ │ └── chunks.jade
│ │ ├── select
│ │ │ ├── page.js
│ │ │ └── application.jade
│ │ ├── chunk
│ │ │ ├── page.js
│ │ │ └── chunk.jade
│ │ ├── module
│ │ │ ├── page.js
│ │ │ └── module.jade
│ │ ├── modules
│ │ │ ├── page.js
│ │ │ └── modules.jade
│ │ ├── upload
│ │ │ ├── application.jade
│ │ │ └── page.js
│ │ └── hints
│ │ │ ├── page.js
│ │ │ └── hints.jade
│ ├── googleAnalytics.js
│ ├── entry.js
│ ├── Graphs
│ │ ├── chunks.js
│ │ └── modules.js
│ └── app.js
├── declarations
│ ├── i18n-types.js
│ └── app.js
├── utils
│ ├── findById.js
│ ├── formatSize.js
│ └── percentageToColor.js
├── translations
│ ├── index.js
│ ├── es.js
│ ├── en.js
│ └── pl.js
├── components
│ ├── Hero
│ │ ├── index.js
│ │ ├── HeroBackground.js
│ │ ├── HeroContent.js
│ │ ├── Hero.scss
│ │ └── Hero.js
│ ├── Login
│ │ └── Login.js
│ ├── VAlign
│ │ ├── VAlign.scss
│ │ └── VAlign.js
│ ├── DropdownProfileCard
│ │ ├── DropdownProfileCard.scss
│ │ ├── DropdownProfileCard.js
│ │ └── DropdownProfileCard.spec.js
│ ├── Spinner
│ │ ├── Spinner.scss
│ │ └── Spinner.js
│ ├── FormFields
│ │ ├── DropDown.js
│ │ ├── TextInput.js
│ │ ├── HorizontalRadioGroup.js
│ │ ├── DropDown.spec.js
│ │ ├── FormErrorMessages.js
│ │ ├── TextInput.spec.js
│ │ └── HorizontalRadioGroup.spec.js
│ ├── MainFooter
│ │ ├── MainFooter.scss
│ │ └── MainFooter.js
│ ├── UserDropdownMenu
│ │ └── UserDropdownMenu.js
│ └── DocumentTitle.js
├── styles
│ ├── base.scss
│ ├── admin.scss
│ ├── app.scss
│ └── vendor
│ │ ├── normalize.css
│ │ └── skeleton.css
├── redux
│ ├── root-reducer.js
│ ├── modules
│ │ ├── language
│ │ │ └── language.js
│ │ ├── auth
│ │ │ ├── auth-reducer.js
│ │ │ └── auth-actions.js
│ │ ├── user
│ │ │ ├── user-reducer.js
│ │ │ ├── user-actions.spec.js
│ │ │ └── user-actions.js
│ │ ├── document-title
│ │ │ └── document-title.js
│ │ └── spinner
│ │ │ └── spinner.js
│ └── configure-store.js
├── shared
│ ├── forms.js
│ └── links.js
├── api
│ └── user.js
├── index.html
├── app.js
└── routes.js
├── interfaces
└── debug.js
├── .gitignore
├── .eslintignore
├── .editorconfig
├── .travis.yml
├── config
├── environments
│ ├── development.js
│ └── production.js
└── index.js
├── README.md
├── .babelrc
├── .flowconfig
├── LICENSE
├── server
└── index.js
├── package.json
└── webpack.config.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | * eol=lf
--------------------------------------------------------------------------------
/src/pages/AboutPage/AboutPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/AboutPage/AboutPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/AssetsPage/AssetsPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ChunkPage/ChunkPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ChunkPage/ChunkPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ChunksPage/ChunksPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ErrorPage/ErrorPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ErrorPage/ErrorPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ErrorsPage/ErrorsPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/HintsPage/HintsPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/HintsPage/HintsPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ModulePage/ModulePage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ModulesPage/ModulesPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/SelectPage/SelectPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/UploadPage/UploadPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/containers/MainHeader/MainHeader.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/AssetsPage/AssetsPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ChunksPage/ChunksPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ErrorsPage/ErrorsPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ModulePage/ModulePage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/ModulesPage/ModulesPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/SelectPage/SelectPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/UploadPage/UploadPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/WarningsPage/WarningsPage.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/WarningsPage/WarningsPage.spec.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/static/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/interfaces/debug.js:
--------------------------------------------------------------------------------
1 | declare var __DEBUG__: boolean;
2 |
--------------------------------------------------------------------------------
/src/static/humans.txt:
--------------------------------------------------------------------------------
1 | # Check it out: http://humanstxt.org/
2 |
--------------------------------------------------------------------------------
/src/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/favicon.ico
--------------------------------------------------------------------------------
/src/static/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/favicon.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | dist/
3 | node_modules/
4 | lib-cov/
5 | coverage/
6 | .DS_Store
7 | *.log
8 | *.map
9 |
--------------------------------------------------------------------------------
/src/static/images/network-ai.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/network-ai.jpg
--------------------------------------------------------------------------------
/src/static/images/network-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/network-bg.png
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | coverage/**
2 | node_modules/**
3 | dist/**
4 | *.spec.js
5 | src/index.html
6 | src/_BIN
7 | interfaces/**
8 |
--------------------------------------------------------------------------------
/src/static/images/facebook_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/facebook_logo.png
--------------------------------------------------------------------------------
/src/static/images/twitter_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/twitter_logo.png
--------------------------------------------------------------------------------
/src/static/images/default-profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/default-profile.png
--------------------------------------------------------------------------------
/src/static/images/twitter_logo_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/twitter_logo_2x.png
--------------------------------------------------------------------------------
/src/settings.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: 'r3analyse',
3 | description: 'Rethink, React, Redux - Webpack Analyse Tool',
4 | }
5 |
--------------------------------------------------------------------------------
/src/static/images/facebook_logo_2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/facebook_logo_2x.png
--------------------------------------------------------------------------------
/src/static/images/webpack-r3analyse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/images/webpack-r3analyse.png
--------------------------------------------------------------------------------
/src/_BIN/pages/error/error.jade:
--------------------------------------------------------------------------------
1 | .jumbotron
2 | h1 Page #{page} not found
3 | p: a.btn.btn-primary.btn-lg(href="#home") Back home
--------------------------------------------------------------------------------
/src/static/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/src/static/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/src/static/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/src/static/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webpack/analyse-tool/master/src/static/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/src/declarations/i18n-types.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 |
3 | export type FormattedMessageType = {
4 | id: string;
5 | defaultMessage: string;
6 | description?: string;
7 | };
8 |
--------------------------------------------------------------------------------
/src/pages/ProfileEditPage/ProfileEditPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'profile.edit.title',
4 | defaultMessage: 'Edit Profile',
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/src/_BIN/pages/error/page.js:
--------------------------------------------------------------------------------
1 | module.exports = function(err, page) {
2 | document.title = "error";
3 | $(".page").html(require("./error.jade")({
4 | err : err,
5 | page: page
6 | }));
7 | };
--------------------------------------------------------------------------------
/src/_BIN/pages/errors/errors.jade:
--------------------------------------------------------------------------------
1 | if errors.length === 0
2 | h2 No errors.
3 | each error in errors
4 | .alert.alert-danger
5 | h4= error.header
6 | pre= error.text
7 | h5= error.footer
--------------------------------------------------------------------------------
/src/utils/findById.js:
--------------------------------------------------------------------------------
1 | module.exports = function findById(array, id) {
2 | for (let i = 0; i < array.length; i++) {
3 | if (array[i].id === id) { return array[i]; }
4 | }
5 | return null;
6 | };
7 |
--------------------------------------------------------------------------------
/src/_BIN/pages/home/page.js:
--------------------------------------------------------------------------------
1 | var app = require("../../app");
2 |
3 | module.exports = function() {
4 | document.title = "home";
5 | $(".page").html(require("./home.jade")({
6 | stats: app.stats
7 | }));
8 | };
--------------------------------------------------------------------------------
/src/translations/index.js:
--------------------------------------------------------------------------------
1 | import en from './en';
2 | import es from './es';
3 | import pl from './pl';
4 |
5 | const messages = {
6 | en,
7 | es,
8 | pl,
9 | };
10 |
11 | export default messages;
12 |
--------------------------------------------------------------------------------
/src/_BIN/pages/warnings/warnings.jade:
--------------------------------------------------------------------------------
1 | if warnings.length === 0
2 | h2 No warnings.
3 | each warning in warnings
4 | .alert.alert-warning
5 | h4= warning.header
6 | pre= warning.text
7 | h5= warning.footer
--------------------------------------------------------------------------------
/src/_BIN/pages/assets/page.js:
--------------------------------------------------------------------------------
1 | var app = require("../../app");
2 |
3 | module.exports = function() {
4 | document.title = "assets";
5 | $(".page").html(require("./assets.jade")({
6 | stats: app.stats
7 | }));
8 | };
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*]
2 | indent_style = space
3 | end_of_line = lf
4 | indent_size = 2
5 | charset = utf-8
6 | trim_trailing_whitespace = true
7 |
8 | [*.md]
9 | max_line_length = 0
10 | trim_trailing_whitespace = false
11 |
--------------------------------------------------------------------------------
/src/components/Hero/index.js:
--------------------------------------------------------------------------------
1 | import Hero from './Hero';
2 | import HeroBackground from './HeroBackground';
3 | import HeroContent from './HeroContent';
4 |
5 | export {
6 | Hero,
7 | HeroContent,
8 | HeroBackground,
9 | };
10 |
--------------------------------------------------------------------------------
/src/pages/HomePage/HomePage.scss:
--------------------------------------------------------------------------------
1 | @import "../../styles/base.scss";
2 |
3 | .title {
4 | font-weight: bold;
5 | }
6 |
7 |
8 | .hero-title {
9 | font-weight: bold;
10 | color: $white;
11 | text-transform: uppercase;
12 | }
13 |
--------------------------------------------------------------------------------
/src/utils/formatSize.js:
--------------------------------------------------------------------------------
1 | module.exports = function formatSize(s) {
2 | if (s < 2048) { return `${ s } bytes`; }
3 | s /= 1024;
4 | if (s < 2048) { return `${ Math.round(s) } KiB`; }
5 | s /= 1024;
6 | return `${ Math.round(s) } MiB`;
7 | };
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 |
3 | language: node_js
4 |
5 | env:
6 | - NODE_ENV=development NPM_CONFIG_PROGRESS=false
7 |
8 | node_js:
9 | - '6.8'
10 |
11 | script:
12 | - npm run travis
13 |
14 | notifications:
15 | slack:
16 | secure: ""
17 |
--------------------------------------------------------------------------------
/src/pages/AboutPage/AboutPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'aboutPage.title',
4 | defaultMessage: 'About Us',
5 | },
6 | overview: {
7 | id: 'aboutPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/ChunkPage/ChunkPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'chunkPage.title',
4 | defaultMessage: 'Chunk',
5 | },
6 | overview: {
7 | id: 'chunkPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/ErrorPage/ErrorPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'errorPage.title',
4 | defaultMessage: 'Error',
5 | },
6 | overview: {
7 | id: 'errorPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/HintsPage/HintsPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'hintsPage.title',
4 | defaultMessage: 'Hints',
5 | },
6 | overview: {
7 | id: 'hintsPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/AssetsPage/AssetsPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'assetsPage.title',
4 | defaultMessage: 'Assets',
5 | },
6 | overview: {
7 | id: 'assetsPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/ChunksPage/ChunksPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'chunksPage.title',
4 | defaultMessage: 'Chunks',
5 | },
6 | overview: {
7 | id: 'chunksPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/ErrorsPage/ErrorsPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'errorsPage.title',
4 | defaultMessage: 'Errors',
5 | },
6 | overview: {
7 | id: 'errorsPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/ModulePage/ModulePage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'modulePage.title',
4 | defaultMessage: 'Module',
5 | },
6 | overview: {
7 | id: 'modulePage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/SelectPage/SelectPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'selectPage.title',
4 | defaultMessage: 'Select',
5 | },
6 | overview: {
7 | id: 'selectPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/UploadPage/UploadPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'uploadPage.title',
4 | defaultMessage: 'Upload',
5 | },
6 | overview: {
7 | id: 'uploadPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/ModulesPage/ModulesPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'modulesPage.title',
4 | defaultMessage: 'Modules',
5 | },
6 | overview: {
7 | id: 'modulesPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/pages/WarningsPage/WarningsPage.i18n.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | title: {
3 | id: 'warningsPage.title',
4 | defaultMessage: 'Warnings',
5 | },
6 | overview: {
7 | id: 'warningsPage.overview',
8 | defaultMessage: 'overview',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/src/components/Login/Login.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 |
3 | const Login = (props) =>
4 | Login;
5 |
6 | Login.displayName = 'Login';
7 | Login.propTypes = {
8 | onClick: PropTypes.func.isRequired,
9 | };
10 |
11 | export default Login;
12 |
--------------------------------------------------------------------------------
/config/environments/development.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | webpack: {
3 | devtool: 'cheap-module-eval-source-map',
4 | },
5 |
6 | compiler: {
7 | hash_type: 'hash',
8 | stats: {
9 | chunks: false,
10 | chunkModules: false,
11 | colors: true,
12 | },
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/src/_BIN/pages/chunks/page.js:
--------------------------------------------------------------------------------
1 | var app = require("../../app");
2 | var chunksGraph = require("../../graphs/chunks");
3 |
4 | module.exports = function() {
5 | document.title = "chunks";
6 | $(".page").html(require("./chunks.jade")({
7 | stats: app.stats
8 | }));
9 | chunksGraph.show();
10 | return function() {
11 | chunksGraph.hide();
12 | }
13 | };
--------------------------------------------------------------------------------
/src/containers/DevTools.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { createDevTools } from 'redux-devtools';
3 | import LogMonitor from 'redux-devtools-log-monitor';
4 | import DockMonitor from 'redux-devtools-dock-monitor';
5 |
6 | export default createDevTools(
7 |
Ctrl-H for Redux Dev Tools.',
16 | },
17 | autoUpdate: {
18 | id: 'homePage.para.autoUpdate',
19 | defaultMessage: 'This page auto-updates.',
20 | },
21 | es7Decorator: {
22 | id: 'homePage.para.es7Decorator',
23 | defaultMessage: 'It also demonstrates use of the @autobind ES7 decorator.',
24 | },
25 | },
26 | };
27 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["es2015", "stage-0", "react"],
3 | "env": {
4 | "test": {
5 | "presets": ["es2015", "stage-0", "react"],
6 | "plugins": [
7 | "transform-decorators-legacy",
8 | "transform-runtime",
9 | "add-module-exports"
10 | ]
11 | },
12 | "development": {
13 | "presets": ["es2015", "stage-0", "react"],
14 | "plugins": [
15 | "react-hot-loader/babel",
16 | "transform-decorators-legacy",
17 | "transform-runtime",
18 | "add-module-exports"
19 | ]
20 | },
21 | "production": {
22 | "presets": ["es2015", "stage-0", "react"],
23 | "plugins": [
24 | "transform-decorators-legacy",
25 | "transform-runtime",
26 | "add-module-exports"
27 | ]
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/shared/forms.js:
--------------------------------------------------------------------------------
1 | export const messages = {
2 | error: {
3 | email: {
4 | id: 'common.form.error.email',
5 | defaultMessage: 'email address invalid',
6 | },
7 | max: {
8 | id: 'common.form.error.max',
9 | defaultMessage: 'maximum value: {max}',
10 | },
11 | maxLength: {
12 | id: 'common.form.error.maxLength',
13 | defaultMessage: 'maximum length: {maxLength}',
14 | },
15 | min: {
16 | id: 'common.form.error.min',
17 | defaultMessage: 'minimum value: {min}',
18 | },
19 | minLength: {
20 | id: 'common.form.error.minLength',
21 | defaultMessage: 'minimum length: {minLength}',
22 | },
23 | required: {
24 | id: 'common.form.error.required',
25 | defaultMessage: 'this field is required',
26 | },
27 | },
28 | };
29 |
--------------------------------------------------------------------------------
/src/components/Spinner/Spinner.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 | import { Modal } from 'react-bootstrap';
3 | import { FormattedMessage } from 'react-intl';
4 | import styles from './Spinner.scss';
5 |
6 | const Spinner = ({ canShow, messageId }) => {
7 | const className = `glyphicon glyphicon-refresh ${ styles.spinner }`;
8 |
9 | return (
10 | 20 | {site.description} 21 |
22 |
40 |
40 |
40 |
40 |
40 |
40 |
40 |
40 |
40 |
40 |
40 |
40 |
ctrl-h para alternar el panel de Redux Dev Tools.',
16 | 'homePage.para.autoUpdate': 'Esta página se actualiza automáticamente cuando haces cambios y guardas.',
17 | 'homePage.para.es7Decorator': `Esta página también demuestra el uso del decorador
18 | @autobind.`,
19 | 'lang.en': 'English',
20 | 'lang.es': 'Español',
21 | 'lang.pl': 'Polski',
22 | 'navigation.aboutUs': 'Sobre Nosotros',
23 | 'navigation.account': 'Cuenta',
24 | 'navigation.faq': 'FAQ',
25 | 'navigation.help': 'Ayuda',
26 | 'navigation.home': 'r3analyse',
27 | 'navigation.logIn': 'Iniciar Sesión',
28 | 'navigation.logOut': 'Terminar Sesión',
29 | 'navigation.policies': 'Normas',
30 | 'navigation.privacy': 'Privacidad',
31 | 'navigation.terms': 'Términos & Condiciones',
32 | 'profile.edit.title': 'Editar Perfil',
33 | 'profile.form.age.placeholder': 'Edad',
34 | 'profile.form.emailVerified.label': 'Correo verificado',
35 | 'profile.form.email.placeholder': 'correo',
36 | 'profile.form.familyName.placeholder': 'appellido',
37 | 'profile.form.gender.male.label': 'Masculino',
38 | 'profile.form.gender.female.label': 'Femenino',
39 | 'profile.form.givenName.placeholder': 'nombre',
40 | 'profile.form.locale.label': 'Idioma',
41 | 'profile.form.nickname.placeholder': 'nickname',
42 | 'profile.form.notes.label': 'Apuntes',
43 | 'profile.form.reset.label': 'Resetear',
44 | 'profile.form.save.label': 'Guardar',
45 | 'profile.message.updatingUserDetails': 'Actualizando detalles del usuario...',
46 | 'site.message.loggingIn': 'Iniciando sesión...',
47 | 'site.message.loggingOut': 'Terminando sesion...',
48 | 'site.name': 'r3analyse',
49 | };
50 |
--------------------------------------------------------------------------------
/src/translations/en.js:
--------------------------------------------------------------------------------
1 | // English translations
2 | export default {
3 | 'aboutPage.title': 'About Us',
4 | 'aboutPage.overview': `Currently implemented as a stateless component,
5 | so will not auto-update when changes are made.`,
6 | 'common.form.error.required': 'This field is required',
7 | 'common.form.error.email': 'Email address is invalid',
8 | 'common.form.error.max': 'May not be greater than {max}',
9 | 'common.form.error.maxLength': `May not be more than
10 | {maxLength, plural, one {1 character} other {{maxLength} characters}} long`,
11 | 'common.form.error.min': 'Must be at least {min}',
12 | 'common.form.error.minLength': `Must be at least
13 | {minLength, plural, one {1 character} other {{minLength} characters}} long`,
14 | 'homePage.title': 'Home Page',
15 | 'homePage.button.clickMe': 'Click me (log)',
16 | 'homePage.para.pressCtrlH': 'Press ctrl-h to toggle Redux Dev Tools (development build only).',
17 | 'homePage.para.autoUpdate': 'This pages auto-updates when you make changes and save.',
18 | 'homePage.para.es7Decorator': `This page also demonstrates the use of the
19 | @autobind ES7 decorator.`,
20 | 'lang.en': 'English',
21 | 'lang.es': 'Español',
22 | 'lang.pl': 'Polski',
23 | 'navigation.aboutUs': 'About Us',
24 | 'navigation.account': 'Account',
25 | 'navigation.faq': 'FAQ',
26 | 'navigation.help': 'Help',
27 | 'navigation.home': 'r3analyse',
28 | 'navigation.logIn': 'Log in',
29 | 'navigation.logOut': 'Log out',
30 | 'navigation.policies': 'Policies',
31 | 'navigation.privacy': 'Privacy',
32 | 'navigation.terms': 'Terms & Conditions',
33 | 'profile.edit.title': 'Edit Profile',
34 | 'profile.form.age.placeholder': 'Age',
35 | 'profile.form.emailVerified.label': 'Email verified',
36 | 'profile.form.email.placeholder': 'email',
37 | 'profile.form.familyName.placeholder': 'family name',
38 | 'profile.form.gender.male.label': 'Male',
39 | 'profile.form.gender.female.label': 'Female',
40 | 'profile.form.givenName.placeholder': 'given name',
41 | 'profile.form.locale.label': 'Locale',
42 | 'profile.form.nickname.placeholder': 'nickname',
43 | 'profile.form.notes.label': 'Notes',
44 | 'profile.form.reset.label': 'Reset',
45 | 'profile.form.save.label': 'Save',
46 | 'profile.message.updatingUserDetails': 'Updating user details...',
47 | 'site.message.loggingIn': 'Logging in...',
48 | 'site.message.loggingOut': 'Logging out...',
49 | 'site.name': 'r3analyse',
50 | };
51 |
--------------------------------------------------------------------------------
/src/shared/links.js:
--------------------------------------------------------------------------------
1 | import site from '../settings';
2 |
3 | export const links = {
4 | home: {
5 | to: '/',
6 | id: 'navigation.home',
7 | description: 'Go to Home Page',
8 | defaultMessage: site.name,
9 | },
10 |
11 | aboutUs: {
12 | to: '/pages/about-us',
13 | id: 'navigation.aboutUs',
14 | description: 'About Us page link',
15 | defaultMessage: 'About Us',
16 | },
17 |
18 | assets: {
19 | to: '/pages/assets',
20 | id: 'navigation.assets',
21 | description: 'Assets',
22 | defaultMessage: 'Assets',
23 | },
24 |
25 | chunk: {
26 | to: '/pages/chunk',
27 | id: 'navigation.chunk',
28 | description: 'Chunk',
29 | defaultMessage: 'Chunk',
30 | },
31 |
32 | chunks: {
33 | to: '/pages/chunks',
34 | id: 'navigation.chunks',
35 | description: 'Chunks',
36 | defaultMessage: 'Chunks',
37 | },
38 |
39 | error: {
40 | to: '/pages/error',
41 | id: 'navigation.error',
42 | description: 'Error',
43 | defaultMessage: 'Error',
44 | },
45 |
46 | errors: {
47 | to: '/pages/errors',
48 | id: 'navigation.errors',
49 | description: 'Errors',
50 | defaultMessage: 'Errors',
51 | },
52 |
53 | hints: {
54 | to: '/pages/hints',
55 | id: 'navigation.hints',
56 | description: 'Hints',
57 | defaultMessage: 'Hints',
58 | },
59 |
60 | module: {
61 | to: '/pages/module',
62 | id: 'navigation.module',
63 | description: 'Module',
64 | defaultMessage: 'Module',
65 | },
66 |
67 | modules: {
68 | to: '/pages/modules',
69 | id: 'navigation.modules',
70 | description: 'Modules',
71 | defaultMessage: 'Modules',
72 | },
73 |
74 | select: {
75 | to: '/pages/select',
76 | id: 'navigation.select',
77 | description: 'Select',
78 | defaultMessage: 'Select',
79 | },
80 |
81 | upload: {
82 | to: '/pages/upload',
83 | id: 'navigation.upload',
84 | description: 'Upload',
85 | defaultMessage: 'Upload',
86 | },
87 |
88 | warnings: {
89 | to: '/pages/warnings',
90 | id: 'navigation.warnings',
91 | description: 'Warnings',
92 | defaultMessage: 'Warnings',
93 | },
94 |
95 | logIn: {
96 | id: 'navigation.logIn',
97 | description: 'Log in',
98 | defaultMessage: 'Log in',
99 | },
100 |
101 | logOut: {
102 | id: 'navigation.logOut',
103 | description: 'Log out',
104 | defaultMessage: 'Log out',
105 | },
106 |
107 | };
108 |
--------------------------------------------------------------------------------
/src/pages/HomePage/HomePage.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 | import { FormattedMessage, FormattedHTMLMessage } from 'react-intl';
3 | import { connect } from 'react-redux';
4 | import { Grid, Row, Col, Button } from 'react-bootstrap';
5 | import debug from 'debug';
6 | import { autobind } from 'core-decorators';
7 | import styles from './HomePage.scss';
8 | import { messages } from './HomePage.i18n';
9 | import HomePageHero from './HomePageHero';
10 | import {
11 | updateDocumentTitle,
12 | resetDocumentTitle,
13 | } from '../../redux/modules/document-title/document-title';
14 |
15 | if (__DEBUG__) {
16 | debug.enable('home-page:*');
17 | }
18 |
19 | const log = debug('home-page:info');
20 |
21 | export class HomePage extends React.Component {
22 | static displayName = 'HomePage';
23 | static propTypes = {
24 | isAuthenticated: PropTypes.bool,
25 | dispatch: PropTypes.func,
26 | };
27 |
28 | // executes only on the client
29 | componentDidMount() {
30 | this.props.dispatch(updateDocumentTitle(messages.title));
31 | }
32 |
33 | componentWillUnmount() {
34 | log('remove custom document title');
35 | this.props.dispatch(resetDocumentTitle());
36 | }
37 |
38 | @autobind
39 | handleButtonClick() {
40 | log('button click handler context:', this);
41 | }
42 |
43 | render() {
44 | return (
45 |
54 |
57 |
60 |
ctrl-h ' +
17 | 'aby włączyć Redux Narzędzia Konstruktorskie (w proceśie budowniczym tylko).',
18 | 'homePage.para.autoUpdate': 'Ta strona automatycznie sie odświeża po wprowadzeniu i zachowaniu zmian.',
19 | 'homePage.para.es7Decorator': `Ta strona pokazuje również używanie
20 | @autobind ES7 dekoratorów.`,
21 | 'lang.en': 'Angielski',
22 | 'lang.es': 'Hiszpański',
23 | 'lang.pl': 'Polski',
24 | 'navigation.aboutUs': 'O Nas',
25 | 'navigation.account': 'Konto',
26 | 'navigation.faq': 'FAQ',
27 | 'navigation.help': 'Pomoc',
28 | 'navigation.home': 'r3analyse',
29 | 'navigation.logIn': 'Zaloguj się',
30 | 'navigation.logOut': 'Wyloguj się',
31 | 'navigation.policies': 'Ustawy',
32 | 'navigation.privacy': 'Prywatność',
33 | 'navigation.terms': 'Zasady i Warunki',
34 | 'profile.edit.title': 'Edytuj profil',
35 | 'profile.form.age.placeholder': 'Wiek',
36 | 'profile.form.emailVerified.label': 'Email zweryfikowany',
37 | 'profile.form.email.placeholder': 'email',
38 | 'profile.form.familyName.placeholder': 'nazwisko rodowe',
39 | 'profile.form.gender.male.label': 'Mężczyzna',
40 | 'profile.form.gender.female.label': 'Kobieta',
41 | 'profile.form.givenName.placeholder': 'nadane imię',
42 | 'profile.form.locale.label': 'Region',
43 | 'profile.form.nickname.placeholder': 'ksywa',
44 | 'profile.form.notes.label': 'Notatki',
45 | 'profile.form.reset.label': 'Zresetować',
46 | 'profile.form.save.label': 'Zapisać',
47 | 'profile.message.updatingUserDetails': 'Aktualizowanie danych użytkownika...',
48 | 'site.message.loggingIn': 'Podczas logowania...',
49 | 'site.message.loggingOut': 'Podczas wylogowania...',
50 | 'site.name': 'r3analyse',
51 | };
52 |
--------------------------------------------------------------------------------
/src/components/FormFields/TextInput.spec.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import TestUtils from 'react-addons-test-utils';
3 | import TextInput from './TextInput';
4 |
5 | const shallowRender = (component) => {
6 | const renderer = TestUtils.createRenderer();
7 |
8 | renderer.render(component);
9 |
10 | return renderer.getRenderOutput();
11 | };
12 |
13 | const shallowRenderWithProps = (props = {}) =>
14 | shallowRender(--profile.
16 | .col-md-3: .well
17 | h4 size
18 | = require("../../formatSize")(module.size)
19 | .row
20 | .col-md-3: .well
21 | h4 flags
22 | if module.built
23 | span.label.label-success built
24 | = " "
25 | if !module.cacheable
26 | span.label.label-warning not cacheable
27 | = " "
28 | if module.prefetched
29 | span.label.label-success prefetched
30 | = " "
31 | if module.failed
32 | span.label.label-danger failed
33 | = " "
34 | if module.warnings
35 | span.label.label-warning= module.warnings + " warnings"
36 | = " "
37 | if module.errors
38 | span.label.label-danger= module.errors + " errors"
39 | .col-md-3: .well
40 | h4 chunks
41 | each chunk in module.chunks
42 | a.btn.btn-info(href="#chunk/#{chunk}")= chunk
43 | .col-md-6: .well
44 | if issuer
45 | h4 issuer
46 | table(width="100%"): tbody: tr
47 | td
48 | if typeof issuer.uid === "number"
49 | a.btn.btn-success(href="#module/#{issuer.uid}")= issuer.id
50 | else
51 | span.btn.btn-success= issuer.id
52 | td: pre: code= issuer.name.split("!").join("\n")
53 | .row
54 | .col-md-12: .well
55 | h4 reasons
56 | table.table.table-condensed
57 | thead
58 | tr
59 | th type
60 | th(colspan=2) module
61 | th user request
62 | th location
63 | tbody
64 | each reason in module.reasons
65 | tr
66 | td= reason.type
67 | td(style="width: 1px")
68 | if typeof reason.moduleUid === "number"
69 | a.btn.btn-success(href="#module/#{reason.moduleUid}")= reason.moduleId
70 | else
71 | span.btn.btn-success= reason.moduleId
72 | td: if reason.module
73 | pre: code= reason.module.split("!").join("\n")
74 | td: if reason.userRequest
75 | pre: code= reason.userRequest.split("!").join("\n")
76 | td
77 | if reason.loc
78 | code= reason.loc
79 | .row
80 | .col-md-12: .well
81 | h4 dependencies
82 | table.table
83 | thead
84 | tr
85 | th type
86 | th(colspan=2) module
87 | th user request
88 | th location
89 | tbody
90 | each dependency in module.dependencies
91 | tr
92 | td= dependency.type
93 | td(style="width: 1px")
94 | if typeof dependency.moduleUid === "number"
95 | a.btn.btn-success(href="#module/#{dependency.moduleUid}")= dependency.moduleId
96 | else
97 | span.btn.btn-success= dependency.moduleId
98 | td: if dependency.module
99 | pre: code= dependency.module.split("!").join("\n")
100 | td: if dependency.userRequest
101 | pre: code= dependency.userRequest.split("!").join("\n")
102 | td
103 | if dependency.loc
104 | code= dependency.loc
105 | .row
106 | .col-md-12
107 | pre: code= module.source
--------------------------------------------------------------------------------
/src/_BIN/pages/hints/hints.jade:
--------------------------------------------------------------------------------
1 | .container-fluid
2 | .row
3 | .col-md-12
4 | if multiChunks.length === 0 && multiRefs.length === 0 && longChains.length === 0
5 | h2 Everything seem to be fine.
6 | if multiChunks.length > 0
7 | h2 Module in multiple chunks
8 | p Check if it is a good idea to move modules into a common parent. You may want to use require.include or insert them into the parents require.ensure array.
9 | table.table.table-bordered
10 | thead
11 | tr
12 | th module
13 | th name
14 | th count
15 | th chunks
16 | th saving
17 | tbody
18 | for item in multiChunks
19 | tr
20 | td
21 | if typeof item.module.uid === "number"
22 | a.btn.btn-success(href="#module/#{item.module.uid}")= item.module.id
23 | else
24 | span.btn.btn-success= item.module.id
25 | splittedModule = item.module.name.split("!")
26 | td: pre: code= splittedModule.join("\n")
27 | td= item.count
28 | td
29 | for chunk, idx in item.module.chunks
30 | if idx > 0
31 | = " "
32 | a.btn.btn-info(href="#chunk/#{chunk}")= chunk
33 | td= require("../../formatSize")(item.saving);
34 | if multiRefs.length > 0
35 | h2 Multiple references to the same module
36 | p Refactor this:
37 | pre: code.
38 | var a = require("xyz").a;
39 | var b = require("xyz").b;
40 | var c = require("xyz").c;
41 | p To this:
42 | pre: code.
43 | var xyz = require("xyz");
44 | var a = xyz.a;
45 | var a = xyz.b;
46 | var c = xyz.c;
47 | table.table.table-bordered
48 | thead
49 | tr
50 | th module
51 | th name
52 | th count
53 | th referenced module
54 | th referenced name
55 | th saving
56 | tbody
57 | for item in multiRefs
58 | tr
59 | td
60 | if typeof item.module.uid === "number"
61 | a.btn.btn-success(href="#module/#{item.module.uid}")= item.module.id
62 | else
63 | span.btn.btn-success= item.module.id
64 | td: pre: code= item.module.name.split("!").join("\n")
65 | td= item.count
66 | td
67 | if typeof item.otherModule.uid === "number"
68 | a.btn.btn-success(href="#module/#{item.otherModule.uid}")= item.otherModule.id
69 | else
70 | span.btn.btn-success= item.otherModule.id
71 | td: pre: code= item.otherModule.name.split("!").join("\n")
72 | td= require("../../formatSize")(item.saving) + "+"
73 | if longChains.length > 0
74 | h2 Long module build chains
75 | p Use prefetching to increase build performance. Prefetch a module from the middle of the chain.
76 | for chain in longChains
77 | table.table.table-bordered
78 | thead
79 | tr
80 | th module
81 | th name
82 | th time
83 | th finished @
84 | tbody
85 | for module in chain
86 | tr
87 | td
88 | if typeof module.uid === "number"
89 | a.btn.btn-success(href="#module/#{module.uid}")= module.id
90 | else
91 | span.btn.btn-success= module.id
92 | td: pre: code= module.name.split("!").join("\n")
93 | td= module.time + " ms"
94 | td= module.timestamp + " ms"
95 |
--------------------------------------------------------------------------------
/src/_BIN/pages/chunk/chunk.jade:
--------------------------------------------------------------------------------
1 | .container-fluid
2 | .row
3 | .col-md-4: .well
4 | h4 chunk id
5 | = id
6 | .col-md-4: .well
7 | h4 size
8 | = require("../../formatSize")(chunk.size)
9 | .col-md-4: .well
10 | h4 names
11 | each name in chunk.names
12 | code= name
13 | .row
14 | if chunk.parents.length && chunk.children.length
15 | .col-md-3: .well
16 | h4 parents
17 | each parent in chunk.parents
18 | a.btn.btn-info(href="#chunk/#{parent}")= parent
19 | = " "
20 | .col-md-3: .well
21 | h4 children
22 | each child in chunk.children
23 | a.btn.btn-info(href="#chunk/#{child}")= child
24 | = " "
25 | else if chunk.parents.length
26 | .col-md-6: .well
27 | h4 parents
28 | each parent in chunk.parents
29 | a.btn.btn-info(href="#chunk/#{parent}")= parent
30 | = " "
31 | else if chunk.children.length
32 | .col-md-6: .well
33 | h4 children
34 | each child in chunk.children
35 | a.btn.btn-info(href="#chunk/#{child}")= child
36 | = " "
37 | .col-md-6: .well
38 | h4 files
39 | each file in chunk.files
40 | a.btn.btn-default(href="#assets")= file
41 | = " "
42 | .row
43 | .col-md-12: .well
44 | h4 origins
45 | table.table.table-condensed
46 | thead
47 | tr
48 | th reasons
49 | th name
50 | th(colspan="2") module
51 | th location
52 | tbody
53 | each origin in chunk.origins
54 | tr
55 | td
56 | each reason in origin.reasons
57 | code= reason
58 | = " "
59 | td: code= origin.name
60 | td
61 | if typeof origin.moduleUid === "number"
62 | a.btn.btn-success(href="#module/#{origin.moduleUid}")= origin.moduleId
63 | else
64 | span.btn.btn-success= origin.moduleId
65 | td: pre: code= origin.moduleName.split("!").join("\n");
66 | td
67 | if origin.loc
68 | code= origin.loc
69 | if chunk.modules && chunk.modules.length > 0
70 | .row: .col-md-12: .well
71 | h4 modules
72 | table.table.table-condensed
73 | thead
74 | tr
75 | th id
76 | th name
77 | th size
78 | th chunks
79 | th flags
80 | tbody
81 | each module in chunk.modules
82 | tr
83 | td
84 | if typeof module.uid === "number"
85 | a.btn.btn-success(href="#module/#{module.uid}")= module.id
86 | else
87 | span.btn.btn-success= module.id
88 | td: pre: code= module.name.split("!").join("\n")
89 | td= require("../../formatSize")(module.size)
90 | td
91 | each chunk in module.chunks
92 | a.btn.btn-info(href="#chunk/#{chunk}")= chunk
93 | = " "
94 | td
95 | if module.built
96 | span.label.label-success built
97 | = " "
98 | if !module.cacheable
99 | span.label.label-warning not cacheable
100 | = " "
101 | if module.prefetched
102 | span.label.label-success prefetched
103 | = " "
104 | if module.failed
105 | span.label.label-danger failed
106 | = " "
107 | if module.warnings
108 | span.label.label-warning= module.warnings + " warnings"
109 | = " "
110 | if module.errors
111 | span.label.label-danger= module.errors + " errors"
112 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "analyse-tool",
3 | "version": "1.0.0",
4 | "private": true,
5 | "description": "A tool to analyse your webpack build result. It allows to browse the compilation and points out options to optimize the build.",
6 | "main": "index.js",
7 | "engines": {
8 | "node": ">=6.8.0",
9 | "npm": "^3.0.0"
10 | },
11 | "scripts": {
12 | "build": "npm run dist:clean && npm run copy:static && npm run compile",
13 | "dist:clean": "rm -rf dist && mkdir dist",
14 | "copy:static": "cp -r src/static/* dist",
15 | "compile": "NODE_ENV=production webpack -p --bail",
16 | "dev": "node server",
17 | "dev:bs": "node server --with-browsersync",
18 | "flow": "flow check",
19 | "lint": "eslint . ./",
20 | "start": "npm run dev",
21 | "start:bs": "npm run dev:bs",
22 | "test": "npm run lint && npm run flow",
23 | "travis": "npm test"
24 | },
25 | "repository": {
26 | "type": "git",
27 | "url": "https://github.com/webpack/analyse-tool.git"
28 | },
29 | "keywords": [
30 | "webpack",
31 | "analyse"
32 | ],
33 | "author": "",
34 | "license": "MIT",
35 | "bugs": {
36 | "url": "https://github.com/webpack/analyse-tool/issues"
37 | },
38 | "homepage": "https://github.com/webpack/analyse-tool#readme",
39 | "dependencies": {
40 | "axios": "^0.15.1",
41 | "classnames": "^2.2.5",
42 | "empty": "^0.10.1",
43 | "lodash.merge": "^4.6.0",
44 | "react": "^15.4.0-rc.4",
45 | "react-bootstrap": "^0.30.5",
46 | "react-dom": "^15.4.0-rc.4",
47 | "react-intl": "2.1.5",
48 | "react-redux": "^5.0.0-beta.3",
49 | "react-router": "^3.0.0-beta.1",
50 | "react-router-bootstrap": "^0.23.1",
51 | "react-router-redux": "^4.0.6",
52 | "redux": "^3.6.0",
53 | "redux-form": "^5.3.3",
54 | "redux-form-validation": "^0.0.8",
55 | "redux-logger": "^2.7.0",
56 | "redux-thunk": "^2.1.0",
57 | "sigma": "^1.1.0",
58 | "url": "^0.11.0"
59 | },
60 | "devDependencies": {
61 | "babel-core": "^6.17.0",
62 | "babel-eslint": "^7.0.0",
63 | "babel-loader": "^6.2.5",
64 | "babel-plugin-add-module-exports": "^0.2.1",
65 | "babel-plugin-transform-decorators-legacy": "^1.3.4",
66 | "babel-plugin-transform-runtime": "^6.15.0",
67 | "babel-preset-es2015": "^6.16.0",
68 | "babel-preset-react": "^6.16.0",
69 | "babel-preset-stage-0": "^6.16.0",
70 | "babel-register": "^6.16.3",
71 | "babel-runtime": "^6.11.6",
72 | "browser-sync": "^2.17.3",
73 | "chai": "^3.5.0",
74 | "connect-history-api-fallback": "^1.3.0",
75 | "core-decorators": "^0.13.0",
76 | "css-loader": "^0.25.0",
77 | "cssnano": "^3.7.7",
78 | "eslint": "3.8.0",
79 | "eslint-config-airbnb": "12.0.0",
80 | "eslint-loader": "^1.6.0",
81 | "eslint-plugin-babel": "^3.3.0",
82 | "eslint-plugin-flowtype": "^2.20.0",
83 | "eslint-plugin-import": "^2.0.1",
84 | "eslint-plugin-jsx-a11y": "^2.2.3",
85 | "eslint-plugin-react": "^6.4.1",
86 | "eventsource-polyfill": "^0.9.6",
87 | "express": "^5.0.0-alpha.2",
88 | "extract-text-webpack-plugin": "^2.0.0-beta.4",
89 | "file-loader": "^0.9.0",
90 | "flow-bin": "^0.33.0",
91 | "fs-extra": "^0.30.0",
92 | "html-webpack-plugin": "^2.22.0",
93 | "isparta-loader": "^2.0.0",
94 | "json-loader": "^0.5.4",
95 | "karma": "^1.3.0",
96 | "karma-chai": "^0.1.0",
97 | "karma-mocha": "^1.2.0",
98 | "karma-mocha-reporter": "^2.2.0",
99 | "karma-phantomjs-launcher": "^1.0.2",
100 | "karma-sinon": "^1.0.5",
101 | "karma-sourcemap-loader": "^0.3.7",
102 | "karma-webpack": "^1.8.0",
103 | "lodash.head": "^4.0.1",
104 | "lodash.tail": "^4.1.1",
105 | "mocha": "^3.1.2",
106 | "node-sass": "^3.10.1",
107 | "phantomjs-polyfill": "0.0.2",
108 | "phantomjs-prebuilt": "^2.1.13",
109 | "postcss-loader": "^1.0.0",
110 | "react-addons-test-utils": "^15.4.0-rc.4",
111 | "react-hot-loader": "^3.0.0-beta.6",
112 | "redbox-react": "^1.3.2",
113 | "redux-devtools": "^3.3.1",
114 | "redux-devtools-dock-monitor": "^1.1.1",
115 | "redux-devtools-log-monitor": "^1.0.12-alpha",
116 | "sass-loader": "^4.0.2",
117 | "sinon": "^2.0.0-pre.3",
118 | "style-loader": "^0.13.1",
119 | "url-loader": "^0.5.7",
120 | "webpack": "^2.1.0-beta.25",
121 | "webpack-dev-middleware": "^1.8.4",
122 | "webpack-hot-middleware": "^2.13.0"
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/src/_BIN/app.js:
--------------------------------------------------------------------------------
1 | exports.stats = null;
2 | exports.mapModules = null;
3 | exports.mapChunks = null;
4 |
5 | function load(stats) {
6 | stats.assets.sort(function (a, b) {
7 | return b.size - a.size;
8 | });
9 | stats.modules.sort(function (a, b) {
10 | return a.id - b.id;
11 | });
12 | const mapModules = {};
13 | const mapModulesIdent = {};
14 | const mapModulesUid = {};
15 | stats.modules.forEach(function (module, idx) {
16 | mapModules[module.id] = module;
17 | mapModulesIdent[`$${ module.identifier }`] = module;
18 | mapModulesUid[module.uid = idx] = module;
19 | module.dependencies = [];
20 | });
21 | const mapChunks = {};
22 | stats.chunks.forEach(function (chunk) {
23 | mapChunks[chunk.id] = chunk;
24 | chunk.children = [];
25 | });
26 | stats.modules.forEach(function (module) {
27 | module.reasons.forEach(function (reason) {
28 | const m = mapModulesIdent[`$${ reason.moduleIdentifier }`];
29 | if (!m) { return; }
30 | reason.moduleUid = m.uid;
31 | m.dependencies.push({
32 | type : reason.type,
33 | moduleId : module.id,
34 | moduleUid : module.uid,
35 | module : module.name,
36 | userRequest: reason.userRequest,
37 | loc : reason.loc,
38 | });
39 | });
40 | module.issuerUid = mapModulesIdent[`$${ module.issuer }`] && mapModulesIdent[`$${ module.issuer }`].uid;
41 | (function setTimestamp(module) {
42 | if (typeof module.timestamp === 'number') { return module.timestamp; }
43 | if (!module.profile) { return; }
44 | const factory = module.profile.factory || 0;
45 | const building = module.profile.building || 0;
46 | module.time = factory + building;
47 | if (!module.issuer) { return module.timestamp = module.time; }
48 | const issuer = mapModulesIdent[`$${ module.issuer }`];
49 | if (!issuer) { return module.timestamp = NaN; }
50 | setTimestamp(issuer);
51 | module.timestamp = issuer.timestamp + module.time;
52 | }(module));
53 | });
54 | stats.chunks.forEach(function (chunk) {
55 | chunk.parents.forEach(function (parent) {
56 | const c = mapChunks[parent];
57 | c.children.push(chunk.id);
58 | });
59 | chunk.origins.forEach(function (origin) {
60 | const m = mapModulesIdent[`$${ origin.moduleIdentifier }`];
61 | if (!m) { return; }
62 | origin.moduleUid = m.uid;
63 | });
64 | });
65 | stats.modules.forEach(function (module) {
66 | module.dependencies.sort(function (a, b) {
67 | if (!a.loc && !b.loc) { return 0; }
68 | if (!a.loc) { return 1; }
69 | if (!b.loc) { return -1; }
70 | a = a.loc.split(/[:-]/);
71 | b = b.loc.split(/[:-]/);
72 | if (+a[0] < +b[0]) { return -1; }
73 | if (+a[0] > +b[0]) { return 1; }
74 | if (+a[1] < +b[1]) { return -1; }
75 | if (+a[1] > +b[1]) { return 1; }
76 | return 0;
77 | });
78 | });
79 | let maxLength = 0;
80 | stats.assets.forEach(function (a) {
81 | if (a.name.length > maxLength) { maxLength = a.name.length; }
82 | });
83 | stats.assets.forEach(function (a) {
84 | a.normalizedName = a.name;
85 | while (a.normalizedName.length < maxLength) {
86 | a.normalizedName = ` ${ a.normalizedName }`;
87 | }
88 | });
89 | stats.assets.sort(function (a, b) {
90 | a = a.normalizedName;
91 | b = b.normalizedName;
92 | return a < b ? -1 : 1;
93 | });
94 | exports.stats = stats;
95 | exports.mapChunks = mapChunks;
96 | exports.mapModules = mapModules;
97 | exports.mapModulesUid = mapModulesUid;
98 | exports.mapModulesIdent = mapModulesIdent;
99 |
100 | const ga = require('./googleAnalytics');
101 | ga('set', 'dimension1', `${ categorize(stats.modules.length) }`);
102 | ga('set', 'dimension2', `${ categorize(stats.chunks.length) }`);
103 | ga('set', 'dimension3', `${ categorize(stats.assets.length) }`);
104 | ga('set', 'dimension4', `${ categorize(stats.time) }`);
105 | }
106 |
107 | exports.load = function (stats) {
108 | const isMultiCompile = !stats.assets && !stats.modules && stats.children && stats.children.length > 1;
109 | if (isMultiCompile) {
110 | exports.loadPage('select', stats);
111 | } else {
112 | load(stats);
113 | }
114 | };
115 |
116 | function categorize(number) {
117 | if (number <= 0) { return 0; }
118 | let factor = 1;
119 | do {
120 | if (number <= 10) { return number * factor; }
121 | factor *= 10;
122 | number = Math.floor(number / 10);
123 | } while (number > 0);
124 | return '';
125 | }
126 |
--------------------------------------------------------------------------------
/src/containers/MainHeader/MainHeader.js:
--------------------------------------------------------------------------------
1 | /* eslint operator-linebreak: 0 */
2 | import React, { PropTypes } from 'react';
3 | import { FormattedMessage } from 'react-intl';
4 | import { Link } from 'react-router';
5 | import { LinkContainer } from 'react-router-bootstrap';
6 | import { Navbar, Nav, NavItem } from 'react-bootstrap';
7 | import { connect } from 'react-redux';
8 | import { autobind } from 'core-decorators';
9 | import debug from 'debug';
10 | import UserDropdownMenu from '../../components/UserDropdownMenu/UserDropdownMenu';
11 | import { loginRequest, logoutRequest } from '../../redux/modules/auth/auth-actions';
12 | import LanguageSelectionDropdown from '../LanguageSelectionDropdown/LanguageSelectionDropdown';
13 | import { links } from '../../shared/links';
14 |
15 | if (__DEBUG__) {
16 | debug.enable('app:*');
17 | }
18 |
19 | const log = debug('app:main-header');
20 |
21 | class MainHeader extends React.Component {
22 | static displayName = 'MainHeader';
23 | static propTypes = {
24 | dispatch: PropTypes.func,
25 | isAuthenticated: PropTypes.bool,
26 | user: PropTypes.object,
27 | };
28 |
29 | @autobind
30 | onLogin() {
31 | this.props.dispatch(loginRequest());
32 | }
33 |
34 | @autobind
35 | onLogout() {
36 | this.props.dispatch(logoutRequest());
37 | }
38 |
39 | willReceiveProps(props) {
40 | log('main-header will receive props', props);
41 | }
42 |
43 | render() {
44 | const { user, isAuthenticated } = this.props;
45 |
46 | return (
47 |