-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90104d9
commit c6b939f
Showing
20 changed files
with
3,425 additions
and
891 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.4.66 | ||
2.5.100-beta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// build.js | ||
const esbuild = require("esbuild"); | ||
const alias = require("esbuild-plugin-alias"); | ||
const path = require("path"); | ||
|
||
const baseSettings = { | ||
entryPoints: ["src/index.ts"], // Your entry file | ||
bundle: true, | ||
outdir: "public/cjs", // Output dir | ||
format: "cjs", // or "esm" depending on your module system | ||
target: ["esnext"], // Adjust based on your target environment | ||
tsconfig: "tsconfig.json", // Path to your tsconfig.json, | ||
globalName: "global", | ||
minify:false, | ||
keepNames: true, | ||
sourcemap: true, | ||
splitting: false, | ||
chunkNames: "chunks/[name]-[hash]", | ||
plugins: [ | ||
alias({ | ||
"types": path.join(__dirname, "src/types/global/index.d.ts") | ||
}) | ||
], | ||
external: ["os", "path", "http", "url", | ||
"child_process", "events", "fs", "process", | ||
"node:fs", "node:os", "node:child_process", | ||
"node:path", "readline", "node:net", "node:repl", | ||
"node:vm", "http2", "vm", "qcobjects", "qcobjects-sdk" | ||
] | ||
|
||
}; | ||
|
||
const cjsSettings = {...baseSettings, | ||
entryPoints: ["src/index.ts"], // Your entry file | ||
outdir: "public/cjs", // Output dir | ||
format: "cjs", // or "esm" depending on your module system | ||
platform: "node", // or "browser" depending on your target environment | ||
outExtension: { | ||
".js":".cjs" | ||
} | ||
|
||
}; | ||
|
||
const esmSettings = {...baseSettings, | ||
entryPoints: ["src/index.ts"], // Your entry file | ||
outdir: "public/esm", // Output dir | ||
format: "esm", // or "esm" depending on your module system | ||
platform: "browser", // or "browser" depending on your target environment | ||
outExtension: { | ||
".js":".mjs" | ||
} | ||
|
||
}; | ||
|
||
const browserSettings = {...baseSettings, | ||
entryPoints: ["src/index.ts"], // Your entry file | ||
bundle: true, | ||
outdir: "public/browser", // Output dir | ||
format: "iife", // or "esm" depending on your module system | ||
platform: "browser", // or "browser" depending on your target environment | ||
outExtension: { | ||
".js":".js" | ||
} | ||
}; | ||
|
||
const logError = (e) => {console.log(e);process.exit(1);}; | ||
|
||
esbuild.build(cjsSettings).catch(logError); | ||
esbuild.build(esmSettings).catch(logError); | ||
esbuild.build(browserSettings).catch(logError); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
import * as parser from '@typescript-eslint/parser'; | ||
|
||
|
||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [ | ||
{ languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
Atomics: "readonly", | ||
SharedArrayBuffer: "readonly", | ||
}, | ||
|
||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
parserOptions: { | ||
projectService: true, | ||
tsconfigRootDir: import.meta.dirname, | ||
programs: [parser.createProgram('tsconfig.json')], | ||
} | ||
, | ||
|
||
} }, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
...tseslint.configs.recommendedTypeChecked, | ||
{ files: ["**/*.{js,mjs,cjs,ts}"] } | ||
,{ | ||
ignores: [ | ||
"**/*.js", | ||
"spec/**/*", | ||
"src/*.js", | ||
"src/**/*.js", | ||
"node_modules/**/*", | ||
"**/node_modules" | ||
], | ||
}, ...compat.extends("eslint:recommended"), | ||
{ rules: { | ||
semi: ["error", "always"], | ||
quotes: ["error", "double"], | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-this-alias": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/ban-types": "off", | ||
"array-callback-return": "warn", | ||
"no-useless-call": "off", | ||
camelcase: "off", | ||
"no-var": "off", | ||
}}, | ||
{ | ||
files: ["**/*.ts", "**/*.d.ts", "**/*.d.tsx", "**/*.tsx"] | ||
}, | ||
{ files: ["**/*.d.ts"], | ||
rules: { | ||
"no-unused-vars":"off" | ||
} | ||
}, | ||
{ | ||
files: ["**/*.ts", "**/*.d.ts"], | ||
rules: { | ||
"no-dupe-class-members":"off", | ||
"@typescript-eslint/no-unsafe-function-type":"off", | ||
"no-redeclare": "off", | ||
"@typescript-eslint/no-unsafe-member-access":"off", | ||
"@typescript-eslint/no-unsafe-assignment":"off", | ||
"@typescript-eslint/no-unsafe-call":"off", | ||
"@typescript-eslint/no-unsafe-argument":"off" | ||
|
||
} | ||
} | ||
]; |
Oops, something went wrong.