@@ -32,38 +32,11 @@ TS_SOURCES = glob(["src/**/*.ts"])
3232TEST_SOURCES = glob (["tests/**/*.ts" ])
3333
3434ts_project (
35- name = "dist_cjs " ,
35+ name = "dist " ,
3636 srcs = TS_SOURCES ,
3737 declaration = True ,
3838 declaration_map = True ,
39- out_dir = "dist/cjs" ,
40- root_dir = "src" ,
41- source_map = True ,
42- transpiler = "tsc" ,
43- tsc = ":tsc" ,
44- tsconfig = {
45- "compilerOptions" : dict (
46- BASE_COMPILER_OPTIONS ,
47- declaration = True ,
48- declarationMap = True ,
49- module = "Node16" ,
50- moduleResolution = "Node16" ,
51- noEmit = False ,
52- outDir = "dist/cjs" ,
53- rootDir = "src" ,
54- sourceMap = True ,
55- types = ["node" ],
56- ),
57- },
58- deps = [":node_modules/@types/node" ],
59- )
60-
61- ts_project (
62- name = "dist_esm" ,
63- srcs = TS_SOURCES ,
64- declaration = True ,
65- declaration_map = True ,
66- out_dir = "dist/esm" ,
39+ out_dir = "dist" ,
6740 root_dir = "src" ,
6841 source_map = True ,
6942 transpiler = "tsc" ,
@@ -76,7 +49,7 @@ ts_project(
7649 module = "ESNext" ,
7750 moduleResolution = "Bundler" ,
7851 noEmit = False ,
79- outDir = "dist/esm " ,
52+ outDir = "dist" ,
8053 rootDir = "src" ,
8154 sourceMap = True ,
8255 types = ["node" ],
@@ -91,21 +64,13 @@ npm_package(
9164 "CHANGELOG.md" ,
9265 "LICENSE" ,
9366 "README.md" ,
94- ":dist_cjs" ,
95- ":dist_esm" ,
67+ ":dist" ,
9668 "//npm:package" ,
97- "//npm:index.d.cts" ,
98- "//npm:index.js" ,
99- ] + TS_SOURCES + [
100- "esm/package.json" ,
101- ],
69+ ] + TS_SOURCES ,
10270 out = "package" ,
10371 package = "@perplexity-ai/perplexity_ai" ,
10472 publishable = True ,
10573 replace_prefixes = {
106- "esm" : "dist/esm" ,
107- "npm/index.d.cts" : "dist/index.d.cts" ,
108- "npm/index.js" : "dist/index.js" ,
10974 "npm/package.json" : "package.json" ,
11075 },
11176)
@@ -126,8 +91,8 @@ ts_project(
12691 tsconfig = {
12792 "compilerOptions" : dict (
12893 BASE_COMPILER_OPTIONS ,
129- module = "Node16 " ,
130- moduleResolution = "Node16 " ,
94+ module = "ESNext " ,
95+ moduleResolution = "Bundler " ,
13196 noEmit = False ,
13297 outDir = "test-dist" ,
13398 rootDir = "tests" ,
@@ -166,9 +131,19 @@ FORMAT_SOURCES = glob(
166131 "tests/**/*.ts" ,
167132 "*.json" ,
168133 "*.md" ,
134+ "*.mjs" ,
169135 "*.yml" ,
170136 ],
171137 allow_empty = True ,
138+ exclude = ["src/generated/**" ],
139+ )
140+
141+ LINT_SOURCES = glob (
142+ [
143+ "src/**/*.ts" ,
144+ "tests/**/*.ts" ,
145+ ],
146+ exclude = ["src/generated/**" ],
172147)
173148
174149oxfmt_bin .oxfmt_test (
@@ -188,10 +163,10 @@ oxlint_bin.oxlint_test(
188163 name = "oxlint" ,
189164 args = [
190165 "--config=$(rootpath :.oxlintrc.json)" ,
191- ] + TS_SOURCES + TEST_SOURCES ,
166+ ] + LINT_SOURCES ,
192167 data = [
193168 ".oxlintrc.json" ,
194- ] + TS_SOURCES + TEST_SOURCES ,
169+ ] + LINT_SOURCES ,
195170)
196171
197172publint_bin .publint_test (
@@ -211,7 +186,6 @@ attw_bin.attw_test(
211186 "--pack" ,
212187 "--ignore-rules" ,
213188 "cjs-resolves-to-esm" ,
214- "missing-export-equals" ,
215189 "internal-resolution-error" ,
216190 ],
217191 data = [":pkg" ],
0 commit comments