1.5.54 • Published 3 months ago

nobj-build-tools v1.5.54

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
3 months ago

nobj-build-tools

Utilities to pack and obfuscate HTML/Javascript Applications and Libraries, featuring enhanced obfuscation, CSS processor, assets and a number of other interesting features.

Initial Requirements

  • Tool runs on Linux, macOS and Windows (requires Cygwin pre-installed)
  • Tool can be installed globally or as devDependencies
  • Tool uses google closure compiler and uglifycss to process the source code. Different settings apply.

Installation

Installing globally

If you develop a lot of applications, you can be interested in installing nobj-build-tools globally. That allows to invoke the different utilities from any folder, as symlinks will be created in /usr/local/bin.

[sudo] npm install -g nobj-build-tools

Installing as devDepencencies

npm install nobj-build-tools --save-dev

In this case, utilities will be ./node_modules/.bin.

Included Tools

commandparameterDescription
nobj-init-liblibNameCreates a new Library
nobj-init-appappNameCreates a new Application
nobj-buildVersionBuilds the library or app in this folder.
nobj-build-appappVersionBuilds the application in this folder
nobj-build-closureappVersionBuilds the closure in this folder
nobj-build-updateUpdate the tool's templates

Usage

Creating a New Library

nobj-init-lib <libname>

The command, assumming you used mylib as the libname, will generate the following folder structure:

mylibrary
    src/
        *.js
        ... all the different source files, using CommonJS modules
    css/
        *.css
        ... all the css files
    main/
        main.js
        ... the main module to run, if any
    assets/
        *
        ... copied to the library web root recursively

Building a Library

Just type from the project directory:

nobj-build [libversion]

  • libversion is the library version.

    • If specified, compiled library will be published to NPM, providing that a npm-package.json.template is present on the root folder. This file will use the placeholder ${VERSION} in the Version Field, and will be substituted with the pacage version.

    • If not specified, no package will be uploaded to NPM

The command will compile all source modules in the folders, and use google-closure-compiler to minimize the code. A stub with CommonJS is automatically added, so you can use require() in your modules. Additionally,

  • Packs all the CSS found in the CSS folders
  • Copies your included assets to the resulting Web Root
  • The selected template can also have CSS, Assets and code, that is equally merged
  • Finally, if you have set the CLOUDDIR env var, the resulting library will be uploded to that S3 bucket path.
  • If you have created a npm-package.json, the package is uploaded to NPM

Creating a New Application

nobj-init-app <template> <appname>

  • appname is the application short name. A folder will be created with this name, so avoid spaces and conflictive symbols.
  • template is the application template to use. The tool provides an always growing list of templates: The tool help page will display them.

The command above, assumming you used myapp as the appname, will generate the following folder structure:

myapp
    src/
        main.js
        *.js

        section1/
            *.js
            css/
                *.css
        .
        .

        ... placeholder for your different source modules (CommonJS modules). You can also create arbitrary folders
            with code and their own CSS folders to better organize your code.

    css/
        *.css
        ... placeholder for the application css files


    assets/
        index.html
        *.html ...
        *.jpg ....

        ... copied to the library web root recursively. This is the place to
            put the "index.html"

The selected template may have populated that tree with arbitrary files you can customize.

Building an Application

To build an application you have created, just type from the project directory:

nobj-build [version]

The command will compile all source modules in the folders, and use google-closure-compiler to minimize the code. A stub with CommonJS is automatically added, so you can use require() in your modules. Additionally:

  • Packs all the CSS found in the CSS folders
  • Copies your included assets to the resulting Web Root
  • The selected template can also have CSS, Assets and code, that is equally merged
Uploading the application to your CDN

Set the CLOUDDIR environment variable with the S3 bucket path, like:

export CLOUDDIR=s3://mycdnbucket/public/lib
  • Requires AWS Client Software installed on the computer,.

License

nobj-build-tools (C) 2021 Nebular Streams, All rights reserved. https://bitbucket.org/nebularstreams/nobj-build-tools/

1.5.54

3 months ago

1.5.52

5 months ago

1.5.51

5 months ago

1.5.53

4 months ago

1.5.44

5 months ago

1.5.50

5 months ago

1.5.43

6 months ago

1.5.42

7 months ago

1.5.38

1 year ago

1.5.39

1 year ago

1.5.41

1 year ago

1.5.40

1 year ago

1.5.37

1 year ago

1.5.36

1 year ago

1.5.34

2 years ago

1.5.35

2 years ago

1.5.30

2 years ago

1.5.32

2 years ago

1.5.31

2 years ago

1.5.33

2 years ago

1.5.27

2 years ago

1.5.29

2 years ago

1.5.28

2 years ago

1.5.25

2 years ago

1.5.24

2 years ago

1.5.26

2 years ago

1.5.23

2 years ago

1.5.22

2 years ago

1.5.21

2 years ago

1.5.20

2 years ago

1.5.12

2 years ago

1.5.14

2 years ago

1.5.13

2 years ago

1.5.16

2 years ago

1.5.15

2 years ago

1.5.18

2 years ago

1.5.17

2 years ago

1.5.19

2 years ago

1.5.10

2 years ago

1.5.11

2 years ago

1.5.9

2 years ago

1.5.8

2 years ago

1.5.7

3 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.3.3

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.3.2

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.5.6

3 years ago

1.2.25

3 years ago

1.2.24

3 years ago

1.2.23

3 years ago

1.2.22

3 years ago

1.2.21

3 years ago

1.2.20

3 years ago

1.2.16

4 years ago

1.2.15

4 years ago

1.2.13

4 years ago

1.2.11

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

0.2.1

4 years ago

1.0.2

4 years ago