@danielx/civet 0.6.63 → 0.6.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esbuild.js CHANGED
@@ -178,6 +178,29 @@ var civetUnplugin = (0, import_unplugin.createUnplugin)((options = {}, meta) =>
178
178
  getFormatHost(ts.sys)
179
179
  )
180
180
  );
181
+ if (options.typecheck) {
182
+ let failures = [];
183
+ if (typeof options.typecheck === "string") {
184
+ if (options.typecheck.includes("error"))
185
+ failures.push(1 /* Error */);
186
+ if (options.typecheck.includes("warning"))
187
+ failures.push(0 /* Warning */);
188
+ if (options.typecheck.includes("suggestion"))
189
+ failures.push(2 /* Suggestion */);
190
+ if (options.typecheck.includes("message"))
191
+ failures.push(3 /* Message */);
192
+ if (options.typecheck.includes("all")) {
193
+ failures = { includes: () => true };
194
+ }
195
+ } else {
196
+ failures.push(1 /* Error */);
197
+ }
198
+ const count = diagnostics.filter((d) => failures.includes(d.category)).length;
199
+ if (count) {
200
+ const reason = count === diagnostics.length ? count : `${count} out of ${diagnostics.length}`;
201
+ throw new Error(`Aborting build because of ${reason} TypeScript diagnostic${diagnostics.length > 1 ? "s" : ""} above`);
202
+ }
203
+ }
181
204
  }
182
205
  if (options.emitDeclaration) {
183
206
  if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
package/dist/rollup.js CHANGED
@@ -178,6 +178,29 @@ var civetUnplugin = (0, import_unplugin.createUnplugin)((options = {}, meta) =>
178
178
  getFormatHost(ts.sys)
179
179
  )
180
180
  );
181
+ if (options.typecheck) {
182
+ let failures = [];
183
+ if (typeof options.typecheck === "string") {
184
+ if (options.typecheck.includes("error"))
185
+ failures.push(1 /* Error */);
186
+ if (options.typecheck.includes("warning"))
187
+ failures.push(0 /* Warning */);
188
+ if (options.typecheck.includes("suggestion"))
189
+ failures.push(2 /* Suggestion */);
190
+ if (options.typecheck.includes("message"))
191
+ failures.push(3 /* Message */);
192
+ if (options.typecheck.includes("all")) {
193
+ failures = { includes: () => true };
194
+ }
195
+ } else {
196
+ failures.push(1 /* Error */);
197
+ }
198
+ const count = diagnostics.filter((d) => failures.includes(d.category)).length;
199
+ if (count) {
200
+ const reason = count === diagnostics.length ? count : `${count} out of ${diagnostics.length}`;
201
+ throw new Error(`Aborting build because of ${reason} TypeScript diagnostic${diagnostics.length > 1 ? "s" : ""} above`);
202
+ }
203
+ }
181
204
  }
182
205
  if (options.emitDeclaration) {
183
206
  if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
@@ -145,6 +145,29 @@ var civetUnplugin = createUnplugin((options = {}, meta) => {
145
145
  getFormatHost(ts.sys)
146
146
  )
147
147
  );
148
+ if (options.typecheck) {
149
+ let failures = [];
150
+ if (typeof options.typecheck === "string") {
151
+ if (options.typecheck.includes("error"))
152
+ failures.push(1 /* Error */);
153
+ if (options.typecheck.includes("warning"))
154
+ failures.push(0 /* Warning */);
155
+ if (options.typecheck.includes("suggestion"))
156
+ failures.push(2 /* Suggestion */);
157
+ if (options.typecheck.includes("message"))
158
+ failures.push(3 /* Message */);
159
+ if (options.typecheck.includes("all")) {
160
+ failures = { includes: () => true };
161
+ }
162
+ } else {
163
+ failures.push(1 /* Error */);
164
+ }
165
+ const count = diagnostics.filter((d) => failures.includes(d.category)).length;
166
+ if (count) {
167
+ const reason = count === diagnostics.length ? count : `${count} out of ${diagnostics.length}`;
168
+ throw new Error(`Aborting build because of ${reason} TypeScript diagnostic${diagnostics.length > 1 ? "s" : ""} above`);
169
+ }
170
+ }
148
171
  }
149
172
  if (options.emitDeclaration) {
150
173
  if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
@@ -6,7 +6,7 @@ type PluginOptions = {
6
6
  outputExtension?: string;
7
7
  transformOutput?: (code: string, id: string) => TransformResult | Promise<TransformResult>;
8
8
  emitDeclaration?: boolean;
9
- typecheck?: boolean;
9
+ typecheck?: boolean | string;
10
10
  ts?: 'civet' | 'esbuild' | 'tsc' | 'preserve';
11
11
  /** @deprecated Use "ts" option instead */
12
12
  js?: boolean;
@@ -6,7 +6,7 @@ type PluginOptions = {
6
6
  outputExtension?: string;
7
7
  transformOutput?: (code: string, id: string) => TransformResult | Promise<TransformResult>;
8
8
  emitDeclaration?: boolean;
9
- typecheck?: boolean;
9
+ typecheck?: boolean | string;
10
10
  ts?: 'civet' | 'esbuild' | 'tsc' | 'preserve';
11
11
  /** @deprecated Use "ts" option instead */
12
12
  js?: boolean;
package/dist/unplugin.js CHANGED
@@ -177,6 +177,29 @@ var civetUnplugin = (0, import_unplugin.createUnplugin)((options = {}, meta) =>
177
177
  getFormatHost(ts.sys)
178
178
  )
179
179
  );
180
+ if (options.typecheck) {
181
+ let failures = [];
182
+ if (typeof options.typecheck === "string") {
183
+ if (options.typecheck.includes("error"))
184
+ failures.push(1 /* Error */);
185
+ if (options.typecheck.includes("warning"))
186
+ failures.push(0 /* Warning */);
187
+ if (options.typecheck.includes("suggestion"))
188
+ failures.push(2 /* Suggestion */);
189
+ if (options.typecheck.includes("message"))
190
+ failures.push(3 /* Message */);
191
+ if (options.typecheck.includes("all")) {
192
+ failures = { includes: () => true };
193
+ }
194
+ } else {
195
+ failures.push(1 /* Error */);
196
+ }
197
+ const count = diagnostics.filter((d) => failures.includes(d.category)).length;
198
+ if (count) {
199
+ const reason = count === diagnostics.length ? count : `${count} out of ${diagnostics.length}`;
200
+ throw new Error(`Aborting build because of ${reason} TypeScript diagnostic${diagnostics.length > 1 ? "s" : ""} above`);
201
+ }
202
+ }
180
203
  }
181
204
  if (options.emitDeclaration) {
182
205
  if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
package/dist/vite.js CHANGED
@@ -178,6 +178,29 @@ var civetUnplugin = (0, import_unplugin.createUnplugin)((options = {}, meta) =>
178
178
  getFormatHost(ts.sys)
179
179
  )
180
180
  );
181
+ if (options.typecheck) {
182
+ let failures = [];
183
+ if (typeof options.typecheck === "string") {
184
+ if (options.typecheck.includes("error"))
185
+ failures.push(1 /* Error */);
186
+ if (options.typecheck.includes("warning"))
187
+ failures.push(0 /* Warning */);
188
+ if (options.typecheck.includes("suggestion"))
189
+ failures.push(2 /* Suggestion */);
190
+ if (options.typecheck.includes("message"))
191
+ failures.push(3 /* Message */);
192
+ if (options.typecheck.includes("all")) {
193
+ failures = { includes: () => true };
194
+ }
195
+ } else {
196
+ failures.push(1 /* Error */);
197
+ }
198
+ const count = diagnostics.filter((d) => failures.includes(d.category)).length;
199
+ if (count) {
200
+ const reason = count === diagnostics.length ? count : `${count} out of ${diagnostics.length}`;
201
+ throw new Error(`Aborting build because of ${reason} TypeScript diagnostic${diagnostics.length > 1 ? "s" : ""} above`);
202
+ }
203
+ }
181
204
  }
182
205
  if (options.emitDeclaration) {
183
206
  if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
package/dist/webpack.js CHANGED
@@ -178,6 +178,29 @@ var civetUnplugin = (0, import_unplugin.createUnplugin)((options = {}, meta) =>
178
178
  getFormatHost(ts.sys)
179
179
  )
180
180
  );
181
+ if (options.typecheck) {
182
+ let failures = [];
183
+ if (typeof options.typecheck === "string") {
184
+ if (options.typecheck.includes("error"))
185
+ failures.push(1 /* Error */);
186
+ if (options.typecheck.includes("warning"))
187
+ failures.push(0 /* Warning */);
188
+ if (options.typecheck.includes("suggestion"))
189
+ failures.push(2 /* Suggestion */);
190
+ if (options.typecheck.includes("message"))
191
+ failures.push(3 /* Message */);
192
+ if (options.typecheck.includes("all")) {
193
+ failures = { includes: () => true };
194
+ }
195
+ } else {
196
+ failures.push(1 /* Error */);
197
+ }
198
+ const count = diagnostics.filter((d) => failures.includes(d.category)).length;
199
+ if (count) {
200
+ const reason = count === diagnostics.length ? count : `${count} out of ${diagnostics.length}`;
201
+ throw new Error(`Aborting build because of ${reason} TypeScript diagnostic${diagnostics.length > 1 ? "s" : ""} above`);
202
+ }
203
+ }
181
204
  }
182
205
  if (options.emitDeclaration) {
183
206
  if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.6.63",
4
+ "version": "0.6.64",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",