File tree Expand file tree Collapse file tree 6 files changed +30
-15
lines changed Expand file tree Collapse file tree 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
22
33platform :
44 - x64
@@ -23,8 +23,13 @@ skip_commits:
2323 - ' **/*.md'
2424
2525test_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');
66const spawn = require ( 'cross-spawn' ) ;
77const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
88const 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 ( ) ;
1012const commands = argv . _ ;
1113
1214if ( commands . length === 0 ) {
Original file line number Diff line number Diff line change 55const path = require ( 'path' ) ;
66const spawn = require ( 'cross-spawn' ) ;
77const 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' ) ;
911const version = require ( '../package.json' ) . version ;
10- const elmVersion = require ( 'elm/package.json' ) . version ;
12+ const elmVersion = spawn . sync ( elmExecutable , [ '--version' ] ) . stdout . toString ( ) . trim ( ) ;
1113
1214const commands = argv . _ ;
1315
@@ -66,8 +68,8 @@ switch (script) {
6668 }
6769 } ) ;
6870
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 , {
7173 stdio : 'inherit'
7274 } ) ;
7375
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const path = require('path');
44const fs = require ( 'fs' ) ;
55const url = require ( 'url' ) ;
66const cosmiconfig = require ( 'cosmiconfig' ) ;
7+ const which = require ( 'which' ) ;
78
89// Make sure any symlinks in the project folder are resolved:
910// https://github.com/facebookincubator/create-react-app/issues/637
@@ -76,7 +77,7 @@ module.exports = {
7677 entry : resolveApp ( './src/index.js' ) ,
7778 appBuild : resolveApp ( './build' ) ,
7879 elmJson : resolveApp ( './elm.json' ) ,
79- elm : require . resolve ( 'elm/bin/elm' ) ,
80+ elm : which . sync ( 'elm' , { nothrow : true } ) || require . resolve ( 'elm/bin/elm' ) ,
8081 publicUrl : getPublicUrl ( config ) ,
8182 servedPath : getServedPath ( config ) ,
8283 proxy : config . proxy ,
Original file line number Diff line number Diff line change 3535 "cross-spawn" : " 7.0.3" ,
3636 "css-loader" : " 4.3.0" ,
3737 "dotenv" : " 8.2.0" ,
38- "elm" : " latest-0.19.1" ,
3938 "elm-asset-webpack-loader" : " 1.1.2" ,
4039 "elm-hot-webpack-loader" : " 1.1.7" ,
41- "elm-test" : " latest-0.19.1" ,
4240 "elm-webpack-loader" : " 6.0.1" ,
4341 "file-loader" : " 6.2.0" ,
4442 "fs-extra" : " 6.0.1" ,
6563 "webpack-dev-server" : " 3.11.0" ,
6664 "webpack-manifest-plugin" : " 2.2.0" ,
6765 "whatwg-fetch" : " 3.5.0" ,
66+ "which" : " ^2.0.2" ,
6867 "workbox-webpack-plugin" : " 4.3.1"
6968 },
7069 "devDependencies" : {
8786 "shelljs" : " 0.8.3" ,
8887 "unexpected" : " 12.0.0"
8988 },
89+ "peerDependencies" : {
90+ "elm" : " latest-0.19.1" ,
91+ "elm-test" : " latest-0.19.1"
92+ },
9093 "engines" : {
9194 "node" : " >=8.0.0"
9295 },
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ const chalk = require('chalk');
77const spawn = require ( 'cross-spawn' ) ;
88const argv = require ( 'minimist' ) ( process . argv . slice ( 2 ) ) ;
99const commands = argv . _ ;
10+ const which = require ( 'which' ) ;
11+ const elmExecutable = which . sync ( 'elm' , { nothrow : true } ) || require . resolve ( 'elm/bin/elm' ) ;
1012
1113const isWindows = process . platform === 'win32' ;
1214
@@ -44,7 +46,7 @@ function createElmApp(name) {
4446
4547 // Run initial `elm make`
4648 const spawnElmPkgResult = spawn . sync (
47- path . resolve ( __dirname , '../node_modules/.bin/elm' ) ,
49+ elmExecutable ,
4850 // Run elm-make to install the dependencies.
4951 [ 'make' , 'src/Main.elm' , '--output=/dev/null' ] ,
5052 { stdio : 'inherit' , cwd : appRoot }
You can’t perform that action at this time.
0 commit comments