Skip to content

Commit

Permalink
fix issue with databases and with servers
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasmelo1 committed Sep 8, 2024
1 parent a505679 commit 0ef2c14
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 40 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint": "eslint . --ignore-pattern .gitignore",
"define:change": "pnpm changeset",
"release:apply": "pnpm changeset version",
"release:publish": "pnpm changeset publish",
"release:publish": "pnpm changeset publish --filter @palmares/*",
"release:github": "tsx scripts/release/index.ts",
"release": "pnpm run build && pnpm run release:apply && pnpm run release:publish && pnpm run release:github",
"docs:dev": "cd docs && pnpm run docs:dev",
Expand Down
6 changes: 6 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @palmares/client

## 0.1.16

### Patch Changes

- Move core and server to devDependencies of @palmares/client

## 0.1.15

### Patch Changes
Expand Down
6 changes: 2 additions & 4 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@palmares/client",
"version": "0.1.15",
"version": "0.1.16",
"description": "This is the client part of the palmares framework, you should be able to use it on any runtime",
"main": "./dist/cjs/src/index.js",
"module": "./dist/esm/src/index.js",
Expand Down Expand Up @@ -53,9 +53,7 @@
},
"homepage": "https://github.com/palmaresHQ/palmares#readme",
"devDependencies": {
"@types/node": "^22.5.2"
},
"dependencies": {
"@types/node": "^22.5.2",
"@palmares/core": "workspace:*",
"@palmares/server": "workspace:*"
}
Expand Down
7 changes: 4 additions & 3 deletions packages/databases/src/queries/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ export async function parseSearch(

const formattedSearch: Record<string, any> = {};
const promises = fieldsInSearch.map(async (key) => {
const modelInstanceFields = modelConstructor._fields();
const fieldInputParserFunction =
useInputParser && modelInstance.fields[key].inputParsers.has(engine.connectionName)
useInputParser && modelInstanceFields[key].inputParsers.has(engine.connectionName)
? async (value: any) =>
modelInstance.fields[key].inputParsers.get(engine.connectionName)?.({
modelInstanceFields[key].inputParsers.get(engine.connectionName)?.({
engine,
field: modelInstance.fields[key],
field: modelInstanceFields[key],
fieldParser: engine.fields.fieldsParser,
model: modelInstance,
modelName: modelConstructor.getName(),
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ export async function initializeRouters(
let wrapped404Handler: Parameters<NonNullable<ServerAdapter['routers']['parseHandlers']>>['4'] = async () =>
undefined;

if (useServerless) {
if (!useServerless) {
wrapped404Handler = wrap404HandlerAndRootMiddlewares(
serverAdapter,
settings.middlewares || [],
Expand Down
31 changes: 0 additions & 31 deletions packages/server/src/defaults/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,6 @@ export const DEFAULT_SERVER_ERROR_RESPONSE = (error: Error, settings: AllServerS
<meta charset="utf-8">
<title>[Palmares] - Internal Server Error</title>
<link href="https://fonts.googleapis.com/css?family=Mooli" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs/loader.min.js"></script>
<script>
require.config({
paths: {
vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.39.0/min/vs',
},
});
const sourceCode = \`${JSON.stringify(settings, null, 2)}\`;
require(['vs/editor/editor.main'], () => {
monaco.editor.create(document.getElementById('settings'), {
value: sourceCode,
language: 'json',
lineNumbers: 'off',
automaticLayout: true,
minimap: { enabled: false },
padding: { top: 5, right: 5, bottom: 5, left: 5 },
overviewRulerLanes: 0,
overviewRulerBorder: false,
});
});
</script>
</head>
<body style="font-family: 'Mooli'">
<div style="background-color: yellow; text-align: center;">
Expand All @@ -85,14 +62,6 @@ export const DEFAULT_SERVER_ERROR_RESPONSE = (error: Error, settings: AllServerS
</div>
</div>
<br>
<div style="width: 100%; background-color: #f1f1f1; border-radius: 20px">
<div style="padding: 10px">
<h4>App Settings</h4>
<div style="border-bottom: 1px solid black; width: 100%; height: 1px;" ></div>
<div id="settings" style="width: 100%; height: 50vh"></div>
</div>
</div>
<br>
<div style="width: 100%; background-color: #f1f1f1; border-radius: 20px">
<div style="padding: 10px">
<h4>Domains</h4>
Expand Down

0 comments on commit 0ef2c14

Please sign in to comment.