Skip to content

Commit 515c668

Browse files
committed
Merge branch 'main' into feature/npm-integrity-check
2 parents 5818d08 + eb9e8c5 commit 515c668

File tree

6 files changed

+100
-63
lines changed

6 files changed

+100
-63
lines changed

package-lock.json

Lines changed: 73 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/decap-cms-widget-markdown/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
"remark-slate": "^1.8.6",
3636
"remark-slate-transformer": "^0.7.4",
3737
"remark-stringify": "^6.0.4",
38-
"slate": "^0.91.1",
38+
"slate": "^0.118.1",
3939
"slate-base64-serializer": "^0.2.107",
40-
"slate-history": "^0.93.0",
41-
"slate-hyperscript": "^0.77.0",
42-
"slate-plain-serializer": "^0.7.1",
43-
"slate-react": "^0.91.2",
40+
"slate-dom": "^0.118.1",
41+
"slate-history": "^0.113.1",
42+
"slate-hyperscript": "^0.100.0",
43+
"slate-plain-serializer": "^0.7.3",
44+
"slate-react": "^0.117.4",
4445
"slate-soft-break": "^0.9.0",
4546
"unified": "^9.2.0",
4647
"unist-builder": "^1.0.3",

packages/decap-cms-widget-markdown/src/MarkdownControl/VisualEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function Editor(props) {
223223
position: relative;
224224
`}
225225
>
226-
<Slate editor={editor} value={editorValue} onChange={handleChange}>
226+
<Slate editor={editor} value={editorValue} initialValue={editorValue} onChange={handleChange}>
227227
<EditorControlBar>
228228
{
229229
<Toolbar

packages/decap-server/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ backend:
2727
GIT_REPO_DIRECTORY=FULL_PATH_TO_LOCAL_GIT_REPO
2828
# optional, defaults to 8081
2929
PORT=CUSTOM_PORT
30+
# optional, only listen for incoming connections on a specific IP address
31+
BIND_HOST=127.0.0.1
32+
# optional, restrict API requests to a specific origin
33+
ORIGIN=https://example.com
3034
```

packages/decap-server/src/index.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { registerMiddleware as registerLocalFs } from './middlewares/localFs';
88
import { createLogger } from './logger';
99

1010
const app = express();
11-
const port = process.env.PORT || 8081;
11+
const port = parseInt(process.env.PORT || '8081', 10);
12+
const host = process.env.BIND_HOST;
1213
const level = process.env.LOG_LEVEL || 'info';
1314

1415
(async () => {
@@ -33,7 +34,13 @@ const level = process.env.LOG_LEVEL || 'info';
3334
process.exit(1);
3435
}
3536

36-
return app.listen(port, () => {
37-
logger.info(`Decap CMS Proxy Server listening on port ${port}`);
38-
});
37+
if (host) {
38+
return app.listen(port, host, () => {
39+
logger.info(`Decap CMS Proxy Server listening on ${host}:${port}`);
40+
});
41+
} else {
42+
return app.listen(port, () => {
43+
logger.info(`Decap CMS Proxy Server listening on port ${port}`);
44+
});
45+
}
3946
})();

packages/decap-server/src/middlewares/common/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export function registerCommonMiddlewares(app: express.Express, options: Options
1616
},
1717
};
1818
app.use(morgan('combined', { stream }));
19-
app.use(cors());
19+
app.use(
20+
cors({
21+
origin: process.env.ORIGIN || '*',
22+
}),
23+
);
2024
app.use(express.json({ limit: '50mb' }));
2125
}

0 commit comments

Comments
 (0)