Skip to content

Commit c4e71f0

Browse files
committed
revert everything except the getDntVersion JSR fix
1 parent 8928e09 commit c4e71f0

5 files changed

Lines changed: 5 additions & 30 deletions

File tree

deno.jsonc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
"rules": {
1414
"exclude": [
1515
"no-explicit-any",
16-
"camelcase",
17-
"no-import-prefix",
18-
"no-unversioned-import"
16+
"camelcase"
1917
]
2018
}
2119
},

lib/package_json.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export interface GetPackageJsonOptions {
1515
includeTsLib: boolean | undefined;
1616
testEnabled: boolean | undefined;
1717
shims: ShimOptions;
18-
testColor?: boolean;
19-
testRunner?: boolean;
2018
}
2119

2220
export function getPackageJson({
@@ -29,8 +27,6 @@ export function getPackageJson({
2927
includeTsLib,
3028
testEnabled,
3129
shims,
32-
testColor = true,
33-
testRunner = true,
3430
}: GetPackageJsonOptions): Record<string, unknown> {
3531
const finalEntryPoints = transformOutput
3632
.main.entryPoints.map((e, i) => ({
@@ -69,7 +65,7 @@ export function getPackageJson({
6965
};
7066
const testDevDependencies = testEnabled
7167
? ({
72-
...(testColor && !Object.keys(dependencies).includes("picocolors")
68+
...(!Object.keys(dependencies).includes("picocolors")
7369
? {
7470
"picocolors": "^1.0.0",
7571
}
@@ -92,7 +88,7 @@ export function getPackageJson({
9288
// override with specified dependencies
9389
...(packageJsonObj.devDependencies ?? {}),
9490
};
95-
const scripts = testEnabled && testRunner
91+
const scripts = testEnabled
9692
? ({
9793
test: "node test_runner.js",
9894
// override with specified scripts

lib/shims.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ export interface ShimOptions {
4141
weakRef?: ShimValue;
4242
/** Shim `WebSocket` with the `ws` package (https://www.npmjs.com/package/ws). */
4343
webSocket?: boolean | "dev";
44-
/** Shim `globalThis` with a proxy that provides Deno globals. */
45-
globalThis?: ShimValue;
46-
/** Enable colored test output using picocolors. */
47-
testColor?: boolean;
48-
/** Enable test runner script in package.json. */
49-
testRunner?: boolean;
5044
/** Custom shims to use. */
5145
custom?: Shim[];
5246
/** Custom shims to use only for the test code. */
@@ -60,11 +54,7 @@ export interface DenoShimOptions {
6054
test: boolean | "dev";
6155
}
6256

63-
export function shimOptionsToTransformShims(options: ShimOptions): {
64-
shims: Shim[];
65-
testShims: Shim[];
66-
useGlobalThisShim: boolean;
67-
} {
57+
export function shimOptionsToTransformShims(options: ShimOptions) {
6858
const shims: Shim[] = [];
6959
const testShims: Shim[] = [];
7060

@@ -89,12 +79,9 @@ export function shimOptionsToTransformShims(options: ShimOptions): {
8979
testShims.push(...options.customDev);
9080
}
9181

92-
const useGlobalThisShim = options.globalThis !== false;
93-
9482
return {
9583
shims,
9684
testShims,
97-
useGlobalThisShim,
9885
};
9986

10087
function add(option: boolean | "dev" | undefined, getShim: () => Shim) {

mod.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,6 @@ export async function build(options: BuildOptions): Promise<void> {
549549
includeDeclarations: options.declaration === "separate",
550550
includeTsLib: options.compilerOptions?.importHelpers,
551551
shims: options.shims,
552-
testColor: options.shims.testColor ?? true,
553-
testRunner: options.shims.testRunner ?? true,
554552
});
555553
writeFile(
556554
path.join(options.outDir, "package.json"),
@@ -586,9 +584,7 @@ export async function build(options: BuildOptions): Promise<void> {
586584
}
587585

588586
async function transformEntryPoints(): Promise<TransformOutput> {
589-
const { shims, testShims, useGlobalThisShim } = shimOptionsToTransformShims(
590-
options.shims,
591-
);
587+
const { shims, testShims } = shimOptionsToTransformShims(options.shims);
592588
return transform({
593589
entryPoints: entryPoints.map((e) => e.path),
594590
testEntryPoints: options.test
@@ -605,7 +601,6 @@ export async function build(options: BuildOptions): Promise<void> {
605601
importMap: options.importMap,
606602
configFile: options.configFile,
607603
cwd: path.toFileUrl(cwd).toString(),
608-
useGlobalThisShim,
609604
});
610605
}
611606

transform.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export interface TransformOptions {
7676
importMap?: string;
7777
configFile?: string;
7878
cwd: string;
79-
useGlobalThisShim?: boolean;
8079
}
8180

8281
/** Dependency in a package.json file. */

0 commit comments

Comments
 (0)