File tree Expand file tree Collapse file tree 4 files changed +27
-7
lines changed Expand file tree Collapse file tree 4 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 1
1
import * as fs from "fs" ;
2
2
import * as path from "path" ;
3
+ import * as semver from "semver" ;
3
4
4
5
import { ChildProcess , fork } from "child_process" ;
5
6
import deepmerge from "deepmerge" ;
@@ -40,6 +41,18 @@ export async function compile(
40
41
) ;
41
42
}
42
43
44
+ if ( compileConfig . useMain === null || compileConfig . useMain === undefined ) {
45
+ try {
46
+ const packageJson = JSON . parse (
47
+ fs . readFileSync ( `${ compileConfig . projectDir } /package.json` , "utf8" )
48
+ ) ;
49
+ const dataformCoreVersion = packageJson . dependencies [ "@dataform/core" ] ;
50
+ compileConfig . useMain = semver . subset ( dataformCoreVersion , ">=2.0.4" ) ;
51
+ } catch ( e ) {
52
+ // Silently catch any thrown Error. Do not attempt to use `main` compilation.
53
+ }
54
+ }
55
+
43
56
const result = await CompileChildProcess . forkProcess ( ) . compile ( compileConfig ) ;
44
57
45
58
if ( compileConfig . useMain ) {
Original file line number Diff line number Diff line change 43
43
"@types/readline-sync" : " ^1.4.3" ,
44
44
"@types/request" : " ^2.48.3" ,
45
45
"@types/rimraf" : " ^2.0.2" ,
46
- "@types/semver" : " ^6.2.0 " ,
46
+ "@types/semver" : " ^7.3.13 " ,
47
47
"@types/ssh2" : " ^0.5.43" ,
48
48
"@types/stack-trace" : " ^0.0.29" ,
49
49
"@types/swagger-schema-official" : " ^2.0.20" ,
118
118
"rimraf" : " ^2.6.2" ,
119
119
"rollup" : " ^2.7.3" ,
120
120
"rollup-plugin-dts" : " ^1.4.0" ,
121
- "semver" : " ^7.1.2 " ,
121
+ "semver" : " ^7.3.8 " ,
122
122
"snowflake-sdk" : " ^1.6.12" ,
123
123
"source-map-loader" : " ^0.2.0" ,
124
124
"sql-formatter" : " ^2.3.3" ,
Original file line number Diff line number Diff line change 1
1
# NOTE: If you change the format of this line, you must change the bash command
2
2
# in /scripts/publish to extract the version string correctly.
3
- DF_VERSION = "2.0.3 "
3
+ DF_VERSION = "2.0.4 "
Original file line number Diff line number Diff line change 1170
1170
"@types/glob" "*"
1171
1171
"@types/node" "*"
1172
1172
1173
- "@types/semver@^6.2.0 ":
1174
- version "6.2.0 "
1175
- resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.2.0 .tgz#d688d574400d96c5b0114968705366f431831e1a "
1176
- integrity "sha1-1ojVdEANlsWwEUlocFNm9DGDHho= sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA=="
1173
+ "@types/semver@^7.3.13 ":
1174
+ version "7.3.13 "
1175
+ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13 .tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91 "
1176
+ integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==
1177
1177
1178
1178
"@types/serve-static@*":
1179
1179
version "1.13.3"
@@ -9680,6 +9680,13 @@ semver@^7.3.2:
9680
9680
dependencies:
9681
9681
lru-cache "^6.0.0"
9682
9682
9683
+ semver@^7.3.8:
9684
+ version "7.3.8"
9685
+ resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
9686
+ integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
9687
+ dependencies:
9688
+ lru-cache "^6.0.0"
9689
+
9683
9690
send@0.17.1:
9684
9691
version "0.17.1"
9685
9692
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
You can’t perform that action at this time.
0 commit comments