Skip to content

Commit

Permalink
#28 Formatting and added packages
Browse files Browse the repository at this point in the history
  • Loading branch information
JabobKrauskopf committed Mar 5, 2023
1 parent a8c53cd commit ccac4a5
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 23 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
.env
!prisma/.env
.DS_Store
build
data
Expand Down
24 changes: 12 additions & 12 deletions config/build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ const { build } = require("esbuild");

// See: https://github.com/evanw/esbuild/issues/1051
const nativeNodeModulesPlugin = {
name: 'native-node-modules',
name: "native-node-modules",
setup(build) {
build.onResolve({ filter: /\.node$/, namespace: 'file' }, args => ({
build.onResolve({ filter: /\.node$/, namespace: "file" }, (args) => ({
path: require.resolve(args.path, { paths: [args.resolveDir] }),
namespace: 'node-file',
}))
build.onLoad({ filter: /.*/, namespace: 'node-file' }, args => ({
namespace: "node-file",
}));
build.onLoad({ filter: /.*/, namespace: "node-file" }, (args) => ({
contents: `
import path from ${JSON.stringify(args.path)}
try { module.exports = require(path) }
catch {}
`,
}))
build.onResolve({ filter: /\.node$/, namespace: 'node-file' }, args => ({
}));
build.onResolve({ filter: /\.node$/, namespace: "node-file" }, (args) => ({
path: args.path,
namespace: 'file',
}))
let opts = build.initialOptions
opts.loader = opts.loader || {}
opts.loader['.node'] = 'file'
namespace: "file",
}));
let opts = build.initialOptions;
opts.loader = opts.loader || {};
opts.loader[".node"] = "file";
},
};

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"@types/node": "^18.6.1",
"@types/ssh2": "^1.11.5",
"esbuild": "^0.17.10",
"jest": "^29.4.3",
"prisma": "^4.11.0",
"supertest": "^6.3.3",
"ts-node-dev": "^2.0.0",
"typescript": "^4.9.5"
},
Expand Down
8 changes: 6 additions & 2 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"extends": "../config/shared-tsconfig.json",
"include": ["./**/*"],
"include": [
"./**/*"
],
"compilerOptions": {
"paths": {
"~/*": ["./*"]
"~/*": [
"./*"
]
}
}
}
6 changes: 6 additions & 0 deletions test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
};
6 changes: 6 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../config/shared-tsconfig.json",
"include": [
"./**/*"
]
}
15 changes: 12 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"files": [],
"exclude": ["node_modules"],
"exclude": [
"node_modules"
],
"extends": "./config/shared-tsconfig.json",
"references": [
{ "path": "types" },
{ "path": "server" },
{
"path": "types"
},
{
"path": "server"
},
{
"path": "test"
},
]
}
4 changes: 3 additions & 1 deletion types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"extends": "../config/shared-tsconfig.json",
"include": ["./**/*"]
"include": [
"./**/*"
]
}
Loading

0 comments on commit ccac4a5

Please sign in to comment.