New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-rollup

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-rollup - npm Package Versions

1235

1.0.0-rc.3

Diff

Changelog

Source

1.0.0-rc.3

  • Fixed an issue that caused library config to generate with incorrect path
  • Updated default paths in library configuration to conform to Package Spec 5.0
  • Fixed an issue that could cause modules to not be generated when using ngr generate module
  • Fixed an issue that could prevent global stylesheet from being generated in dist folder
  • Updated README

steveblue
published 1.0.0-rc.2 •

Changelog

Source

1.0.0-rc.2

  • Added method to generate a library package
  • Added cli commands to generate unit tests for components and directives
  • Added unit test generation to the wizard
  • Fixed an issue with system.config.js that prevented rxjs from being currently mapped in dev mode
  • Fixed an issue that would cause warnings when trying to run ngr update --lib. This argument will be deprecated in a future release, Use ngr generate lib instead.

Generate the configuration required for library packages with ngr generate lib or use ngr generate wizard.

ngr generate lib --name my-lib --dir src/app/shared/lib

After you have generated some components for the library, use ngr build lib to build the library in the dist folder.

ngr build lib -c src/app/shared/lib/lib.config.json

Generate a unit test either use the wizard (ngr generate wizard) or use the following examples as a guide.

ngr generate unit --dir src/app/shared/components/my-component --name my-component

Optionally, generate a unit test for a directive with the --spec argument.

ngr generate unit --dir src/app/shared/components/my-component --name my-directive --spec directive


steveblue
published 1.0.0-rc.1 •

Changelog

Source

1.0.0-rc.1

  • ngr build lib now accepts --config argument, can point to a JSON configuration for library packages
  • Fixed an issue that caused es2015 code to be bundled with the umd library
  • Fixed an issue that caused sourcemaps to be emitted with css in components packaged with the library build
  • Added sourcemaps for es5 and umd bundles
  • Deprecated copy:package field in package.json and automated this command
  • Fixed syntax highlighting in the CHANGELOG

This release includes a huge upgrade for library builds that allows multiple packages to be deployed from the same application. This change does not effect existing configuration and should be fully backwards compatible.

A new configuration file will be autogenerated when scaffolding a library. The JSON looks like this:

{
    "src": "src/app/shared/lib",
    "dist": "dist",
    "filename": "default-lib",
    "es2015": {
      "tsConfig": "tsconfig.lib.json",
      "rollupConfig": "rollup.config.lib.js",
      "outFile": "dist/default-lib.js"
    },
    "es5": {
      "tsConfig": "tsconfig.lib.es5.json",
      "rollupConfig": "rollup.config.lib-es5.js",
      "outFile": "dist/default-lib.es5.js"
    },
    "umd": {
      "tsConfig": "tsconfig.lib.es5.json",
      "rollupConfig": "rollup.config.lib-umd.js",
      "outFile": "dist/bundles/default-lib.umd.js"
    }
}

This JSON should be a sibling to the library's package.json.

The following files can be migrated to the root folder of a library package.

  • tsconfig.lib.json
  • tsconfig.lib.es5.json
  • rollup.config.lib.js
  • rollup.config.lib-umd.js
  • rollup.config.lib-es5.js

The paths in tsconfig files will have to be updated to be relative to the root directory. The library build still uses tmp and out-tsc folders in the root project directory during the build phase.

Here is an example:

  "compilerOptions": {
    "baseUrl": ".",
    "rootDir": "../../../../tmp",
    "outDir": "../../../../out-tsc",

    ...

     "files": [
         "../../../../tmp/index.ts"
      ],

You can now use the --config argument to build a library package like so:

ngr build lib -c src/app/shared/lib/lib.config.json

This of course brings the added benefit of developing multiple library packages in the same application. Before, developers were limited to one library package per application since the build was bound to the configuration found in build.config.js. The new format allows secondary entry points to be compiled, per the Package Format spec. This older config should still work, but it is recommended to update to this latest format to ensure future compatibility.


steveblue
published 1.0.0-rc.0 •

Changelog

Source

1.0.0-rc.0

  • Version bump
  • Update README

steveblue
published 1.0.0-beta.12 •

Changelog

Source

1.0.0-beta.12

  • Support for Angular 5.0.0
  • ngr scaffold now defaults to a single bundle, use --lazy to bootstrap with lazyloaded routes, --dynamicRoutes is the same
  • Added EXPERIMENTAL support for Electron. Scaffold a new app with ngr scaffold --electron then build with --electron argument. electron must be installed with npm i -g electron.
  • Added --remote argument to production build. Allows a client to build from a host closure manifest main.prod.MF
  • Fixed an issue that prevented files in src/public from properly being copied to build
  • Fixed an issue where .gitignore may not be copied when app is scaffolded
  • Fixed an issue that prevented livereload when changing a SASS file while using AOT in --watch mode
  • Added preCompile and postCompile hooks into prod build
  • pre, preCompile, and postCompile functions in build.config.js must return a Promise i.e.
    buildHooks: {
        jit: {
            pre: () => {
                return new Promise((res, rej) => {
                    // do something like copy files into /src
                    res();
                })
            }
        }
    }

For a client to utilize the new --remote flag and build a lazyloaded module from a host module, the host must provide a package for the client that includes:

  • out-tsc files that were bundled in the host's bundle.js, listed in the host's main.prod.MF
  • bundle.js and bundle.js.map files to be used in the client's index.html for testing against the production bundle
  • main.prod.MF

The client must then copy the host's out-tsc files into /out-tsc during the postCompile build step. The client must also copy the host's main.prod.MF into /closure during the postCompile build step. The client must copy bundle.js and bundle.js.map into the /build directory in the post build step.

Here is an example of doing this with the buildHooks:

    buildHooks: {
        prod: {
            preCompile: function (args) {

                let isRemote = false;
                args.forEach((arg) => {
                    if (arg.includes('remote')) {
                        isRemote = arg.split('=')[1].trim() === 'true' ? true : false;
                    }
                });
                return new Promise((res, rej) => {
                    if (isRemote) {
                        mkdir('remote');
                        cp(path.normalize('./path/to/host/files'), path.normalize('./remote'));
                        res();
                    } else {
                        res();
                    }

                });
            },
            postCompile: function (args) {

                let isRemote = false;
                args.forEach((arg) => {
                    if (arg.includes('remote')) {
                        isRemote = arg.split('=')[1].trim() === 'true' ? true : false;
                    }
                });
                return new Promise((res, rej) => {
                    if (isRemote) {
                        cp(path.normalize('./remote/main.prod.MF'), path.normalize('./closure/main.prod.MF'));
                        cp('-R', path.normalize('./remote/out-tsc/*'), path.normalize('./out-tsc/'));
                        res();
                    } else {
                        res();
                    }

                });
            },
            post: function(args) {
                let isRemote = false;
                args.forEach((arg) => {
                    if (arg.includes('remote')) {
                        isRemote = arg.split('=')[1].trim() === 'true' ? true : false;
                    }
                });
                if (isRemote) {
                    cp(path.normalize('./remote/bundle.js'), path.normalize('./build/bundle.remote.js'));
                    cp(path.normalize('./remote/bundle.js.map'), path.normalize('./build/bundle.remote.js.map'));
                }
            }
        }
    }

steveblue
published 1.0.0-beta.11 •

Changelog

Source

1.0.0-beta.11

  • Added first argument to all buildHooks callbacks in build.config.js that allows user to do something based on process.argv
  • Fixed issue with scaffolding an app that prevented initial build
  • Fixed issue in library build that prevented files from properly being copied
  • Fixed logging errors in jit build
  • Fixed an issue that prevented the library build from distributing css

steveblue
published 1.0.0-beta.10 •

Changelog

Source

1.0.0-beta.10

This update includes the remaining major new features for 1.0.0. Leading up to 1.0.0 this project will primarily be targeting bugfixes and improvements to support @angular 5.0.0.

This update includes several improvements to scaffolding and updating apps. Both scripts now warn you that files will be overwritten. if you try to scaffold an app over an existing app or update files that already exist. The ngr update command includes a helper argument (--cliVersion) to track changes necessary in boilerplate files when updating. Also found in this version is a new --dynamicRoutes option for scaffolding that allows for a dynamic route configuration on bootstrap. More concise log messages and better error reporting in the terminal are packaged with this release. The largest change to the production build is that closure Compiler is now the default bundler when running ngr build prod.

  • --closure is now the default production build, use ngr build prod --rollup to bundle with Rollup instead
  • Refactored boilerplate index.html, system.import.js, and system.config.prod.js to support lazyloaded bundles
  • New --dynamicRoutes option available for scaffold and update, will scaffold app with support for configurable routes prior to bootstrap
  • New argument for update --cliVersion will attempt to update existing boilerplate, but will not overwrite existing files
  • New configuration file lazy.config.json provides model for automating Closure Compiler and SystemJS polyfill for lazyloaded bundles
  • Prevented overwriting of project files when user repeats ngr scaffold or ngr update
  • Moved the SystemJS polyfill into system.polyfill.js. This script requests lazy.config.json, uses a polyfill for SystemJS to map lazyloaded bundles. This config file is only necessary for the --lazy build.
  • Condensed log messages for build scripts. Use --verbose to print more verbose messages
  • Fixed issue with Closure Compiler that prevented bundle.js from being created
  • Improved error reporting across the builds by adding new warnings, specific messages to help fix issues
  • Third party libraries (externs) that are specific to a lazyloaded bundle can be bundled but not mangled by ADVANCED_OPTIMIZATIONS when configured in lazy.config.json
  • Fixed issues with --lazy build when two or more lazyloaded bundles shared dependencies with the main bundle
  • Fixes an issue with --lazy build when declaring externs in closure.externs.js

To update:

$npm install -g angular-rollup@latest

In the project directory:

$ngr update --angularVersion 4.4.4 --cliVersion 1.0.0-beta.10 $npm install

ngr update --cliVersion

$ ngr update --cliVersion 1.0.0-beta.10
[13:17:07] LOG Review changes to angular-rollup in the CHANGELOG (https://github.com/steveblue/angular2-rollup/blob/master/CHANGELOG.md)
[13:17:07] LOG lazy.config.json copied to /Users/steveb/www/4-test/
[13:17:07] LOG system.polyfill.js copied to /Users/steveb/www/4-test/
[13:17:07] WARN src/public/system.import.js already exists
[13:17:07] WARN src/public/system.config.prod.js already exists
[13:17:07] WARN src/public/index.html already exists
[13:17:07] WARN Please move or delete existing files to prevent overwiting. Use a diff tool to track project specific changes.

The update task copies new files, warns about overwriting existing files.

If you have changed boilerplate files, you will need to diff them against the new files. Copy the files into a temporary directory and run the command again, then diff the existing files to check for project specific changes.

If you do not have changes to the boilerplate files, just remove the files and run the command again.

steveblue
published 1.0.0-beta.9 •

Changelog

Source

1.0.0-beta.9

  • Fixed issue with update warning

steveblue
published 1.0.0-beta.8 •

Changelog

Source

1.0.0-beta.8

  • Cleaned up terminal logs
  • Added warning message for when locally installed cli is out of date
  • Fixed missing .map file for Reflect.js in --jit mode

steveblue
published 1.0.0-beta.7 •

Changelog

Source

1.0.0-beta.7

  • New wizard makes codegen simpler, trigger with ngr generate wizard
  • Fixed usage of g as shorthand for generate

Example of output from the wizard:

$ ngr generate wizard
$ ngr codegen wizard
$ filename: kabab-case filename i.e. global-header
$ directory: path/to/folder i.e. src/app/shared/components/global-header
$ type: module, component, directive, enum, e2e, guard, interface, pipe, service
$ Follow the prompts after selecting a type
filename:  global-header
directory:  src/app/shared/components/global-header
type:  module
component:  y
directive:  n
routes:  n
unit:  y
e2e:  n
[15:38:18] LOG global-header.component.html copied to global-header
[15:38:18] LOG global-header.component.scss copied to global-header
[15:38:18] LOG global-header.component.ts copied to global-header
[15:38:18] LOG global-header.module.spec.ts copied to global-header
[15:38:18] LOG global-header.module.ts copied to global-header

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc