change to use esm

This commit is contained in:
wancat committed 2024-01-30 09:06:41 +08:00
1 parent eb231e4056
commit 78966d351f
10 files changed
+47 -17

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@
"app": "yarn workspace app dev",
"app:local": "yarn workspace app dev:local",
"build": "yarn workspace app build",
"build:watch": "concurrently -n app,server,file-graph,utils -c blue,green,yellow,cyan \"tsc -w -p app\" \"tsc -w -p server\", \"tsc -w -p packages/file-graph\", \"tsc -w -p packages/utils\"",
"build:watch": "concurrently -n server,file-graph,utils,models,constants -c blue,green,yellow,cyan,red \"tsc -w -p server\" \"tsc -w -p packages/file-graph\" \"tsc -w -p packages/utils\" \"tsc -w -p packages/models\" \"tsc -w -p packages/constants\"",
"server": "yarn workspace server dev",
"cli": "yarn workspace client start",
"lint": "eslint .",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@linux-odyssey/constants",
"type": "commonjs",
"type": "module",
"version": "1.0.0",
"private": true,
"main": "dist/index.js",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@linux-odyssey/file-graph",
"version": "1.0.0",
"type": "commonjs",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
+1 -1
View File
@@ -1,5 +1,5 @@
/* eslint-disable lines-between-class-members */
import { basename } from './utils'
import { basename } from './utils.js'
interface FileObject {
path: string
+2 -2
View File
@@ -1,9 +1,9 @@
import File from './file'
import File from './file.js'
import {
DuplicateItemError,
ParentNotExistsError,
FileNotExistsError,
} from './errors'
} from './errors.js'
import { basename, dirname } from './utils.js'
export default class FileNode extends File {
+1 -1
View File
@@ -1,3 +1,3 @@
export { default as File } from './file'
export { default as File } from './file.js'
export { default as FileNode } from './fileNode.js'
export { default as FileGraph } from './fileGraph.js'
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@linux-odyssey/models",
"type": "commonjs",
"type": "module",
"version": "1.0.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "@linux-odyssey/utils",
"version": "1.0.0",
"main": "dist/index.js",
"type": "commonjs",
"type": "module",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "server",
"version": "0.0.0",
"description": "Linux Odyssey Server",
"type": "commonjs",
"type": "module",
"scripts": {
"start": "node dist/index.js",
"dev": "nodemon",
+37 -7
View File
@@ -1,12 +1,42 @@
{
// "compilerOptions": {
// "target": "ESNext",
// "module": "ESNext",
// "moduleResolution": "Bundler",
// "strict": true,
// "moduleDetection": "force",
// "skipLibCheck": true,
// "esModuleInterop": true,
// "declaration": true,
// "sourceMap": true,
// "allowJs": true,
// "resolveJsonModule": true,
// "isolatedModules": true,
// "lib": ["ESNext"]
// }
// "compilerOptions": {
// "esModuleInterop": true,
// "skipLibCheck": true,
// "target": "ESNext",
// "resolveJsonModule": true,
// "isolatedModules": true,
// "moduleDetection": "force",
// "strict": false,
// "noUncheckedIndexedAccess": true,
// "moduleResolution": "NodeNext",
// "module": "NodeNext",
// "noEmit": true,
// "lib": ["es2022", "dom", "dom.iterable"]
// }
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"moduleResolution": "node",
"target": "ESNext", // 要編譯成的 JS 目標版本
"module": "NodeNext", // 要編譯成的 module
"moduleResolution": "NodeNext", // module 解析方式, default "classic"
"esModuleInterop": true, // module 兼容, 會影響 build 方式
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"esModuleInterop": true,
"declaration": true,
"sourceMap": true,
"allowJs": true
"skipLibCheck": true,
"outDir": "dist"
}
}