@prosopo/config 3.3.16 → 3.3.17
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/.turbo/turbo-build$colon$cjs.log +2 -2
- package/.turbo/turbo-build$colon$tsc.log +4 -4
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +6 -0
- package/dist/cjs/vite/TsNoCheckPlugin.cjs +1 -1
- package/dist/vite/NodejsPolarsDirnamePlugin.d.ts +2 -1
- package/dist/vite/NodejsPolarsDirnamePlugin.d.ts.map +1 -1
- package/dist/vite/NodejsPolarsDirnamePlugin.js.map +1 -1
- package/dist/vite/NodejsPolarsNativeFilePlugin.d.ts +3 -2
- package/dist/vite/NodejsPolarsNativeFilePlugin.d.ts.map +1 -1
- package/dist/vite/NodejsPolarsNativeFilePlugin.js.map +1 -1
- package/dist/vite/TsNoCheckPlugin.d.ts +2 -1
- package/dist/vite/TsNoCheckPlugin.d.ts.map +1 -1
- package/dist/vite/TsNoCheckPlugin.js +1 -1
- package/dist/vite/TsNoCheckPlugin.js.map +1 -1
- package/dist/vite/bundleConfigs.test.js +11 -6
- package/dist/vite/bundleConfigs.test.js.map +1 -1
- package/dist/vite/configs.test.js +7 -3
- package/dist/vite/configs.test.js.map +1 -1
- package/dist/vite/plugins.test.js +12 -5
- package/dist/vite/plugins.test.js.map +1 -1
- package/package.json +6 -6
- package/src/vite/NodejsPolarsDirnamePlugin.ts +7 -2
- package/src/vite/NodejsPolarsNativeFilePlugin.ts +10 -4
- package/src/vite/TsNoCheckPlugin.ts +7 -3
- package/src/vite/bundleConfigs.test.ts +17 -6
- package/src/vite/configs.test.ts +11 -3
- package/src/vite/plugins.test.ts +24 -7
- package/tsconfig.tsbuildinfo +1 -1
package/src/vite/configs.test.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import fs from "node:fs";
|
|
16
16
|
import os from "node:os";
|
|
17
17
|
import path from "node:path";
|
|
18
|
+
import type { Rollup } from "vite";
|
|
18
19
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
19
20
|
import { nodejsPolarsDirnamePlugin } from "./NodejsPolarsDirnamePlugin.js";
|
|
20
21
|
import ViteTestConfig from "./vite.test.config.js";
|
|
@@ -22,6 +23,11 @@ import ViteThreadsTestConfig from "./vite.threads.test.config.js";
|
|
|
22
23
|
|
|
23
24
|
const NATIVE_POLARS = "/repo/node_modules/nodejs-polars/bin/native-polars.js";
|
|
24
25
|
|
|
26
|
+
const resolveOptions: Rollup.ResolveIdExtraOptions = {
|
|
27
|
+
isEntry: false,
|
|
28
|
+
kind: "import-statement",
|
|
29
|
+
};
|
|
30
|
+
|
|
25
31
|
let root: string;
|
|
26
32
|
let cwd: string;
|
|
27
33
|
let originalTestType: string | undefined;
|
|
@@ -179,10 +185,12 @@ describe("nodejsPolarsDirnamePlugin", () => {
|
|
|
179
185
|
const plugin = nodejsPolarsDirnamePlugin();
|
|
180
186
|
|
|
181
187
|
it("claims only the native polars entry point", () => {
|
|
182
|
-
expect(plugin.resolveId(NATIVE_POLARS, undefined,
|
|
183
|
-
|
|
188
|
+
expect(plugin.resolveId(NATIVE_POLARS, undefined, resolveOptions)).toBe(
|
|
189
|
+
NATIVE_POLARS,
|
|
190
|
+
);
|
|
191
|
+
expect(plugin.resolveId("zod", undefined, resolveOptions)).toBeNull();
|
|
184
192
|
expect(
|
|
185
|
-
plugin.resolveId("nodejs-polars/bin/other.js", undefined,
|
|
193
|
+
plugin.resolveId("nodejs-polars/bin/other.js", undefined, resolveOptions),
|
|
186
194
|
).toBeNull();
|
|
187
195
|
});
|
|
188
196
|
|
package/src/vite/plugins.test.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import fs from "node:fs";
|
|
16
16
|
import os from "node:os";
|
|
17
17
|
import path from "node:path";
|
|
18
|
+
import type { Rollup } from "vite";
|
|
18
19
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
19
20
|
import { tsNoCheckPlugin } from "./TsNoCheckPlugin.js";
|
|
20
21
|
import VitePluginCopy from "./vite-plugin-copy.js";
|
|
@@ -132,14 +133,25 @@ describe("VitePluginFixAbsoluteImports", () => {
|
|
|
132
133
|
});
|
|
133
134
|
|
|
134
135
|
describe("tsNoCheckPlugin", () => {
|
|
136
|
+
const outputOptions = {} as Rollup.NormalizedOutputOptions;
|
|
137
|
+
|
|
135
138
|
it("prefixes every emitted chunk with a ts-nocheck pragma", () => {
|
|
136
139
|
// Consumers typecheck the bundled output; without this the generated
|
|
137
140
|
// code fails their build.
|
|
138
141
|
const bundle = {
|
|
139
|
-
"index.js": {
|
|
140
|
-
|
|
142
|
+
"index.js": {
|
|
143
|
+
type: "chunk",
|
|
144
|
+
code: "export const a = 1;",
|
|
145
|
+
} as Rollup.OutputChunk,
|
|
146
|
+
"other.js": {
|
|
147
|
+
type: "chunk",
|
|
148
|
+
code: "export const b = 2;",
|
|
149
|
+
} as Rollup.OutputChunk,
|
|
141
150
|
};
|
|
142
|
-
tsNoCheckPlugin().generateBundle(
|
|
151
|
+
tsNoCheckPlugin().generateBundle(
|
|
152
|
+
outputOptions,
|
|
153
|
+
bundle as Rollup.OutputBundle,
|
|
154
|
+
);
|
|
143
155
|
|
|
144
156
|
expect(bundle["index.js"].code).toBe("// @ts-nocheck\nexport const a = 1;");
|
|
145
157
|
expect(bundle["other.js"].code).toBe("// @ts-nocheck\nexport const b = 2;");
|
|
@@ -147,17 +159,22 @@ describe("tsNoCheckPlugin", () => {
|
|
|
147
159
|
|
|
148
160
|
it("leaves assets and empty chunks alone", () => {
|
|
149
161
|
const bundle = {
|
|
150
|
-
"style.css": { type: "asset", source: "body{}" },
|
|
151
|
-
"empty.js": { type: "chunk", code: "" },
|
|
162
|
+
"style.css": { type: "asset", source: "body{}" } as Rollup.OutputAsset,
|
|
163
|
+
"empty.js": { type: "chunk", code: "" } as Rollup.OutputChunk,
|
|
152
164
|
};
|
|
153
|
-
tsNoCheckPlugin().generateBundle(
|
|
165
|
+
tsNoCheckPlugin().generateBundle(
|
|
166
|
+
outputOptions,
|
|
167
|
+
bundle as Rollup.OutputBundle,
|
|
168
|
+
);
|
|
154
169
|
|
|
155
170
|
expect(bundle["style.css"]).toEqual({ type: "asset", source: "body{}" });
|
|
156
171
|
expect(bundle["empty.js"].code).toBe("");
|
|
157
172
|
});
|
|
158
173
|
|
|
159
174
|
it("handles an empty bundle", () => {
|
|
160
|
-
expect(() =>
|
|
175
|
+
expect(() =>
|
|
176
|
+
tsNoCheckPlugin().generateBundle(outputOptions, {}),
|
|
177
|
+
).not.toThrow();
|
|
161
178
|
});
|
|
162
179
|
|
|
163
180
|
it("is named", () => {
|