Socket
Socket
Sign inDemoInstall

@cypress/browserify-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress/browserify-preprocessor - npm Package Compare versions

Comparing version 2.1.4 to 2.2.0

44

index.js

@@ -5,3 +5,3 @@ 'use strict'

const Promise = require('bluebird')
const fs = require('./fs')
const fs = require('./lib/fs')

@@ -64,3 +64,3 @@ const cloneDeep = require('lodash.clonedeep')

const getBrowserifyOptions = (entry, userBrowserifyOptions = {}) => {
const getBrowserifyOptions = (entry, userBrowserifyOptions = {}, typescriptPath = null) => {
let browserifyOptions = cloneDeep(defaultOptions.browserifyOptions)

@@ -86,2 +86,32 @@

if (typescriptPath) {
const transform = browserifyOptions.transform
const hasTsifyTransform = transform.some(([name]) => name.includes('tsify'))
const hastsifyPlugin = browserifyOptions.plugin.includes('tsify')
if (hasTsifyTransform || hastsifyPlugin) {
const type = hasTsifyTransform ? 'transform' : 'plugin'
throw new Error(`Error running @cypress/browserify-preprocessor:
It looks like you passed the 'typescript' option and also specified a browserify ${type} for TypeScript. This may cause conflicts.
Please do one of the following:
1) Pass in the 'typescript' option and omit the browserify ${type} (Recommmended)
2) Omit the 'typescript' option and continue to use your own browserify ${type}
`)
}
browserifyOptions.extensions.push('.ts', '.tsx')
// remove babelify setting
browserifyOptions.transform = transform.filter(([name]) => !name.includes('babelify'))
// add typescript compiler
browserifyOptions.transform.push([
path.join(__dirname, './lib/simple_tsify'), {
typescript: require(typescriptPath),
},
])
}
debug('browserifyOptions: %o', browserifyOptions)

@@ -133,3 +163,3 @@

const browserifyOptions = getBrowserifyOptions(filePath, options.browserifyOptions)
const browserifyOptions = getBrowserifyOptions(filePath, options.browserifyOptions, options.typescript)
const watchifyOptions = Object.assign({}, defaultOptions.watchifyOptions, options.watchifyOptions)

@@ -229,2 +259,10 @@

if (process.env.__TESTING__) {
preprocessor.reset = () => {
for (let filePath in bundles) {
delete bundles[filePath]
}
}
}
module.exports = preprocessor

10

package.json
{
"name": "@cypress/browserify-preprocessor",
"description": "Cypress preprocessor for bundling JavaScript via browserify",
"version": "2.1.4",
"version": "2.2.0",
"author": "Chris Breiding <chris@cypress.io>",

@@ -55,6 +55,9 @@ "bugs": "https://github.com/cypress-io/cypress-browserify-preprocessor/issues",

"nsp": "3.2.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"semantic-release": "15.13.15",
"sinon": "7.2.3",
"sinon-chai": "3.3.0",
"snap-shot-it": "7.9.2"
"snap-shot-it": "7.9.2",
"typescript": "3.8.3"
},

@@ -78,3 +81,4 @@ "dependencies": {

"lodash.clonedeep": "4.5.0",
"watchify": "3.11.1"
"watchify": "3.11.1",
"through2": "^2.0.0"
},

@@ -81,0 +85,0 @@ "release": {

@@ -149,2 +149,12 @@ # Cypress Browserify Preprocessor [![CircleCI](https://circleci.com/gh/cypress-io/cypress-browserify-preprocessor/tree/master.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress-browserify-preprocessor/tree/master)

### typescript
When the path to the TypeScript package is given, Cypress will automatically transpile `.ts` spec, plugin, support files. Note that this **DOES NOT** check types.
```javascript
browserify({
typescript: require.resolve('typescript')
})
```
**Default**: `undefined`

@@ -151,0 +161,0 @@

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