@@ -9,59 +9,39 @@ const { spawnProcess } = require("./utils/spawn-process");
9
9
10
10
const root = path . join ( __dirname , ".." ) ;
11
11
12
- const testProjectDir = path . join (
13
- root ,
14
- "smithy-typescript-codegen-test" ,
15
- ) ;
12
+ const testProjectDir = path . join ( root , "smithy-typescript-codegen-test" ) ;
16
13
17
- const codegenTestDir = path . join (
18
- testProjectDir ,
19
- "build" ,
20
- "smithyprojections" ,
21
- "smithy-typescript-codegen-test" ,
22
- ) ;
14
+ const codegenTestDir = path . join ( testProjectDir , "build" , "smithyprojections" , "smithy-typescript-codegen-test" ) ;
23
15
24
- const weatherClientDir = path . join (
25
- codegenTestDir ,
26
- "source" ,
27
- "typescript-client-codegen"
28
- ) ;
16
+ const weatherClientDir = path . join ( codegenTestDir , "source" , "typescript-client-codegen" ) ;
29
17
30
18
const releasedClientDir = path . join (
31
- testProjectDir ,
32
- "released-version-test" ,
33
- "build" ,
34
- "smithyprojections" ,
35
- "released-version-test" ,
36
- "source" ,
37
- "typescript-codegen"
19
+ testProjectDir ,
20
+ "released-version-test" ,
21
+ "build" ,
22
+ "smithyprojections" ,
23
+ "released-version-test" ,
24
+ "source" ,
25
+ "typescript-codegen"
38
26
) ;
39
27
40
28
// Build generic legacy auth client for integration tests
41
- const weatherLegacyAuthClientDir = path . join (
42
- codegenTestDir ,
43
- "client-legacy-auth" ,
44
- "typescript-client-codegen"
45
- ) ;
29
+ const weatherLegacyAuthClientDir = path . join ( codegenTestDir , "client-legacy-auth" , "typescript-client-codegen" ) ;
46
30
47
- const weatherSsdkDir = path . join (
48
- codegenTestDir ,
49
- "ssdk-test" ,
50
- "typescript-server-codegen"
51
- )
31
+ const weatherSsdkDir = path . join ( codegenTestDir , "ssdk-test" , "typescript-server-codegen" ) ;
52
32
53
33
// Build `@httpApiKeyAuth` client for integration tests
54
34
const httpApiKeyAuthClientDir = path . join (
55
- codegenTestDir ,
56
- "identity-and-auth-http-api-key-auth" ,
57
- "typescript-client-codegen"
35
+ codegenTestDir ,
36
+ "identity-and-auth-http-api-key-auth" ,
37
+ "typescript-client-codegen"
58
38
) ;
59
39
60
40
// Build `@httpBearerAuth` client for integration tests
61
41
const httpBearerAuthClientDir = path . join (
62
- codegenTestDir ,
63
- "identity-and-auth-http-bearer-auth" ,
64
- "typescript-client-codegen"
42
+ codegenTestDir ,
43
+ "identity-and-auth-http-bearer-auth" ,
44
+ "typescript-client-codegen"
65
45
) ;
66
46
67
47
const nodeModulesDir = path . join ( root , "node_modules" ) ;
@@ -82,10 +62,14 @@ const buildAndCopyToNodeModules = async (packageName, codegenDir, nodeModulesDir
82
62
await spawnProcess ( "rm" , [ "-rf" , packageName ] , { cwd : nodeModulesDir } ) ;
83
63
await spawnProcess ( "mkdir" , [ "-p" , packageName ] , { cwd : nodeModulesDir } ) ;
84
64
const targetPackageDir = path . join ( nodeModulesDir , packageName ) ;
85
- await spawnProcess ( "tar" , [ "-xf" , "package.tgz" , "-C" , targetPackageDir , "--strip-components" , "1" ] , { cwd : codegenDir } ) ;
65
+ await spawnProcess ( "tar" , [ "-xf" , "package.tgz" , "-C" , targetPackageDir , "--strip-components" , "1" ] , {
66
+ cwd : codegenDir ,
67
+ } ) ;
86
68
}
87
69
} catch ( e ) {
88
- console . log ( `Building and copying package \`${ packageName } \` in \`${ codegenDir } \` to \`${ nodeModulesDir } \` failed:` )
70
+ console . log (
71
+ `Building and copying package \`${ packageName } \` in \`${ codegenDir } \` to \`${ nodeModulesDir } \` failed:`
72
+ ) ;
89
73
console . log ( e ) ;
90
74
process . exit ( 1 ) ;
91
75
}
@@ -95,8 +79,16 @@ const buildAndCopyToNodeModules = async (packageName, codegenDir, nodeModulesDir
95
79
await buildAndCopyToNodeModules ( "weather" , weatherClientDir , nodeModulesDir ) ;
96
80
await buildAndCopyToNodeModules ( "weather-ssdk" , weatherSsdkDir , nodeModulesDir ) ;
97
81
await buildAndCopyToNodeModules ( "@smithy/weather-legacy-auth" , weatherLegacyAuthClientDir , nodeModulesDir ) ;
98
- await buildAndCopyToNodeModules ( "@smithy/identity-and-auth-http-api-key-auth-service" , httpApiKeyAuthClientDir , nodeModulesDir ) ;
99
- await buildAndCopyToNodeModules ( "@smithy/identity-and-auth-http-bearer-auth-service" , httpBearerAuthClientDir , nodeModulesDir ) ;
100
- // Test released version of smithy-typescript codegenerators, but
101
- await buildAndCopyToNodeModules ( "released" , releasedClientDir , undefined ) ;
82
+ await buildAndCopyToNodeModules (
83
+ "@smithy/identity-and-auth-http-api-key-auth-service" ,
84
+ httpApiKeyAuthClientDir ,
85
+ nodeModulesDir
86
+ ) ;
87
+ await buildAndCopyToNodeModules (
88
+ "@smithy/identity-and-auth-http-bearer-auth-service" ,
89
+ httpBearerAuthClientDir ,
90
+ nodeModulesDir
91
+ ) ;
92
+ // TODO(released-version-test): Test released version of smithy-typescript codegenerators, but currently is not working
93
+ // await buildAndCopyToNodeModules("released", releasedClientDir, undefined);
102
94
} ) ( ) ;
0 commit comments