File tree Expand file tree Collapse file tree 8 files changed +45
-23
lines changed Expand file tree Collapse file tree 8 files changed +45
-23
lines changed Original file line number Diff line number Diff line change 6
6
* .log
7
7
.DS_Store
8
8
yarn.lock
9
- test.js
10
9
! .husky /_ /husky.sh
Original file line number Diff line number Diff line change
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2
+ require ( 'esbuild' ) . buildSync ( {
3
+ entryPoints : [ 'src/index.ts' ] ,
4
+ bundle : true ,
5
+ platform : 'node' ,
6
+ outfile : 'lib/index.js' ,
7
+ } ) ;
Original file line number Diff line number Diff line change
1
+ const ES_PACKAGES_TO_TRANSFORM = [ 'is-image' ] ;
2
+
3
+ /** @type {import("jest").Config } */
4
+ const config = {
5
+ transform : {
6
+ '^.+\\.(t|j)sx?$' : [
7
+ '@swc/jest' ,
8
+ {
9
+ jsc : {
10
+ parser : {
11
+ syntax : 'typescript' ,
12
+ } ,
13
+ } ,
14
+ } ,
15
+ ] ,
16
+ } ,
17
+ transformIgnorePatterns : [
18
+ `node_modules/(?!(${ ES_PACKAGES_TO_TRANSFORM . join ( '|' ) } ))/node_modules/.+\\.js` ,
19
+ ] ,
20
+ } ;
21
+
22
+ module . exports = config ;
Original file line number Diff line number Diff line change 22
22
" bin/tt.tar.gz"
23
23
],
24
24
"scripts" : {
25
- "build" : " rm -rf lib/ && yarn build:types && babel src --out-dir lib --ignore '**/*.test.ts' --extensions '.ts' " ,
25
+ "build" : " rm -rf lib/ && yarn build:types && node esbuild.js " ,
26
26
"build:types" : " tsc --emitDeclarationOnly --declaration --isolatedModules false --declarationDir lib" ,
27
27
"coverage" : " jest --coverage" ,
28
28
"lint" : " yarn lint:ci --fix" ,
40
40
" eslint --fix"
41
41
]
42
42
},
43
- "babel" : {
44
- "extends" : " @shelf/babel-config/backend"
45
- },
46
43
"prettier" : " @shelf/prettier-config" ,
47
44
"dependencies" : {
48
- "is-image" : " 3.1 .0" ,
45
+ "is-image" : " 4.0 .0" ,
49
46
"tar" : " 6.2.0"
50
47
},
51
48
"devDependencies" : {
52
- "@babel/cli" : " 7.23.0" ,
53
- "@babel/core" : " 7.23.2" ,
54
- "@babel/preset-env" : " 7.23.2" ,
55
- "@babel/preset-typescript" : " 7.22.15" ,
56
- "@shelf/babel-config" : " 2.0.2" ,
57
49
"@shelf/eslint-config" : " 3.10.0" ,
58
50
"@shelf/prettier-config" : " 1.0.0" ,
51
+ "@swc/core" : " 1.3.96" ,
52
+ "@swc/jest" : " 0.2.29" ,
59
53
"@types/jest" : " 29.5.8" ,
60
54
"@types/node" : " 18" ,
61
55
"@types/tar" : " 6.1.7" ,
56
+ "esbuild" : " 0.19.5" ,
62
57
"eslint" : " 8.48.0" ,
63
58
"husky" : " 8.0.3" ,
64
59
"jest" : " 29.7.0" ,
Original file line number Diff line number Diff line change
1
+ const { execSync} = require ( 'child_process' ) ;
2
+ const { getTextFromImage} = require ( './lib/index.js' ) ;
3
+
4
+ module . exports = {
5
+ handler ( ) {
6
+ execSync ( `cp ./test.png /tmp/test.png` ) ;
7
+
8
+ return getTextFromImage ( '/tmp/test.png' ) ;
9
+ }
10
+ }
Original file line number Diff line number Diff line change 4
4
tar -xvzf tt.tar.gz
5
5
cd ..
6
6
7
- yarn babel test.ts --out-file test.js
8
-
9
7
(sleep 5; curl -XPOST " http://localhost:9000/2015-03-31/functions/function/invocations" -d ' {"payload":"hello world!"}' ) &
10
8
11
9
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 9
9
"target" : " esnext"
10
10
},
11
11
"exclude" : [" node_modules" ],
12
- "include" : [" src" , " test .ts" ]
12
+ "include" : [" src/index .ts" ]
13
13
}
You can’t perform that action at this time.
0 commit comments