GithubHelp home page GithubHelp logo

fusionjs / fusion-cli Goto Github PK

View Code? Open in Web Editor NEW
140.0 11.0 37.0 2.97 MB

Migrated to https://github.com/fusionjs/fusionjs

License: MIT License

JavaScript 99.88% Shell 0.07% Dockerfile 0.04% CSS 0.01%
fusion fusionjs

fusion-cli's Introduction

fusion-cli

Build status

The CLI interface for Fusion.js

The fusion-cli package is responsible for orchestrating compile-time configuration for server and browser bundles, as well as development, test and production variations. It provides a standardized Babel configuration that includes async/await support as well as stage 3+ Ecmascript features.

Due to the complexity involved in configuring many permutations of configurations, Fusion.js does not support custom webpack.config. This design decision allows Fusion.js to eventually move away from Webpack if faster and better bundlers become available. Additionally, it allows Fusion.js to make changes to the internal webpack configuration without the concern of breaking users customizations. If you run into a situation where you feel you need to make a webpack customization, please reach out to us on slack or create an issue describing your use case.

The CLI is also responsible for hot module reloading in development mode, and for running the web server.

Installation

yarn add fusion-cli

CLI API

The CLI API can be most easily run through the Yarn or NPX CLI, e.g. yarn fusion build or npx fusion build.

  • fusion build [dir] [--production] [--log-level] Builds your application assets

    This command generates transpiled javascript/source map files (aka assets, artifacts) for browser and server. By default it builds development assets, but can also build test and production assets, given the respective flags.

    Build artifacts are stored in the .fusion directory.

    • --production: Build production assets
    • --log-level: Log level to output to console [default: "info"]
  • fusion dev [dir] [--port] [--no-hmr] [--test] [--log-level] [--forceLegacyBuild] Builds development assets and runs the application in development mode

    Note that this command only builds browser artifacts in memory, and it doesn't save them to the filesystem. This allows hot module reloading to occur faster since there's no performance cost due to I/O access.

    • --port: The port on which the application runs [default: 3000]
    • --no-hmr: Run without hot modules replacement
    • --test: Run tests as well as application
    • --log-level: Log level to output to console [default: "info"]
    • --forceLegacyBuild: Force enable legacy build. By default not compiled in dev.
    • --perserve-names: Disable name mangling during script minification

Webpack stats.json file

Building an app generates a .fusion/stats.json file, which can be used with webpack-bundle-analyzer

fusion-cli's People

Contributors

kevingrandon avatar rtsao avatar renovate[bot] avatar ganemone avatar lhorie avatar alexmsmithca avatar angus-c avatar uberopensourcebot avatar dennisgl avatar chrisdothtml avatar lxe avatar renovate-bot avatar albertywu avatar rajeshsegu avatar lassedamgaard avatar cdlewis avatar nadiia avatar swojit avatar vicapow avatar derekjuber avatar thegleb avatar ksheedlo avatar blackswanny avatar samundrak avatar

Stargazers

 avatar  avatar  avatar Guillaume avatar Jaffrey avatar Szymon Nowacki avatar Haruka Asakura avatar Max Yi-Hsun Chou avatar Georvic Tur avatar Shawn Jonnet avatar Sorin Muntean avatar Peter Petrov avatar Nicolas avatar Daniel Blendea avatar Prakash Senthil Vel avatar Ahmad Saleem avatar a.o avatar  avatar Erik Peng avatar 达峰的夏天 avatar Favi_ty avatar 海宝 avatar Surdoiu Tudor Marian avatar Vaughan Rouesnel avatar Truong Hoang Dung avatar Jason avatar angsolo avatar  avatar Tajammul Pasha avatar Nikollas Betiol avatar why avatar Arielle Nguyen avatar Gabriel Pereira avatar Alan Leite avatar Vijay Makhija avatar HIRAKI Satoru avatar  avatar Thiago Vieira  avatar Shodipo Ayomide avatar wang avatar W. avatar John Engstrom avatar Luciano Lima avatar Rob Eastham avatar Michael McGraw avatar Henrik Wenz avatar Ryan McQuen avatar Alejandra avatar Nicolas Mena avatar Brandon Quintana avatar Marcus avatar David Alves de Souza avatar Matheus Lima avatar Andrew avatar Suz Oliver avatar Ben Fairclough avatar Jun Liu avatar akabeko avatar Ayupov Azat avatar azu avatar 刘贝 avatar Teancum Besendorfer avatar  avatar Keita Ishibashi avatar Olajide Olaniyan avatar  avatar krinoid avatar ahrbil avatar Konrad (rootsher) Kowalski avatar  avatar 邓杰 avatar Brandon Conway avatar Andrew Danylenko avatar Miguel Ângelo avatar George Kal avatar Matías Hernán García avatar Lucas Hrabovsky avatar Braum avatar Vladimir Kapustin avatar Anna avatar Jaime Rios avatar Bruno Cechet avatar Noah Lemen avatar Phillip Akuamoah-Boateng avatar Jan Killian avatar Parker O'Brien avatar Thiago H S Ramos avatar Shkumbin Maksuti avatar Matías Agustín Méndez avatar Vico Erv avatar  avatar C.J. Winslow avatar Zafar Siddiqi avatar bran avatar Francisco M. Delgado avatar Xiao-Hu Tai avatar Ensar avatar Gabriel avatar Mrwan Ashraf avatar Gavin Dunne avatar

Watchers

 avatar Jandy avatar  avatar James Cloos avatar  avatar  avatar Derek Ju avatar  avatar Oleh Osadchyi avatar Tormen Raßmann avatar  avatar

fusion-cli's Issues

add more nyc reporters

We may like to make nyc reporters configurable(allow passing along --reporters) in the future, but for now, we want to ensure we have the followings:

  • text
  • html
  • cobertura

Document polyfill costs

Fort internal release we're adding all polyfills for all core-js/ES6 and core-js/ES7. The concern is that these will be expensive and make it harder for apps to take full advantage of the performance release.

Fully document the cost of polyfills.

Annotate CLI commands correctly in yargs

yargs help is currently incomplete, given the arguments that are actually used by the handler functions. Unneeded options should be removed, options of the form no-something should be handled correctly, and other valid options should appear in --help

Issue with tests and chunk-id-loader

Due to the way we have dependencies between browser and node builds, the test build will fail if a server test entry imports a file that uses chunk-id-loader and no client entry imports the same file.

(server) ../fusion-cli/build/chunk-id-loader.js!./src/components/translations.js
Module build failed: Error: no result from manifest for /Users/ganemone/dev/graphene-example/src/components/translations.js
    at _generateSource (/Users/ganemone/dev/fusion-cli/build/chunk-id-loader.js:27:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./src/components/translations.js 37:30-135
 @ ./src/__tests__/server.node.js
 @ ../fusion-cli/node_modules/multi-entry-loader?include[]=/Users/ganemone/dev/graphene-example/src/**/__tests__/*.js,exclude[]=/Users/ganemone/dev/graphene-example/src/**/__tests__/*.browser.js
 @ multi __SECRET_MULTI_ENTRY_LOADER__?include[]=/Users/ganemone/dev/graphene-example/src/**/__tests__/*.js,exclude[]=/Users/ganemone/dev/graphene-example/src/**/__tests__/*.browser.js

This brings up a broader issue of testability of code that includes virtual modules. We should fix this issue, and enumerate all our virtual modules and ensure that code that uses them is testable.

Expose context to renderer initialization

I'm trying to write a custom renderer for fusion (replacement of fusion-react), and in order to SSR I need to be able to extract information from the context during the request.

Sorry if this is already supported, I haven't been able to figure out the best way to thread context through to the renderer initialization.

Support colocated unit tests

It is currently enforced that unit tests live in a top-level tests directory. This can make it annoying to write unit tests, so instead, test directories should be able to exist anywhere in src/, colocated with appropriate code.

Support overriding the node environment in dev and test

It is a much better experience to have NODE_ENV overridden
when running fusion dev and fusion test than throwing.
In production, we should still error on the side of caution
and throw, however in dev/test it should suffice to log a warning

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.