1.6.0 • Published 4 years ago

@animalus/gulp-dev-tools v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

gulp-dev-tools

Set of gulp build tools for use in building/maintaining angular/nativescript library projects and applications that depend on them. Handles combined web/nativescript libraries. Currently assumes pug used for template creation but only minor refactor needed to handle direct html templates (basically would just need to add option to not compile/watch pug files. But why aren't you using pug?!).

NOTE: This doc is just the VERY beginning of documentation of this library. I am short of time on filling this out at the moment. Best to see it in action in the following test repo.

Library Projects

Library projects are assumed to be in the format of ...

- projects
  - project1
  - project2
  - project3
  - project4
- src

Where src directory contains a sandbox for testing out the various projects, each of which is a publishable library. The projects can be independent of each other or dependent on each other in any sensible heirarchichal structure. Also handles publishing libraries to verdaccio.

Example gulpfile.js:

const gulp = require("gulp");
const tools = require("@animalus/gulp-dev-tools");

// Just adds a few shared tasks needed by addGulpLibTasks.
tools.addGulpTasks(gulp);

//
// The levels here indicate the order of building. Level 0 libraries don't depend on anything but outside libraries,
// level 1 libraries depend on level 0 libs here-in, level 2 depend on level 1 (and hence level 0 as well), and so on.
//
tools.addGulpLibTasks(
    gulp,
    [
        {
            name: "project1",
            level: 0,
            ns: true,
            postBuild: (srcDir, distDir) => {
                //
                // Add a postBuild function if you want to run something after
                // this library is built. Maybe you have some assets (icons, fonts, etc.)
                // that you need to package up too?
                //
        },
        { name: "project2", level: 1, ns: true },
        { name: "project3", level: 1, ns: true },
        { name: "project4", level: 2, ns: true }
    ],
    {
        versions: {
            version_something: "3.1.0",
            version_something_else: "^8.2.14"
        },
        scope: "@<mynamespace>"
    }
);

Then in you can just run...

gulp buildall

... to build all of your libraries in both web and nativescript form. Libraries will be built in order of dependencies. All the 0 level libraries, followed by 1's, followed by 2's, etc. Not the ns: true above says that the library is a shared web/nativescript component. Project "project1" will get built to a library with this name, while its Nativescript coounterpart will get built to "nativescript-project1" To run your libraries in your sandbox you would run ...

gulp dev

... for the web and gulp dev:android or gulp dev:ios for the Nativescript versions. The latter will perform a tns run ....

You can also add the following parameters:

- `--debug` will perform a `tns debug ...` instead of a `tns run ...`
- `--verbose` will echo out any commands that the gulp task shells to the OS, e.g. running `gulp dev:android --verbose` will echo (at the time of this writing anyway) --> `tns run android --env.aot --no-hmr`.

NOTE: There are MANY more gulp tasks added by the above functions, but these are the main ones.

Applications

TBD Lots to say here but under time pressure cutting this off here. Contact for more info.

Publish

npm login npm publish --access public

1.6.0

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago