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

@nowa/module-script

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nowa/module-script - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

README.md

17

CHANGELOG.md

@@ -6,2 +6,19 @@ # Change Log

<a name="0.2.0"></a>
# [0.2.0](https://github.com/nowa-webpack/nowa2/compare/@nowa/module-script@0.1.1...@nowa/module-script@0.2.0) (2018-02-06)
### Bug Fixes
* this bind when `parallel` is true ([0629d6e](https://github.com/nowa-webpack/nowa2/commit/0629d6e))
### Features
* compatible for [@nowa](https://github.com/nowa)/core break change ([3e29281](https://github.com/nowa-webpack/nowa2/commit/3e29281))
* debug log module config ([c22278a](https://github.com/nowa-webpack/nowa2/commit/c22278a))
<a name="0.1.1"></a>

@@ -8,0 +25,0 @@ ## 0.1.1 (2018-01-31)

11

index.d.ts
import { Module } from '@nowa/core';
export default class ModuleScript extends Module.Async<ModuleScript.Options> {
export default class ModuleScript extends Module.Async<ModuleScript.Config> {
$name: string;
scripts: ModuleScript.IShellContent[];
scripts?: ModuleScript.SingleScript[];
options?: ModuleScript.IOptions;

@@ -14,3 +14,3 @@ alreadyRun: boolean;

export declare namespace ModuleScript {
type IShellContent = string | (() => void | Promise<void>);
type SingleScript = string | (() => void | Promise<void>);
interface IOptions {

@@ -21,6 +21,3 @@ parallel?: boolean;

}
type Options = IShellContent | IShellContent[] | {
scripts: IShellContent[];
options?: IOptions;
};
type Config = [SingleScript | SingleScript[], IOptions];
}

@@ -10,3 +10,2 @@ "use strict";

this.$name = 'script';
this.scripts = [];
this.alreadyRun = false;

@@ -17,16 +16,7 @@ }

const { logger } = this.$utils;
const moduleOptions = this.$runtime.moduleOptions;
if (Array.isArray(moduleOptions)) {
logger.debug('arrayof string/function config received');
this.scripts.push(...moduleOptions.map(this.validateScript));
}
else if (typeof moduleOptions === 'object') {
logger.debug('{ scripts: [] } config received');
this.options = moduleOptions.options;
this.scripts.push(...moduleOptions.scripts.map(this.validateScript));
}
else {
logger.debug('simple string/function config received');
this.scripts.push(this.validateScript(moduleOptions));
}
const [scripts, options] = this.$runtime.config;
this.options = options || {};
this.scripts = [].concat(scripts).map(this.validateScript);
logger.info(`got ${this.scripts.length} scripts`);
logger.debug(this.scripts);
});

@@ -63,3 +53,3 @@ }

logger.debug('parallel mode');
yield Promise.all(this.scripts.map(this._runScript));
yield Promise.all(this.scripts.map(this._runScript, this));
}

@@ -66,0 +56,0 @@ else {

{
"name": "@nowa/module-script",
"version": "0.1.1",
"version": "0.2.0",
"description": "the nowa script module",

@@ -27,7 +27,7 @@ "scripts": {

"devDependencies": {
"@nowa/core": "^0.4.1",
"@nowa/core": "^0.5.0",
"@types/execa": "^0.8.1"
},
"peerDependencies": {
"@nowa/core": "^0.4.0"
"@nowa/core": "^0.5.0"
},

@@ -34,0 +34,0 @@ "types": "./",

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