File tree 4 files changed +48
-2
lines changed
4 files changed +48
-2
lines changed Original file line number Diff line number Diff line change 32
32
strategy :
33
33
fail-fast : false
34
34
matrix :
35
- node-version : [18.x, 20.x, 22.x]
35
+ node-version : [18.x, 20.x, 22.x, 23.x ]
36
36
os : [ubuntu-latest, windows-latest, macOS-latest]
37
37
38
38
steps :
57
57
run : |
58
58
npm run test:unit
59
59
60
+ - name : ECMAScript module test
61
+ run : |
62
+ npm run test:esm
63
+
60
64
license :
61
65
name : License check
62
66
runs-on : ubuntu-latest
@@ -111,6 +115,10 @@ jobs:
111
115
run : |
112
116
bun run test:unit-bun
113
117
118
+ - name : ECMAScript module test
119
+ run : |
120
+ bun run test:esm
121
+
114
122
auto-approve :
115
123
name : Auto-approve
116
124
needs : [test, license]
Original file line number Diff line number Diff line change 6
6
"main" : " ./index.js" ,
7
7
"types" : " index.d.ts" ,
8
8
"exports" : {
9
- "require" : " ./index.js"
9
+ "require" : " ./index.js" ,
10
+ "import" : " ./index.js" ,
11
+ "types" : " ./index.d.ts"
10
12
},
11
13
"scripts" : {
12
14
"test" : " npm run build && npm run lint && tap" ,
13
15
"test:unit" : " npm run build && tap" ,
14
16
"test:unit-bun" : " bun run build && bunx tap" ,
17
+ "test:esm" : " npm run build && cd test/esm/ && npm install && node test-import.mjs" ,
15
18
"test:coverage-100" : " npm run build && tap --coverage --100" ,
16
19
"test:coverage-report" : " npm run build && tap --coverage && nyc report --reporter=text-lcov > coverage.lcov" ,
17
20
"test:coverage-ui" : " npm run build && tap --coverage --coverage-report=html" ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " esm" ,
3
+ "version" : " 1.0.0" ,
4
+ "dependencies" : {
5
+ "@elastic/elasticsearch" : " file:../.."
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Licensed to Elasticsearch B.V. under one or more contributor
3
+ * license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright
5
+ * ownership. Elasticsearch B.V. licenses this file to you under
6
+ * the Apache License, Version 2.0 (the "License"); you may
7
+ * not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ import { Client } from '@elastic/elasticsearch'
21
+
22
+ new Client ( {
23
+ node : 'http://localhost:9200' ,
24
+ auth : {
25
+ username : 'elastic' ,
26
+ password : 'changeme' ,
27
+ }
28
+ } )
You can’t perform that action at this time.
0 commit comments