Skip to content

Commit a255aff

Browse files
committed
nodenext
1 parent 811fef8 commit a255aff

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"description": "modified sample plugin",
55
"main": "main.js",
66
"type": "module",
7+
"overrides": {
8+
"esbuild": "$esbuild"
9+
},
710
"scripts": {
811
"start": "yarn install && yarn dev",
912
"dev": "tsx scripts/esbuild.config.ts",

scripts/acp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { execSync } from "child_process";
22
import { askQuestion,
33
cleanInput,
44
createReadlineInterface,
5-
gitExec } from "./utils";
5+
gitExec } from "./utils.ts";
66

77
const rl = createReadlineInterface();
88

scripts/esbuild.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ async function createBuildContext(buildPath: string, isProd: boolean, entryPoint
7474
bundle: true,
7575
external: EXTERNAL_DEPS,
7676
format: "cjs",
77-
target: "es2021",
77+
target: "esNext",
78+
platform: "node",
7879
logLevel: "info",
7980
sourcemap: isProd ? false : "inline",
8081
treeShaking: true,

scripts/release.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { writeFile,
33
import { execSync } from "child_process";
44
import dedent from "dedent";
55
import { askQuestion,
6-
createReadlineInterface } from "./utils";
6+
createReadlineInterface } from "./utils.ts";
77

88
const rl = createReadlineInterface();
99

@@ -68,7 +68,7 @@ async function doNextSteps(message: string, tag: string): Promise<void> {
6868
execSync(`git add ${body}`);
6969
execSync("git commit -m \"update tag description\"");
7070
execSync("git push");
71-
} catch (error) {
71+
} catch (error: any) {
7272
console.error("Error:", error.message);
7373
}
7474
try {

scripts/update-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readFile, writeFile } from "fs/promises";
22
import dedent from "dedent";
33
import { inc, valid } from "semver";
4-
import { askQuestion, createReadlineInterface, gitExec } from "./utils";
4+
import { askQuestion, createReadlineInterface, gitExec } from "./utils.ts";
55

66
const rl = createReadlineInterface();
77

scripts/utils.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { access,
1+
import {
2+
access,
23
mkdir,
34
copyFile,
4-
rm } from "fs/promises";
5+
rm
6+
} from "fs/promises";
57
import path from "path";
68
import * as readline from "readline";
79
import { execSync } from "child_process";
@@ -47,7 +49,7 @@ export async function copyFilesToTargetDir(buildPath: string): Promise<void> {
4749

4850
try {
4951
await mkdir(buildPath);
50-
} catch (error) {
52+
} catch (error: any) {
5153
if (error.code !== "EEXIST") {
5254
console.error(`Error creating directory: ${error.message}`);
5355
}
@@ -56,7 +58,7 @@ export async function copyFilesToTargetDir(buildPath: string): Promise<void> {
5658
// Copy manifest
5759
try {
5860
await copyFile("./manifest.json", manifestDest);
59-
} catch (error) {
61+
} catch (error: any) {
6062
console.error(`Error copying manifest: ${error.message}`);
6163
}
6264

@@ -75,15 +77,15 @@ export async function copyFilesToTargetDir(buildPath: string): Promise<void> {
7577
} else {
7678
return;
7779
}
78-
} catch (error) {
80+
} catch (error: any) {
7981
console.error(`Error copying CSS: ${error.message}`);
8082
}
8183
}
8284

8385
export function gitExec(command: string): void {
8486
try {
8587
execSync(command, { stdio: "inherit" });
86-
} catch (error) {
88+
} catch (error: any) {
8789
console.error(`Error executing '${command}':`, error.message);
8890
throw error;
8991
}

tsconfig.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,32 @@
22
"compilerOptions": {
33
"strict": true,
44
"strictPropertyInitialization": false,
5-
"allowArbitraryExtensions": true,
65
"allowImportingTsExtensions": true,
76
"allowJs": true,
87
"allowSyntheticDefaultImports": true,
98
"forceConsistentCasingInFileNames": true,
109
"importHelpers": true,
1110
"inlineSourceMap": true,
1211
"inlineSources": true,
13-
"sourceMap": false,
1412
"lib": [
1513
"DOM",
1614
"ES2023"
1715
],
1816
"isolatedModules": true,
19-
"module": "ESNext",
20-
"moduleResolution": "Bundler",
17+
"module": "NodeNext",
18+
"moduleResolution": "nodenext",
19+
"resolveJsonModule" : true,
2120
"noEmit": true,
2221
"skipLibCheck": false,
23-
"target": "ES2023",
22+
"target": "ESNext",
2423
"types": [
2524
"node",
2625
"obsidian-typings"
2726
],
2827
"verbatimModuleSyntax": true,
29-
"esModuleInterop": true,
30-
"resolveJsonModule": true
3128
},
3229
"include": [
3330
"./src/**/*.ts",
34-
"./scripts/**/*.ts",
35-
"*.ts"
31+
"./scripts/**/*.ts"
3632
]
3733
}

0 commit comments

Comments
 (0)