Code Monkey home page Code Monkey logo

undercurrent's Introduction

Undercurrent

Build Status

Undercurrent

A slightly opinionated, but highly configurable build system using Gulp and Webpack for optimized frontend tooling, development and testing.

Installation

yarn add -D undercurrent
npm install undercurrent --save-dev

Usage

Undercurrent comes with a default schema and tasks:

  • clean: clears the dist directory in the project cwd directory.
  • copy: copies any font from assets/fonts;
  • images: minifies images.
  • css: builds CSS from SCSS using PostCSS for transformations and also provides linting using Stylelint.
  • js: build JS using Webpack and runs ESLint and a Babel loader.
  • watch: watches changes for copy, css and images.

Within the package.json of your project, you simply need to add a script to run Undercurrent:

cross-env NODE_ENV=development gulp --gulpfile $(npm root)/undercurrent/src/index.js --cwd $(npm prefix)

This script would use the default schema and workflow; however, you can write your own workflow, schema and tasks.

undercurrent's People

Contributors

delawski avatar dependabot[bot] avatar dmao avatar kasparsd avatar kopepasah avatar mehigh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

undercurrent's Issues

Getting Started Guide

Would be great to have a very simple getting started guide stepping through setting up a basic project.

Upgrade gulp-sass to solve the node-sass compile issue on recent nodejs version

Hi,

I've tried downgrade my nodejs from 13 to 12, or even 11. but seem like I still can't finish yarn install without see the node-sass error. (actulaly the compile error make my CPU fan like crazy).

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ydli/.npm/_logs/2020-02-18T14_20_12_321Z-debug.log

After some spike I found it's because the package gulp-sass version is too low. in order to fix the node-sass compile issue we need to upgrade the gulp-sass.

FYI the official node-sass has a table about node version:

NodeJS Minimum node-sass version Node Module
Node 13 4.13+ 79
Node 12 4.12+ 72
Node 11 4.10+ 67
Node 10 4.9+ 64
Node 8 4.5.3+ 57

Is there any plan to upgrade the package version?

Thanks

Add styleguide support in the 'undercurrent way'

I attempted to add styleguide support through the regular gulp-controlled methods, but encountered a couple of issues:
1 - When using it using 'the gulp' way I get an error regarding vinylFs (happenes with the latest Gulp version as well) because vinyl 3 is a breaking update and hence causes a critical error for gulp-util which uses vinyl 2.
2 - when attempting to run the sc5-styleguide-cli from inside our flow, "TypeError: gulp.hasTask is not a function" is an error I constantly got and I think this is causing a conflict between Gulp 4 that we're using and Gulp 3.9.1 the sc5-styleguides is using behind the scenes.
gulp = require('gulp') inside styleguide-cli.js ends up pointing to Gulp 4.0.0 which doesn't have .hasTask defined.

This might be worth picking up when the following issue gets fixed:
SC5/sc5-styleguide#1127

For the moment running using the CLI installed globally is the only way I was able to get it to work to avoid the Gulp versions clash.

Even running npm run styleguide triggers the wrong Gulp version to be loaded inside.

Expand JS schema to support custom loaders

"Is there a way to add vue-loader to the Undercurrent webpack config?" was a question which arose from a project which makes use of this library.

I think we should expand the JS schema to support adding custom loaders:
https://github.com/xwp/undercurrent/blob/master/src/schema/default.json#L33
And then refer it form inside the tasks/js.js
https://github.com/xwp/undercurrent/blob/master/src/tasks/js.js#L39

This will allow us not to have to provide a separate webpack.config file on projects which have such needs.

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.