File tree 6 files changed +30
-15
lines changed
6 files changed +30
-15
lines changed Original file line number Diff line number Diff line change 1
- image : Visual Studio 2017
1
+ image : Visual Studio 2019
2
2
3
3
platform :
4
4
- x64
@@ -23,8 +23,13 @@ skip_commits:
23
23
- ' **/*.md'
24
24
25
25
test_script :
26
- - node --version
27
- - npm --version
28
- - npm install
29
- - npm link
30
- - npm run test
26
+ - ps : node --version
27
+ - ps : npm --version
28
+ - ps : npm config set loglevel silent
29
+ # NPM prefix should be writable by current user.
30
+ - ps : npm config set prefix "$home\\.npm-prefix"
31
+ - ps : $env:Path += ";$home\\.npm-prefix\\"
32
+ - ps : npm install -g 'elm@^0.19.1' 'elm-test@^0.19.1'
33
+ - ps : npm install
34
+ - ps : npm link
35
+ - ps : npm run test
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ const path = require('path');
6
6
const spawn = require ( 'cross-spawn' ) ;
7
7
const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
8
8
const version = require ( '../package.json' ) . version ;
9
- const elmVersion = require ( 'elm/package.json' ) . version ;
9
+ const which = require ( 'which' ) ;
10
+ const elmExecutable = which . sync ( 'elm' , { nothrow : true } ) || require . resolve ( 'elm/bin/elm' ) ;
11
+ const elmVersion = spawn . sync ( elmExecutable , [ '--version' ] ) . stdout . toString ( ) . trim ( ) ;
10
12
const commands = argv . _ ;
11
13
12
14
if ( commands . length === 0 ) {
Original file line number Diff line number Diff line change 5
5
const path = require ( 'path' ) ;
6
6
const spawn = require ( 'cross-spawn' ) ;
7
7
const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
8
- const elmExecutable = require . resolve ( 'elm/bin/elm' ) ;
8
+ const which = require ( 'which' ) ;
9
+ const elmExecutable = which . sync ( 'elm' , { nothrow : true } ) || require . resolve ( 'elm/bin/elm' ) ;
10
+ const elmTestExecutable = which . sync ( 'elm-test' , { nothrow : true } ) || require . resolve ( 'elm-test/bin/elm-test' ) ;
9
11
const version = require ( '../package.json' ) . version ;
10
- const elmVersion = require ( 'elm/package.json' ) . version ;
12
+ const elmVersion = spawn . sync ( elmExecutable , [ '--version' ] ) . stdout . toString ( ) . trim ( ) ;
11
13
12
14
const commands = argv . _ ;
13
15
@@ -66,8 +68,8 @@ switch (script) {
66
68
}
67
69
} ) ;
68
70
69
- args = args . concat ( [ '--compiler' , require . resolve ( 'elm/bin/elm' ) ] ) ;
70
- const cp = spawn . sync ( require . resolve ( 'elm-test/bin/elm-test' ) , args , {
71
+ args = args . concat ( [ '--compiler' , elmExecutable ] ) ;
72
+ const cp = spawn . sync ( elmTestExecutable , args , {
71
73
stdio : 'inherit'
72
74
} ) ;
73
75
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const path = require('path');
4
4
const fs = require ( 'fs' ) ;
5
5
const url = require ( 'url' ) ;
6
6
const cosmiconfig = require ( 'cosmiconfig' ) ;
7
+ const which = require ( 'which' ) ;
7
8
8
9
// Make sure any symlinks in the project folder are resolved:
9
10
// https://github.com/facebookincubator/create-react-app/issues/637
@@ -76,7 +77,7 @@ module.exports = {
76
77
entry : resolveApp ( './src/index.js' ) ,
77
78
appBuild : resolveApp ( './build' ) ,
78
79
elmJson : resolveApp ( './elm.json' ) ,
79
- elm : require . resolve ( 'elm/bin/elm' ) ,
80
+ elm : which . sync ( 'elm' , { nothrow : true } ) || require . resolve ( 'elm/bin/elm' ) ,
80
81
publicUrl : getPublicUrl ( config ) ,
81
82
servedPath : getServedPath ( config ) ,
82
83
proxy : config . proxy ,
Original file line number Diff line number Diff line change 35
35
"cross-spawn" : " 7.0.3" ,
36
36
"css-loader" : " 4.3.0" ,
37
37
"dotenv" : " 8.2.0" ,
38
- "elm" : " latest-0.19.1" ,
39
38
"elm-asset-webpack-loader" : " 1.1.2" ,
40
39
"elm-hot-webpack-loader" : " 1.1.7" ,
41
- "elm-test" : " latest-0.19.1" ,
42
40
"elm-webpack-loader" : " 6.0.1" ,
43
41
"file-loader" : " 6.2.0" ,
44
42
"fs-extra" : " 6.0.1" ,
65
63
"webpack-dev-server" : " 3.11.0" ,
66
64
"webpack-manifest-plugin" : " 2.2.0" ,
67
65
"whatwg-fetch" : " 3.5.0" ,
66
+ "which" : " ^2.0.2" ,
68
67
"workbox-webpack-plugin" : " 4.3.1"
69
68
},
70
69
"devDependencies" : {
87
86
"shelljs" : " 0.8.3" ,
88
87
"unexpected" : " 12.0.0"
89
88
},
89
+ "peerDependencies" : {
90
+ "elm" : " latest-0.19.1" ,
91
+ "elm-test" : " latest-0.19.1"
92
+ },
90
93
"engines" : {
91
94
"node" : " >=8.0.0"
92
95
},
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ const chalk = require('chalk');
7
7
const spawn = require ( 'cross-spawn' ) ;
8
8
const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
9
9
const commands = argv . _ ;
10
+ const which = require ( 'which' ) ;
11
+ const elmExecutable = which . sync ( 'elm' , { nothrow : true } ) || require . resolve ( 'elm/bin/elm' ) ;
10
12
11
13
const isWindows = process . platform === 'win32' ;
12
14
@@ -44,7 +46,7 @@ function createElmApp(name) {
44
46
45
47
// Run initial `elm make`
46
48
const spawnElmPkgResult = spawn . sync (
47
- path . resolve ( __dirname , '../node_modules/.bin/elm' ) ,
49
+ elmExecutable ,
48
50
// Run elm-make to install the dependencies.
49
51
[ 'make' , 'src/Main.elm' , '--output=/dev/null' ] ,
50
52
{ stdio : 'inherit' , cwd : appRoot }
You can’t perform that action at this time.
0 commit comments