Skip to content
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

Feat/135772 pdf page bulk export #9425

Draft
wants to merge 86 commits into
base: feat/page-bulk-export
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
e1f8e1f
add pdf-converter app
arafubeatbox Oct 20, 2024
7b6135f
add newlines
arafubeatbox Oct 20, 2024
17efb97
add pdf-converter devcontainer
arafubeatbox Oct 20, 2024
5d0d7ab
change pdf-converter port to 3010
arafubeatbox Oct 20, 2024
a0c8fb6
Merge branch 'feat/135772-153347-pdf-converter-app-tsed' into feat/13…
arafubeatbox Oct 20, 2024
48740bb
change pdf-converter port to 3010
arafubeatbox Oct 20, 2024
38ef835
remove @tsed/cli-core
arafubeatbox Oct 20, 2024
7e5de62
Merge branch 'feat/135772-153347-pdf-converter-app-tsed' into feat/13…
arafubeatbox Oct 20, 2024
e852b29
enable pdf bulk export
arafubeatbox Oct 20, 2024
d0ab9ae
add openapi spec and client-library for pdf-converter
arafubeatbox Oct 20, 2024
db522ae
remove json openapi spec
arafubeatbox Oct 20, 2024
79da525
ignore json openapi spec
arafubeatbox Oct 20, 2024
12d78c7
remove unnecessary comment
arafubeatbox Oct 20, 2024
dadcf07
gitignore spec dir for pdf-converter
arafubeatbox Oct 24, 2024
fa9a711
Merge pull request #9279 from weseek/feat/135772-153347-pdf-converter…
yuki-takei Oct 24, 2024
9fb70f0
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1555…
arafubeatbox Oct 25, 2024
9ab99d4
fix filename typo
arafubeatbox Oct 27, 2024
9c5a514
Merge branch 'feat/135772-155547-pdf-converter-tsed-devcontainer' int…
arafubeatbox Oct 27, 2024
07dec1c
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Nov 4, 2024
a33b265
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1555…
arafubeatbox Nov 4, 2024
cb27899
remove file added in wrong conflict resolve
arafubeatbox Nov 4, 2024
e669912
remove pdf-converter Dockerfile
arafubeatbox Nov 4, 2024
aa6154f
Merge branch 'feat/135772-155547-pdf-converter-tsed-devcontainer' int…
arafubeatbox Nov 4, 2024
7095c0f
remove file added in wrong merge
arafubeatbox Nov 4, 2024
e00dfc4
run pnpm install
arafubeatbox Nov 4, 2024
f9befdf
fix pdf-converter devcontainer
arafubeatbox Nov 4, 2024
ee444b3
Merge branch 'feat/135772-155547-pdf-converter-tsed-devcontainer' int…
arafubeatbox Nov 4, 2024
4209913
fix pdf-converter port number
arafubeatbox Nov 4, 2024
52fa250
add noEmit false to pdf-converter tsconfig
arafubeatbox Nov 4, 2024
8b7cec1
get pdf convert job status before cleanup
arafubeatbox Nov 4, 2024
4647767
fix pdf-converter devcontainer
arafubeatbox Nov 4, 2024
b0636d3
Merge branch 'feat/135772-155547-pdf-converter-tsed-devcontainer' int…
arafubeatbox Nov 4, 2024
2898886
fix pdf-converter Dockerfile
arafubeatbox Nov 6, 2024
fbe569c
enable terminus in pdf-converter
arafubeatbox Nov 6, 2024
fd81072
change yarn commands to pnpm
arafubeatbox Nov 6, 2024
4d272a5
change yarn commands to pnpm
arafubeatbox Nov 6, 2024
b30d9d0
Merge branch 'feat/135772-pdf-page-bulk-export' into imprv/156179-156…
arafubeatbox Nov 6, 2024
83f77e7
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1555…
arafubeatbox Nov 6, 2024
d306d2e
change pdf converter dev command
arafubeatbox Nov 6, 2024
b8116b8
Merge pull request #9368 from weseek/imprv/156179-156431-enable-termi…
yuki-takei Nov 8, 2024
4ab4edf
use image with node for base image of pdf-converter and remove features
arafubeatbox Nov 9, 2024
ec8c763
add comment
arafubeatbox Nov 9, 2024
937a57b
add comment
arafubeatbox Nov 9, 2024
d86313d
set defautl profile as bash for devcontainers
arafubeatbox Nov 10, 2024
8420213
Merge pull request #9280 from weseek/feat/135772-155547-pdf-converter…
yuki-takei Nov 11, 2024
5fe093a
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Nov 12, 2024
45d88ed
add comments
arafubeatbox Nov 12, 2024
ab8526a
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Nov 12, 2024
48f12c9
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Nov 12, 2024
426cf56
change pdf-converter dev command to dev:pdf-converter
arafubeatbox Nov 13, 2024
3000c2e
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Nov 19, 2024
d0ae507
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Nov 19, 2024
d5e9bff
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Nov 19, 2024
7ee3eaf
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Nov 19, 2024
fb09529
change pdf-converter base image
arafubeatbox Nov 19, 2024
0aa820e
add ci workflow for pdf-converter
arafubeatbox Nov 20, 2024
300cc0f
add dev:pdf-converter:ci turbo task
arafubeatbox Nov 20, 2024
ac0ec6a
change ci command to dev:pdf-converter:ci
arafubeatbox Nov 20, 2024
e5e5fd6
add --ci flag to dev:pdf-converter:ci
arafubeatbox Nov 20, 2024
b07fc9d
add ci-slackbot-proxy-launch-prod job
arafubeatbox Nov 20, 2024
3264fb5
test run pdf-converer-launch-prod
arafubeatbox Nov 20, 2024
1a9a44f
fix tsed versions
arafubeatbox Nov 20, 2024
aef5e56
Merge pull request #9427 from weseek/feat/155548-157742-pdf-exporter-ci
yuki-takei Nov 22, 2024
4bae443
create remark instance before pdf conversion stream starts
arafubeatbox Nov 22, 2024
c07165d
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Nov 22, 2024
b98f78e
add PageBulkExportPdfConvertCronService
arafubeatbox Nov 24, 2024
ec73d52
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Dec 8, 2024
9bc3d72
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Dec 8, 2024
b2b30bc
add pdf convert process to PageBulkExportJobCronService
arafubeatbox Dec 8, 2024
394cad5
convert md to html on pdf export
arafubeatbox Dec 8, 2024
9e0a6ab
fix pageBulkExportJobCronSchedule
arafubeatbox Dec 8, 2024
501ad46
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Dec 11, 2024
c06158c
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Dec 11, 2024
f6cd1b0
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Dec 11, 2024
f838283
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Dec 11, 2024
19f5040
Merge branch 'feat/page-bulk-export' into feat/135772-pdf-page-bulk-e…
arafubeatbox Dec 14, 2024
4ada71c
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1533…
arafubeatbox Dec 14, 2024
1a78cf9
fix pdf bulk export extension
arafubeatbox Dec 14, 2024
da13dea
init puppeteerCluster on app launch and cleanup html dir
arafubeatbox Dec 14, 2024
726a16c
add comments
arafubeatbox Dec 14, 2024
5fd0cbb
use newest unified packages specified in package.json
arafubeatbox Dec 14, 2024
8a2fdda
remove remark
arafubeatbox Dec 14, 2024
c8d4802
shorten timespan for html file check in pdf converter
arafubeatbox Dec 14, 2024
5fd17c8
Merge pull request #9283 from weseek/feat/135772-153348-enable-pdf-bu…
yuki-takei Dec 16, 2024
49467ae
Merge branch 'feat/135772-pdf-page-bulk-export' into feat/135772-1591…
arafubeatbox Dec 16, 2024
3c0ceea
Merge pull request #9488 from weseek/feat/135772-159172-use-new-unifi…
yuki-takei Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "GROWI-Dev",
"dockerComposeFile": "compose.yml",
"service": "node",
"dockerComposeFile": "../compose.yml",
"service": "app",
"workspaceFolder": "/workspace/growi",

"features": {
Expand All @@ -16,7 +16,7 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "/bin/bash ./.devcontainer/postCreateCommand.sh",
"postCreateCommand": "/bin/bash ./.devcontainer/app/postCreateCommand.sh",

// Configure tool-specific properties.
"customizations": {
Expand Down
14 changes: 13 additions & 1 deletion .devcontainer/compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
services:
node:
app:
image: mcr.microsoft.com/devcontainers/base:ubuntu
volumes:
- ..:/workspace/growi:delegated
- pnpm-store:/workspace/growi/.pnpm-store
- node_modules:/workspace/growi/node_modules
- buildcache_app:/workspace/growi/apps/app/.next
- ../../growi-docker-compose:/workspace/growi-docker-compose:delegated
- page_bulk_export_tmp:/tmp/page-bulk-export
tty: true

mongo:
Expand Down Expand Up @@ -40,7 +41,18 @@ services:
- /usr/share/elasticsearch/data
- ../../growi-docker-compose/elasticsearch/v8/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml

pdf-converter:
# enabling devcontainer 'features' was not working for secondary devcontainer (https://github.com/devcontainers/features/issues/1175)
image: mcr.microsoft.com/vscode/devcontainers/javascript-node:1-20
volumes:
- ..:/workspace/growi:delegated
- pnpm-store:/workspace/growi/.pnpm-store
- node_modules:/workspace/growi/node_modules
- page_bulk_export_tmp:/tmp/page-bulk-export
tty: true

volumes:
pnpm-store:
node_modules:
buildcache_app:
page_bulk_export_tmp:
29 changes: 29 additions & 0 deletions .devcontainer/pdf-converter/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "GROWI-PDF-Converter",
"dockerComposeFile": "../compose.yml",
"service": "pdf-converter",
"workspaceFolder": "/workspace/growi",

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "/bin/bash ./.devcontainer/pdf-converter/postCreateCommand.sh",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"mhutchie.git-graph",
"eamodio.gitlens"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
17 changes: 17 additions & 0 deletions .devcontainer/pdf-converter/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Instal additional packages
sudo apt update
sudo apt-get install -y --no-install-recommends \
chromium locales fonts-ipafont fonts-ipaexfont fonts-ipafont-gothic fonts-ipafont-mincho
sudo apt-get clean -y

# Setup pnpm
SHELL=bash pnpm setup
eval "$(cat /home/node/.bashrc)"
# Update pnpm
pnpm i -g pnpm

# Install turbo
pnpm install turbo --global

# Install dependencies
turbo run bootstrap
168 changes: 168 additions & 0 deletions .github/workflows/ci-pdf-converter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Node CI for pdf-converter

on:
push:
branches-ignore:
- release/**
- rc/**
- support/prepare-v**
paths:
- .github/mergify.yml
- .github/workflows/ci-pdf-converter.yml
- .eslint*
- tsconfig.base.json
- turbo.json
- pnpm-lock.yaml
- package.json
- apps/pdf-converter/**
- '!apps/pdf-converter/docker/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:

ci-pdf-converter-lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: |
pnpm add turbo --global
pnpm install --frozen-lockfile

- name: Lint
run: |
turbo run lint --filter=@growi/pdf-converter

- name: Slack Notification
uses: weseek/ghaction-slack-notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*Node CI for growi-pdf-converter - test (${{ matrix.node-version }})*'
channel: '#ci'
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

ci-pdf-converter-launch-dev:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: |
pnpm add turbo --global
pnpm install --frozen-lockfile

- name: turbo run dev:pdf-converter:ci
working-directory: ./apps/pdf-converter
run: turbo run dev:pdf-converter:ci

- name: Slack Notification
uses: weseek/ghaction-slack-notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*Node CI for growi-pdf-converter - launch-dev (${{ matrix.node-version }})*'
channel: '#ci'
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

ci-pdf-converter-launch-prod:

if: startsWith(github.head_ref, 'mergify/merge-queue/')

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install turbo
run: |
pnpm add turbo --global

- name: Install dependencies
run: |
pnpm install --frozen-lockfile

- name: Restore dist
uses: actions/cache/restore@v4
with:
path: |
**/.turbo
**/dist
key: dist-pdf-converter-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
restore-keys: |
dist-pdf-converter-prod-${{ runner.OS }}-node${{ matrix.node-version }}-

- name: Build
working-directory: ./apps/pdf-converter
run: |
turbo run build

- name: Assembling all dependencies
run: |
rm -rf out
pnpm deploy out --prod --filter @growi/pdf-converter
rm -rf apps/pdf-converter/node_modules && mv out/node_modules apps/pdf-converter/node_modules

- name: pnpm run start:prod:ci
working-directory: ./apps/pdf-converter
run: pnpm run start:prod:ci

- name: Slack Notification
uses: weseek/ghaction-slack-notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*Node CI for growi-pdf-converter - launch-prod (${{ matrix.node-version }})*'
channel: '#ci'
isCompactMode: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Cache dist
uses: actions/cache/save@v4
with:
path: |
**/.turbo
**/dist
key: dist-pdf-converter-prod-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
2 changes: 2 additions & 0 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"@growi/remark-growi-directive": "workspace:^",
"@growi/remark-lsx": "workspace:^",
"@growi/slack": "workspace:^",
"@growi/pdf-converter": "workspace:^",
"@keycloak/keycloak-admin-client": "^18.0.0",
"@slack/web-api": "^6.2.4",
"@slack/webhook": "^6.0.0",
Expand Down Expand Up @@ -205,6 +206,7 @@
"remark-directive": "^3.0.0",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^4.0.0",
"remark-html": "^16.0.1",
"remark-math": "^6.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ const PageBulkExportSelectModal = (): JSX.Element => {
<button className="btn btn-primary" type="button" onClick={() => startBulkExport(PageBulkExportFormat.md)}>
{t('page_export.markdown')}
</button>
{/* TODO: enable in https://redmine.weseek.co.jp/issues/135772 */}
{/* <button className="btn btn-primary ms-2" type="button" onClick={() => startBulkExport(PageBulkExportFormat.pdf)}>PDF</button> */}
<button className="btn btn-primary ms-2" type="button" onClick={() => startBulkExport(PageBulkExportFormat.pdf)}>PDF</button>
</div>
</ModalBody>
</Modal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = (crowi: Crowi): Router => {
const { path, format, restartJob } = req.body;

try {
await pageBulkExportService?.createOrResetBulkExportJob(path, req.user, restartJob);
await pageBulkExportService?.createOrResetBulkExportJob(path, format, req.user, restartJob);
return res.apiv3({}, 204);
}
catch (err) {
Expand Down
Loading
Loading