cypress-rollup-preprocessor
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -0,1 +1,8 @@ | ||
## [0.4.3](https://github.com/lmarqs/cypress-rollup-preprocessor/compare/v0.4.2...v0.4.3) (2020-08-22) | ||
### Bug Fixes | ||
* watch mode for exception flows ([f63e008](https://github.com/lmarqs/cypress-rollup-preprocessor/commit/f63e0083abf433ef9a22f87f0a215eba1dc49439)) | ||
## [0.4.2](https://github.com/lmarqs/cypress-rollup-preprocessor/compare/v0.4.1...v0.4.2) (2020-08-21) | ||
@@ -2,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
import * as rollup from 'rollup'; | ||
export declare function build(rollupOptions: rollup.RollupOptions, outputOptions: rollup.OutputOptions): Promise<void>; | ||
import { RollupOptions, OutputOptions } from 'rollup'; | ||
export declare function build(rollupOptions: RollupOptions, outputOptions: OutputOptions): Promise<string>; |
@@ -1,2 +0,2 @@ | ||
"use strict";var t=require("rollup"),e=function(){return(e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}; | ||
"use strict";var t=require("rollup"),n=function(){return(n=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)}; | ||
/*! ***************************************************************************** | ||
@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation. | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function n(t,e,n,r){return new(n||(n=Promise))((function(o,u){function i(t){try{c(r.next(t))}catch(t){u(t)}}function a(t){try{c(r.throw(t))}catch(t){u(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))}function r(t,e){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=e.call(t,i)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}var o={};function u(e,o){return n(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return[4,t.rollup(e)];case 1:return[4,n.sent().write(o)];case 2:return n.sent(),[2]}}))}))}function i(i,a){return n(this,void 0,void 0,(function(){var n,c;return r(this,(function(r){switch(r.label){case 0:return o[a.filePath]?[2,o[a.filePath]]:(n=Object.assign({},i.rollupOptions,{input:a.filePath}),c={file:a.outputPath,format:"umd"},[4,u(n,c)]);case 1:return r.sent(),a.shouldWatch&&function(n,r,u){var i=t.watch(e(e({},n),{output:r}));u.on("close",(function(){i.close(),delete o[u.filePath]})),i.on("event",(function(t){switch(t.code){case"BUNDLE_END":o[u.filePath]=t.output[0];break;case"ERROR":delete o[u.filePath],u.emit("rerun");break;case"END":u.emit("rerun")}}))}(n,c,a),[2,a.outputPath]}}))}))}module.exports=function(t){return void 0===t&&(t={}),function(e){return i(t,e)}}; | ||
***************************************************************************** */function e(t,n,e,r){return new(e||(e=Promise))((function(o,u){function i(t){try{a(r.next(t))}catch(t){u(t)}}function c(t){try{a(r.throw(t))}catch(t){u(t)}}function a(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,c)}a((r=r.apply(t,n||[])).next())}))}function r(t,n){var e,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(t,i)}catch(t){u=[6,t],r=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var o={};function u(e,r,u){var i=e.input.toString(),c=t.watch(n(n({},e),{output:r}));u.on("close",(function(){delete o[i],c.close()}));var a=!0;return new Promise((function(t,n){c.on("event",(function(e){["END","ERROR"].includes(e.code)&&(a?a=!1:u.emit("rerun")),"BUNDLE_END"===e.code&&(o[i]=e.output[0],t(o[i])),"ERROR"===e.code&&(delete o[i],n(e.error))}))}))}function i(n,o){return e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,t.rollup(n)];case 1:return[4,e.sent().write(o)];case 2:return e.sent(),[2,o.file.toString()]}}))}))}module.exports=function(t){return void 0===t&&(t={}),function(n){return function(t,n){return e(this,void 0,void 0,(function(){var e,c;return r(this,(function(r){return o[n.filePath]?[2,o[n.filePath]]:(e=Object.assign({},t.rollupOptions,{input:n.filePath}),c={file:n.outputPath,format:"umd"},n.shouldWatch?[2,u(e,c,n)]:[2,i(e,c)])}))}))}(t,n)}}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,7 +0,12 @@ | ||
import rollup from 'rollup'; | ||
import { FileObject } from './types'; | ||
interface ProcessingOptions { | ||
rollupOptions?: Partial<rollup.RollupOptions>; | ||
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
import { RollupOptions } from 'rollup'; | ||
export declare type FileObject = EventEmitter & { | ||
filePath: string; | ||
outputPath: string; | ||
shouldWatch: boolean; | ||
}; | ||
export interface ProcessingOptions { | ||
rollupOptions?: Partial<RollupOptions>; | ||
} | ||
export declare function createPreprocessor(options?: ProcessingOptions): (fileObject: FileObject) => Promise<string>; | ||
export {}; |
@@ -1,4 +0,5 @@ | ||
import * as rollup from 'rollup'; | ||
import { FileObject } from './types'; | ||
export declare const watchOutputCache: Record<string, string>; | ||
export declare function watch(rollupOptions: rollup.RollupOptions, outputOptions: rollup.OutputOptions, file: FileObject): void; | ||
/// <reference types="node" /> | ||
import { RollupOptions, OutputOptions } from 'rollup'; | ||
import { EventEmitter } from 'events'; | ||
export declare const watchersOutput: Record<string, string>; | ||
export declare function watch(rollupOptions: RollupOptions, outputOptions: OutputOptions, file: EventEmitter): Promise<string>; |
{ | ||
"name": "cypress-rollup-preprocessor", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Cypress preprocessor for bundling JavaScript via rollup", | ||
@@ -64,3 +64,3 @@ "main": "dist/index.js", | ||
"source-map-support": "^0.5.19", | ||
"ts-node": "^8.10.2", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.2", | ||
@@ -67,0 +67,0 @@ "yaml-lint": "^1.2.4" |
19605
11
42