-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build config #1
Build config #1
Conversation
# copy monorepo's build outputs | ||
# ref: https://github.com/lerna/lerna/issues/2381 | ||
# | ||
COPY --from=builder /srv/www/hocuspocus-extension-elasticsearch/dist ./hocuspocus-extension-elasticsearch/dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: if we don't add this, then tsc outside will still build hocuspocus-extension-elasticsearch
.
However, the directory structure does not match the one written in hocuspocus-extension-elasticsearch
's package.json
's export
key.
…nstructor must be an ArrayBuffer
|
||
export interface ElasticsearchConfiguration extends DatabaseConfiguration { | ||
elasticsearchOpts?: elasticsearch.ClientOptions; | ||
db_index?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: why snake_case here while everywhere else is camelCased?
const { body: docExist } = await this.db?.exists({ index: 'ydocs', id: documentName, type: 'doc' }) || {} | ||
// console.log(`DB fetch ${documentName}`); | ||
const { body: docExist } = | ||
(await this.db?.exists({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For not exist error, I think we can either check the status code returned by this.db?.get
, or try-catch if it throws an error. In this case we don't need an extra exist()
call to the database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Features
Build elasticsearch extension
Since tsconfig cannot rename output files, we use three different config
tsconfig.cjs.json
tsconfig.esm.json
tsconfig.types.json
to build different targetDockerfile
hocuspocus-extension-elasticsearch/package.json
and folderhocuspocus-extension-elasticsearch/dist
additionallyRef: Copy local package files to node_modules instead create symlink lerna/lerna#2381
TODO