Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

Commit 67f21c3

Browse files
author
Kent C. Dodds
committedOct 2, 2019
fix: do not compile anything
1 parent a825e9c commit 67f21c3

File tree

9 files changed

+27
-27
lines changed

9 files changed

+27
-27
lines changed
 

‎package.json

+9-11
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
"name": "cross-env",
33
"version": "0.0.0-semantically-released",
44
"description": "Run scripts that set and use environment variables across platforms",
5-
"main": "dist/index.js",
5+
"main": "src/index.js",
66
"bin": {
7-
"cross-env": "dist/bin/cross-env.js",
8-
"cross-env-shell": "dist/bin/cross-env-shell.js"
7+
"cross-env": "src/bin/cross-env.js",
8+
"cross-env-shell": "src/bin/cross-env-shell.js"
99
},
1010
"engines": {
1111
"node": ">=8.0"
1212
},
1313
"scripts": {
14-
"build": "kcd-scripts build",
1514
"lint": "kcd-scripts lint",
1615
"test": "kcd-scripts test",
1716
"validate": "kcd-scripts validate"
@@ -22,7 +21,8 @@
2221
}
2322
},
2423
"files": [
25-
"dist"
24+
"src",
25+
"!__tests__"
2626
],
2727
"keywords": [
2828
"cross-environment",
@@ -32,7 +32,6 @@
3232
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
3333
"license": "MIT",
3434
"dependencies": {
35-
"@babel/runtime": "^7.6.2",
3635
"cross-spawn": "^7.0.0"
3736
},
3837
"devDependencies": {
@@ -41,11 +40,10 @@
4140
"eslintConfig": {
4241
"extends": "./node_modules/kcd-scripts/eslint.js"
4342
},
44-
"eslintIgnore": [
45-
"node_modules",
46-
"coverage",
47-
"dist"
48-
],
43+
"// babel 1": "this disables all built-in plugins from kcd-scripts for tests",
44+
"// babel 2": "that way we ensure that the tests run without compilation",
45+
"// babel 3": "because this module is published as-is. It is not compiled.",
46+
"babel": {},
4947
"repository": {
5048
"type": "git",
5149
"url": "https://github.com/kentcdodds/cross-env.git"

‎src/__tests__/command.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import isWindowsMock from '../is-windows'
2-
import commandConvert from '../command'
1+
const isWindowsMock = require('../is-windows')
2+
const commandConvert = require('../command')
33

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

‎src/__tests__/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import crossSpawnMock from 'cross-spawn'
2-
import isWindowsMock from '../is-windows'
1+
const crossSpawnMock = require('cross-spawn')
2+
const isWindowsMock = require('../is-windows')
33

44
jest.mock('../is-windows')
55
jest.mock('cross-spawn')

‎src/__tests__/is-windows.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import isWindows from '../is-windows'
1+
const isWindows = require('../is-windows')
22

33
const {
44
platform,

‎src/__tests__/variable.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import isWindowsMock from '../is-windows'
2-
import varValueConvert from '../variable'
1+
const isWindowsMock = require('../is-windows')
2+
const varValueConvert = require('../variable')
33

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

‎src/command.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import path from 'path'
2-
import isWindows from './is-windows'
1+
const path = require('path')
2+
const isWindows = require('./is-windows')
33

4-
export default commandConvert
4+
module.exports = commandConvert
55

66
/**
77
* Converts an environment variable usage to be appropriate for the current OS

‎src/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {spawn} from 'cross-spawn'
2-
import commandConvert from './command'
3-
import varValueConvert from './variable'
1+
const {spawn} = require('cross-spawn')
2+
const commandConvert = require('./command')
3+
const varValueConvert = require('./variable')
44

55
module.exports = crossEnv
66

‎src/is-windows.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export default () =>
1+
module.exports = () =>
22
process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)

‎src/variable.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import isWindows from './is-windows'
1+
const isWindows = require('./is-windows')
22

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

5+
module.exports = varValueConvert
6+
57
/**
68
* This will transform UNIX-style list values to Windows-style.
79
* For example, the value of the $PATH variable "/usr/bin:/usr/local/bin:."
@@ -62,6 +64,6 @@ function resolveEnvVars(varValue) {
6264
* @param {String} originalName Original name of the env variable
6365
* @returns {String} Converted value
6466
*/
65-
export default function varValueConvert(originalValue, originalName) {
67+
function varValueConvert(originalValue, originalName) {
6668
return resolveEnvVars(replaceListDelimiters(originalValue, originalName))
6769
}

2 commit comments

Comments
 (2)

Valentin1918 commented on Oct 4, 2019

@Valentin1918

Why you did it?

kentcdodds commented on Oct 4, 2019

@kentcdodds
Owner

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 :)

This repository has been archived.