Switch to gts/tsc-multi

This commit is contained in:
Jonathan Staab
2023-09-20 13:52:37 -07:00
parent c8c53559db
commit f89c63d67c
16 changed files with 445 additions and 1734 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
--ignore-dir=dist --ignore-dir=build
--ignore-file=match:yarn.lock --ignore-file=match:yarn.lock
+8
View File
@@ -0,0 +1,8 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
+1
View File
@@ -0,0 +1 @@
build/
-28
View File
@@ -1,28 +0,0 @@
module.exports = {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": ["error", {args: "none"}],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"object-curly-spacing": ["error", "never"],
"array-bracket-spacing": ["error", "never"],
"semi": ["error", "never"],
}
}
+28
View File
@@ -0,0 +1,28 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": ["error", {"args": "none"}],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"object-curly-spacing": ["error", "never"],
"array-bracket-spacing": ["error", "never"],
"semi": ["error", "never"]
}
}
+1 -1
View File
@@ -1,2 +1,2 @@
node_modules node_modules
dist build
+1 -1
View File
@@ -1,2 +1,2 @@
node_modules node_modules
dist build
+4 -2
View File
@@ -1,5 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh" . "$(dirname -- "$0")/_/husky.sh"
npm run build yarn lint
npm run lint yarn clean
yarn build
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
...require('gts/.prettierrc.json')
}
-25
View File
@@ -1,25 +0,0 @@
#!/usr/bin/env node
const {build} = require('esbuild')
const common = {
bundle: true,
entryPoints: ['src/main.ts'],
sourcemap: 'external'
}
build({
...common,
outfile: 'dist/paravel.esm.js',
format: 'esm',
packages: 'external'
})
.then(() => console.log('esm build success.'))
build({
...common,
outfile: 'dist/paravel.cjs',
format: 'cjs',
packages: 'external'
})
.then(() => console.log('cjs build success.'))
+28 -37
View File
@@ -1,54 +1,45 @@
{ {
"name": "paravel", "name": "paravel",
"version": "0.3.3", "version": "0.3.4",
"description": "Yet another toolkit for nostr", "description": "Yet another toolkit for nostr",
"author": "hodlbod",
"license": "MIT",
"keywords": [
"nostr"
],
"type": "module",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/coracle-social/paravel.git" "url": "https://github.com/coracle-social/paravel.git"
}, },
"main": "./dist/paravel.cjs", "types": "./build/src/main.d.ts",
"types": "./dist/src/main.d.ts",
"module": "./dist/paravel.esm.js",
"exports": { "exports": {
"import": "./dist/paravel.esm.js", ".": {
"require": "./dist/paravel.cjs" "import": "./build/src/main.mjs",
"require": "./build/src/main.cjs"
},
"./types": "./build/src/main.d.ts"
}, },
"scripts": { "scripts": {
"build": "tsc && node build.js", "pub": "npm i && npm run lint && tsc-multi && npm publish",
"pub": "npm i && npm run lint && node build.js && npm publish", "build": "tsc-multi",
"lint": "eslint src/* --fix" "clean": "gts clean",
}, "lint": "gts lint",
"keywords": [ "fix": "gts fix",
"nostr" "prepare": "yarn run build",
], "pretest": "yarn run build",
"author": "", "posttest": "yarn run lint"
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.20.7",
"@babel/preset-typescript": "^7.18.6",
"@types/node": "^18.0.3",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"esbuild": "0.16.9",
"esbuild-plugin-alias": "^0.2.1",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-babel": "^5.3.1",
"esm-loader-import-relative-extension": "^1.0.8",
"esm-loader-typescript": "^1.0.3",
"gts": "^5.0.1",
"node-esm-loader": "^0.0.3",
"prettier": "2.8.3",
"tsd": "^0.22.0",
"typescript": "^4.9.4"
}, },
"dependencies": { "dependencies": {
"events": "^3.3.0",
"husky": "^8.0.3",
"isomorphic-ws": "^5.0.0", "isomorphic-ws": "^5.0.0",
"nostr-tools": "^1.15.0", "nostr-tools": "^1.15.0",
"npm-run-all": "^4.1.5",
"ws": "^8.14.2" "ws": "^8.14.2"
},
"devDependencies": {
"@types/node": "20.4.6",
"@types/ws": "^8.5.5",
"gts": "^5.0.1",
"tsc-multi": "^1.1.0",
"typescript": "~5.1.6"
} }
} }
+1 -2
View File
@@ -1,5 +1,4 @@
import type {Event} from 'nostr-tools/lib/event' import type {Event, Filter} from 'nostr-tools'
import type {Filter} from 'nostr-tools/lib/filter'
import type {Connection} from './Connection' import type {Connection} from './Connection'
export type PublishMeta = { export type PublishMeta = {
+1 -2
View File
@@ -1,5 +1,4 @@
import type {Event} from 'nostr-tools/lib/event' import type {Event, Filter} from 'nostr-tools'
import type {Filter} from 'nostr-tools/lib/filter'
import type {Connection} from './Connection' import type {Connection} from './Connection'
import type {Emitter} from './util/Emitter' import type {Emitter} from './util/Emitter'
import type {Message} from './util/Socket' import type {Message} from './util/Socket'
+7
View File
@@ -0,0 +1,7 @@
{
"targets": [
{"extname": ".cjs", "module": "commonjs"},
{"extname": ".mjs", "module": "esnext", "moduleResolution": "node"}
],
"projects": ["tsconfig.json"]
}
+1 -1
View File
@@ -2,7 +2,7 @@
"extends": "./node_modules/gts/tsconfig-google.json", "extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"outDir": "dist", "outDir": "build",
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true "skipLibCheck": true
}, },
+360 -1634
View File
File diff suppressed because it is too large Load Diff