Skip to content
Permalink
Browse files

fix: do not compile anything

  • Loading branch information...
kentcdodds committed Oct 2, 2019
1 parent a825e9c commit 67f21c32543af0ecdbaf2508d620d81d3307a433
Showing with 27 additions and 27 deletions.
  1. +9 βˆ’11 package.json
  2. +2 βˆ’2 src/__tests__/command.js
  3. +2 βˆ’2 src/__tests__/index.js
  4. +1 βˆ’1 src/__tests__/is-windows.js
  5. +2 βˆ’2 src/__tests__/variable.js
  6. +3 βˆ’3 src/command.js
  7. +3 βˆ’3 src/index.js
  8. +1 βˆ’1 src/is-windows.js
  9. +4 βˆ’2 src/variable.js
@@ -2,16 +2,15 @@
"name": "cross-env",
"version": "0.0.0-semantically-released",
"description": "Run scripts that set and use environment variables across platforms",
"main": "dist/index.js",
"main": "src/index.js",
"bin": {
"cross-env": "dist/bin/cross-env.js",
"cross-env-shell": "dist/bin/cross-env-shell.js"
"cross-env": "src/bin/cross-env.js",
"cross-env-shell": "src/bin/cross-env-shell.js"
},
"engines": {
"node": ">=8.0"
},
"scripts": {
"build": "kcd-scripts build",
"lint": "kcd-scripts lint",
"test": "kcd-scripts test",
"validate": "kcd-scripts validate"
@@ -22,7 +21,8 @@
}
},
"files": [
"dist"
"src",
"!__tests__"
],
"keywords": [
"cross-environment",
@@ -32,7 +32,6 @@
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.6.2",
"cross-spawn": "^7.0.0"
},
"devDependencies": {
@@ -41,11 +40,10 @@
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js"
},
"eslintIgnore": [
"node_modules",
"coverage",
"dist"
],
"// babel 1": "this disables all built-in plugins from kcd-scripts for tests",
"// babel 2": "that way we ensure that the tests run without compilation",
"// babel 3": "because this module is published as-is. It is not compiled.",
"babel": {},
"repository": {
"type": "git",
"url": "https://github.com/kentcdodds/cross-env.git"
@@ -1,5 +1,5 @@
import isWindowsMock from '../is-windows'
import commandConvert from '../command'
const isWindowsMock = require('../is-windows')
const commandConvert = require('../command')

jest.mock('../is-windows')

@@ -1,5 +1,5 @@
import crossSpawnMock from 'cross-spawn'
import isWindowsMock from '../is-windows'
const crossSpawnMock = require('cross-spawn')
const isWindowsMock = require('../is-windows')

jest.mock('../is-windows')
jest.mock('cross-spawn')
@@ -1,4 +1,4 @@
import isWindows from '../is-windows'
const isWindows = require('../is-windows')

const {
platform,
@@ -1,5 +1,5 @@
import isWindowsMock from '../is-windows'
import varValueConvert from '../variable'
const isWindowsMock = require('../is-windows')
const varValueConvert = require('../variable')

jest.mock('../is-windows')

@@ -1,7 +1,7 @@
import path from 'path'
import isWindows from './is-windows'
const path = require('path')
const isWindows = require('./is-windows')

export default commandConvert
module.exports = commandConvert

/**
* Converts an environment variable usage to be appropriate for the current OS
@@ -1,6 +1,6 @@
import {spawn} from 'cross-spawn'
import commandConvert from './command'
import varValueConvert from './variable'
const {spawn} = require('cross-spawn')
const commandConvert = require('./command')
const varValueConvert = require('./variable')

module.exports = crossEnv

@@ -1,2 +1,2 @@
export default () =>
module.exports = () =>
process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)
@@ -1,7 +1,9 @@
import isWindows from './is-windows'
const isWindows = require('./is-windows')

const pathLikeEnvVarWhitelist = new Set(['PATH', 'NODE_PATH'])

module.exports = varValueConvert

/**
* This will transform UNIX-style list values to Windows-style.
* For example, the value of the $PATH variable "/usr/bin:/usr/local/bin:."
@@ -62,6 +64,6 @@ function resolveEnvVars(varValue) {
* @param {String} originalName Original name of the env variable
* @returns {String} Converted value
*/
export default function varValueConvert(originalValue, originalName) {
function varValueConvert(originalValue, originalName) {
return resolveEnvVars(replaceListDelimiters(originalValue, originalName))
}

2 comments on commit 67f21c3

@Valentin1918

This comment has been minimized.

Copy link

Valentin1918 replied Oct 4, 2019

Why you did it?

@kentcdodds

This comment has been minimized.

Copy link
Owner Author

kentcdodds replied Oct 4, 2019

We don't really need to. The only feature we needed to compile was esmodules and we don't get a lot of benefit by using them. And by removing them, we can remove @babel/runtime as a dependency :)

Please sign in to comment.
You can’t perform that action at this time.