Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
68f2f48
feat: create legacy structure separate from seed
tefkah Apr 14, 2025
4c0d100
fix: fix some type errors
tefkah Apr 14, 2025
b1ba731
feat: extremely basic importer
tefkah Apr 14, 2025
f908ba5
fix: pass trx to getAllPubTypesForCommunity
tefkah Apr 14, 2025
f106652
feat: delete existing stuff before reattempting migration
tefkah Apr 14, 2025
0d03574
feat: much better parsing, import entire archive
tefkah Apr 15, 2025
1282b94
refactor: make creating pubtypes with default forms easier
tefkah Apr 15, 2025
7d5a765
refactor: improve passing through of trx
tefkah Apr 15, 2025
f62b33f
refactor: create separate place for creating pubtype with form
tefkah Apr 15, 2025
ec9b9c4
fix: worse validation
tefkah Apr 15, 2025
aad45c8
feat: wow sort of importing works
tefkah Apr 15, 2025
7578b61
feat: add ability to target by value rather than id for many pub-op o…
tefkah Apr 16, 2025
ad921ad
feat: add tests for by value operations
tefkah Apr 16, 2025
9af0e29
fix: make relateByValue also properly accept multiple values
tefkah Apr 16, 2025
258c9dd
fix: improve setting logic
tefkah Apr 16, 2025
262f0ba
feat: import collections
tefkah Apr 16, 2025
c3fb31c
feat: import pages
tefkah Apr 16, 2025
7d64137
fix: update pnpm-lock.yaml for reasons
tefkah Apr 16, 2025
e8552f0
fix: allow non-destructive update
tefkah Apr 16, 2025
1f0aee6
feat: allow you to actually set a size for a column in a datatable ho…
tefkah Apr 17, 2025
7ee0902
fix(pubOp): make updateByRelatedValue work
tefkah Apr 17, 2025
4ba7207
fix(ui): fix checkbox alignment in tables
tefkah Apr 17, 2025
52f10cd
feat(ui): add sticky header option for datatable
tefkah Apr 17, 2025
4d7ecff
feat(migration): add more granular undo
tefkah Apr 17, 2025
39cb44c
feat(autoCache): correctly handle autocache in transactions
tefkah Apr 17, 2025
cdf7d4a
refactor(pub-op): allow pub-op to not return things
tefkah Apr 17, 2025
df01b17
feat(migration): create top-level journal + connections
tefkah Apr 17, 2025
26d85e0
feat(pubOp): tentatively add support for batch operations
tefkah Apr 17, 2025
697f9cc
feat(pubOp): add tests for batch operations
tefkah Apr 17, 2025
663870f
chore(pubOp): add seed
tefkah Apr 17, 2025
75e1488
feat(PubOp): make resolving non-target values more efficient
tefkah Apr 17, 2025
ff70426
fix(trx): do not always throw transaction
tefkah Apr 17, 2025
44fca9c
feat(api): search pubtypes by name
tefkah Apr 17, 2025
d655236
feat(api): search pubtypes by name array
tefkah Apr 17, 2025
ced6235
feat(site-builder): functioning site-builder
tefkah Apr 17, 2025
5f0885b
feat(site-builder): add site building action
tefkah Apr 17, 2025
2506a6d
refactor(ui): move submit button to ui package
tefkah Apr 17, 2025
12fe755
feat(site-builder): add astro configs for prettier and vscode
tefkah Apr 17, 2025
700d52e
feat(site-builder): add env vars for sitebuilder
tefkah Apr 17, 2025
a0ace75
fix(pubOp): fix target resolution
tefkah Apr 17, 2025
b7bf102
chore(migration): update server action to log out error
tefkah Apr 17, 2025
b010e2c
feat(site-builder): add working action
tefkah Apr 17, 2025
6a70640
chore: new deps
tefkah Apr 17, 2025
99a0ff5
chore(migration): clean up migration code a bit
tefkah Apr 17, 2025
274cc34
fix(site-builder): do not depend on ui and use shared dockerfile
tefkah Apr 17, 2025
ec16524
chore(site-builder): keep builds dir
tefkah Apr 17, 2025
6dd6c41
chore(site-builder): keep more dirs
tefkah Apr 17, 2025
5727b3b
fix(site-builder): run successfully in docker
tefkah Apr 17, 2025
4d568a2
chore(site-buider): better docker folders
tefkah Apr 17, 2025
98bf731
feat(site-builder): use ts-rest with hono, use different thing with t…
tefkah Apr 17, 2025
66f3070
feat(site-builder): stream, and allow of uploading directory
tefkah Apr 17, 2025
dbaf480
feat(site-builder): make building more programattic and slightly easi…
tefkah Apr 17, 2025
6db0f0c
chore: merge with main
tefkah Apr 18, 2025
8fa58bf
fix(site-builder): include .env.development
tefkah Apr 18, 2025
41a0fee
fix(site-builder): fix things
tefkah Apr 18, 2025
18c6c67
feat(site-builder): add sitebuilder auth and sitebuilder specific tokens
tefkah Apr 18, 2025
9067a87
chore: fix env imports
tefkah Apr 18, 2025
18546a3
feat(site-builder): add infra configuration
tefkah Apr 18, 2025
f6965fb
chore: update vitest dep to solve types
tefkah Apr 18, 2025
03c3470
chore: fix lint and type errors
tefkah Apr 18, 2025
ba3c284
chore: fix jobs
tefkah Apr 18, 2025
e866310
fix: mock autoCache/revalidate better
tefkah Apr 18, 2025
1d9752d
chore: attempt to fix workflow
tefkah Apr 18, 2025
3e6585e
fix: fix tests
tefkah Apr 18, 2025
efc6b4f
fix: fix apiAccesstoken better
tefkah Apr 18, 2025
9452e46
chore: stupid way to fix error, rework auto rollback with kysely 0.28…
tefkah Apr 18, 2025
1f3f395
fix(ci): run playwright at e2e
tefkah Apr 18, 2025
7aab8f9
fix(self-host): re enable minio
tefkah Apr 18, 2025
bbfc3c2
fix(ci): do not exit after minio-init
tefkah Apr 18, 2025
1d26f1b
fix(e2e): install correct playwright deps
tefkah Apr 18, 2025
667a13a
fix: skip all other ci
tefkah Apr 18, 2025
f9b0ce0
fix(ci): really skip ci
tefkah Apr 18, 2025
3760934
fix(ci): add new env vars
tefkah Apr 18, 2025
b419050
fix(ci): SITE_BUILDER_ENDPOINT!!
tefkah Apr 18, 2025
2db84b2
fix(migration): don't write archive.json
tefkah Apr 18, 2025
560c0df
chore(ci): rebuild core
tefkah Apr 18, 2025
5bb1f5c
chore: skip ci again
tefkah Apr 18, 2025
40e00c2
fix: maybe set port correctly
tefkah Apr 18, 2025
2899b24
fix(preview): fix preview issues
tefkah Apr 18, 2025
4e21934
fix(preview): fix preview issues
tefkah Apr 18, 2025
2517cbd
fix(preview): fix preview issues
tefkah Apr 18, 2025
6f2d224
fix(site-builder): set correct permissions for folders
tefkah Apr 18, 2025
d7ff0bb
fix: correct id
tefkah Apr 18, 2025
e3d2511
fix(assets): try some workaround to make assets uploading work
tefkah Apr 21, 2025
b59b888
fix(site-builder): rewrite returned url
tefkah Apr 21, 2025
89b3aa2
fix(self-host): use actual script as entrypoint
tefkah Apr 21, 2025
dc221f9
fix(site-builder): fix path for returned
tefkah Apr 21, 2025
1a135a1
feat(actions): allow returning straight up jsx as report
tefkah Apr 21, 2025
c76ff22
refactor(migration): use new batch system in migratins
tefkah Apr 21, 2025
098ab93
fix(preview): maybe depend on minio-init?
tefkah Apr 21, 2025
6e5ab3f
fix(preview: oops, i mean have platform depend
tefkah Apr 21, 2025
63bc961
feat(site-builder+ui): make site-builder token unremovable and extrac…
tefkah Apr 21, 2025
c5e93cd
feat(migration): show migration in sidebar
tefkah Apr 21, 2025
aa6ee8d
chore: get rid of unnecessary between function
tefkah Apr 21, 2025
9c5d7ec
feat(migration): import actual draft
tefkah Apr 22, 2025
086373d
feat(migration): support images
tefkah Apr 22, 2025
95e91e7
feat(context-editor): add hard_break node
tefkah Apr 22, 2025
99a3c63
feat(migration): use slightly different content structure
tefkah Apr 22, 2025
187f014
chore: merge with main
tefkah Apr 23, 2025
cd038a6
feat(html): basic html serialization/deserialization
tefkah Apr 23, 2025
ea1b9be
Merge branch 'main' into tfk/migration-prosemirror-rehype
tefkah Apr 24, 2025
1812f07
fix: fix merge conflicts
tefkah Apr 29, 2025
d935cde
chore: merge with main
tefkah Apr 30, 2025
cdcfcfe
Merge branch 'tfk/migration' into tfk/migration-prosemirror-rehype
tefkah Apr 30, 2025
dd41e60
feat(ui): add new show more component
tefkah Apr 30, 2025
7d1f9d1
feat(serialization): add proper serialization libs
tefkah Apr 30, 2025
8bbd621
refactor(serialization): parse and convert prosemirror tree during
tefkah Apr 30, 2025
7c4bf75
fix(migration): make migration code work with new pubop stuff
tefkah Apr 30, 2025
ef0687e
feat: make site-builder prettier
tefkah Apr 30, 2025
2938c49
Merge branch 'main' into tfk/migration-prosemirror-rehype
tefkah May 1, 2025
3fc921a
feat(fts|serialization): properly index html
tefkah May 1, 2025
e0605f5
fix(thing): try to reconstruct things
tefkah May 1, 2025
2869c52
Merge branch 'main' into tfk/migration-prosemirror-rehype
tefkah May 1, 2025
a9ce387
chore: merge
tefkah May 7, 2025
b5c4b89
fix(images): properly convert images on import
tefkah May 7, 2025
fb3b112
fix(migration): properly convert images on import
tefkah May 7, 2025
2ee5cfc
fix(serialization): sort of fix loading
tefkah May 7, 2025
f5d42cb
feat(serialization): add first pass at serialization
tefkah May 7, 2025
ce77fcd
feat(ui): add new show more component
tefkah Apr 30, 2025
204fa4f
feat(serialization): add proper serialization libs
tefkah Apr 30, 2025
c33097f
refactor(serialization): parse and convert prosemirror tree during
tefkah Apr 30, 2025
8f49b17
feat(fts|serialization): properly index html
tefkah May 1, 2025
d9f4f20
fix(serialization): sort of fix loading
tefkah May 7, 2025
e92f261
fix: fix weird redis install issue
tefkah May 7, 2025
550c767
dev: make legacy seed have useful richtext
tefkah May 7, 2025
78aae12
feat(migration): import images as figures with captions
tefkah May 7, 2025
6dcc8a4
chore: remove logs
tefkah May 8, 2025
614afbf
fix(migration): properly import equation nodes
tefkah May 8, 2025
71439d6
dev: make legacy seed have useful richtext
tefkah May 8, 2025
642bbd1
feat(math): serialize math to mathml and back reliably
tefkah May 8, 2025
9997e8f
feat(serialization): find a happy way to store html and serialize on …
tefkah May 12, 2025
2b3c8b5
chore: remove old validation function, fix test
tefkah May 12, 2025
e5bf99f
fix: fix the stories
tefkah May 12, 2025
b83d855
fix: really fix math, cleanup
tefkah May 12, 2025
e2b5978
feat: add migration to clear current richtext values
tefkah May 12, 2025
276fffe
Merge branch 'main' into tfk/html-richtext
tefkah May 12, 2025
eb9bcc9
chore: bring up to speed with other html work
tefkah May 12, 2025
6c740c6
chore: meaningless change to trigger ci
tefkah May 12, 2025
53bb547
fix: fix fts related type issues
tefkah May 12, 2025
162b545
fix: fix contexteditor related type issues
tefkah May 12, 2025
0ced401
chore: don't format html
tefkah May 12, 2025
76e70e8
fix: fix test to work with figures
tefkah May 12, 2025
7831b83
chore: revert and merge with main
tefkah May 15, 2025
8c28170
chore: merge with tfk/html-richtext
tefkah May 15, 2025
d72f664
fix: fix small issues
tefkah May 12, 2025
4944bd0
chore(db): increase idle-in-connection timeout, otherwise migration c…
tefkah May 13, 2025
544d00c
fix(migration): properly import table nodes
tefkah May 13, 2025
69b0a54
feat(migration): handle some pub facets (when i have them)
tefkah May 13, 2025
257837e
fix(migration): fallback to latest release content if draft is empty
tefkah May 13, 2025
dfa3ad8
feat(migration/site-builder): navigation menus sort of work
tefkah May 13, 2025
ec44cc8
fix: modify tests
tefkah May 15, 2025
fb42241
Merge branch 'tfk/html-richtext' into tfk/migration
tefkah May 15, 2025
5ebf290
feat: add extremely basic page layout migration
tefkah May 15, 2025
0725fa5
feat: use pages somewhat
tefkah May 15, 2025
7d74040
fix(ui): type error with submit component
tefkah May 15, 2025
580f1b6
chore(migration): clean up
tefkah May 15, 2025
25fd70b
feat(migration): add some page metadata for the migration page
tefkah May 15, 2025
39b0628
Merge branch 'main' into tfk/html-richtext
tefkah May 19, 2025
829eb08
chore: remove silly console.log messages in cache layer
tefkah May 20, 2025
6a01dbd
chore: merge with main
tefkah May 20, 2025
4eb57a6
Merge branch 'tfk/html-richtext' into tfk/migration
tefkah May 20, 2025
b892c62
refactor: move the html/prosemirror boundary to the form
tefkah May 20, 2025
0dded00
chore: merge with main
tefkah May 20, 2025
114206f
fix: handle no value for richtext
tefkah May 21, 2025
e0f038d
fix: use more predictable handling of temp richtext value, add explan…
tefkah May 21, 2025
7a6ea14
refactor: get rid of forward ref, it is cringe
tefkah May 21, 2025
971e977
Merge branch 'main' into tfk/html-richtext
tefkah May 21, 2025
81d60fc
fix: make ref optional
tefkah May 21, 2025
848a258
fix: use consolidate prosemirror/html conversion fns a bit
tefkah May 21, 2025
1bbb209
Merge branch 'main' into tfk/html-richtext
tefkah May 22, 2025
05564bd
docs: update rich text docs
tefkah May 22, 2025
a3d9614
fix: find math display correctly
tefkah May 22, 2025
ce54302
chore: merge
tefkah May 22, 2025
4af319e
feat(color): allow alpha for color
tefkah May 22, 2025
f6e0699
chore: remove old editor serializiation methods
tefkah May 22, 2025
36b7023
chore: cleanup
tefkah May 22, 2025
22c80b2
Merge branch 'main' into tfk/html-richtext
tefkah May 27, 2025
25f761d
fix?: use localhost instead of docker-host for minio init
tefkah May 27, 2025
3edd460
debug: add some logs
tefkah May 27, 2025
4b4c059
fix?: upgrade aws?
tefkah May 27, 2025
7ced2c4
fix(minio): use new minio client syntax after breaking change
tefkah May 27, 2025
c86b044
chore: merge
tefkah May 27, 2025
faabcf1
fix(minio): use new minio client syntax after breaking change
tefkah May 27, 2025
6d85856
chore: remove console.logs
tefkah May 27, 2025
cf1a864
chore: run ci again
tefkah May 27, 2025
150f223
chore: remove console.logs
tefkah May 27, 2025
04f67ba
chore: sync up vite versions
tefkah May 27, 2025
570dedd
fix: manually cast timeout to be sure that typescript does not get co…
tefkah May 27, 2025
bc5b3fd
fix(migration): restrucuter the giant legacy-migration file a bit
tefkah May 27, 2025
af4b3b2
dev(migration): create a blank community
tefkah May 27, 2025
63ae0e8
fix(migration): properly import colors
tefkah May 27, 2025
243d4ea
Merge branch 'main' into tfk/html-richtext
tefkah May 27, 2025
c0e290a
Merge branch 'tfk/html-richtext' into tfk/migration
tefkah May 27, 2025
ad1a2cd
chore(migration): clean up
tefkah May 27, 2025
993c610
chore(migration): clean up + increase concurrency
tefkah May 27, 2025
d5a1e8e
fix(migration): add possibly crucial missing await
tefkah May 27, 2025
4ab04cd
chore: rename cleanup to legacy-cleanup
tefkah May 27, 2025
02e317d
fix: actually delete pubfields when undoing legacy migration
tefkah May 27, 2025
4696e6c
fix: remove site_builder_api_key
tefkah May 27, 2025
30905a2
chore: prettier
tefkah May 27, 2025
9881d52
chore: merge
tefkah May 27, 2025
9e29fa3
chore: merge
tefkah May 27, 2025
2709e27
chore: merge
tefkah Jun 2, 2025
8bc9678
fix: add sitebuilder to e2e tests, and set correct env vars
tefkah Jun 2, 2025
a310a1c
chore: merge
tefkah Jun 16, 2025
c3bb95b
fix: set test env correctly
tefkah Jun 16, 2025
e676374
chore: merge
tefkah Jun 25, 2025
5456a5d
feat: make user upload static.json themselves
tefkah Jun 25, 2025
5e70710
fix: add html
tefkah Jun 30, 2025
b4e2751
fix: remove storybook filter
tefkah Jul 14, 2025
c65b304
fix: click action run button correctly
tefkah Jul 14, 2025
b04e9f0
fix: fix test to look at correct permissions
tefkah Jul 14, 2025
38750d1
fix: fix test by waiting for nav
tefkah Jul 14, 2025
2bfad60
fix: have slightly better error if you access form as superadmin
tefkah Jul 14, 2025
8846ac9
fix: fix obscure nuqs error by installing specific version of babel/…
tefkah Jul 14, 2025
8677b8c
fix: when clicking on community on /communities, take you there
tefkah Jul 14, 2025
ea397c7
fix: don't write file silly
tefkah Jul 14, 2025
bfe5b13
chore: merge
tefkah Aug 4, 2025
dbdab73
Merge branch 'main' into tfk/migration
tefkah Aug 4, 2025
8ef68af
chore: fix format
tefkah Aug 5, 2025
8c925b0
fix: type-check
tefkah Aug 5, 2025
b6349be
fix: close toast in test
tefkah Aug 6, 2025
bd928a1
Merge branch 'main' into tfk/migration
tefkah Aug 12, 2025
ef96317
chore: merge
tefkah Sep 2, 2025
0004d9b
fix: more merge
tefkah Sep 2, 2025
b7c9da7
fix: aa
tefkah Sep 2, 2025
169791b
fix: fix merge
tefkah Sep 11, 2025
f87eeab
Merge branch 'main' into tfk/migration
tefkah Sep 15, 2025
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
3 changes: 2 additions & 1 deletion .env.docker-compose.dev
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ POSTGRES_DB=postgres

VALKEY_HOST='cache'

SITE_BUILDER_ENDPOINT=http://localhost:4000
# annoying duplication because jobs uses this version
PGHOST=db
PGPORT=5432
Expand All @@ -41,4 +42,4 @@ INBUCKET_URL=http://localhost:54324
MAILGUN_SMTP_USERNAME=omitted
OTEL_SERVICE_NAME=core.core
PUBPUB_URL=http://localhost:3000
API_KEY=xxx
API_KEY=xxx
3 changes: 3 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
echo "core_label=$ECR_REGISTRY/${ECR_REPOSITORY_NAME_OVERRIDE:-$ECR_REPOSITORY_PREFIX-core}:$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "jobs_label=$ECR_REGISTRY/${ECR_REPOSITORY_NAME_OVERRIDE:-$ECR_REPOSITORY_PREFIX-jobs}:$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "base_label=$ECR_REGISTRY/$ECR_REPOSITORY_PREFIX:$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "site_builder_label=$ECR_REGISTRY/${ECR_REPOSITORY_NAME_OVERRIDE:-$ECR_REPOSITORY_PREFIX-site-builder}:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
Expand All @@ -115,6 +116,7 @@ jobs:
run: pnpm integration:setup
env:
INTEGRATION_TESTS_IMAGE: ${{steps.label.outputs.core_label}}
SITE_BUILDER_IMAGE: ${{steps.label.outputs.site_builder_label}}
JOBS_IMAGE: ${{steps.label.outputs.jobs_label}}

- name: Log out Container ID for health check
Expand All @@ -136,6 +138,7 @@ jobs:
run: docker compose -f docker-compose.test.yml --profile integration logs -t
env:
INTEGRATION_TESTS_IMAGE: ${{steps.label.outputs.core_label}}
SITE_BUILDER_IMAGE: ${{steps.label.outputs.site_builder_label}}
JOBS_IMAGE: ${{steps.label.outputs.jobs_label}}

- name: Upload core playwright snapshots artifact
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ecrbuild-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ on:
jobs-image:
description: "Jobs image SHA"
value: ${{ jobs.build-jobs.outputs.image-sha }}
site-builder-image:
description: "Site builder image SHA"
value: ${{ jobs.build-site-builder.outputs.image-sha }}

jobs:
emit-sha-tag:
Expand Down Expand Up @@ -71,3 +74,14 @@ jobs:
secrets:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

build-site-builder:
uses: ./.github/workflows/ecrbuild-template.yml
with:
package: site-builder
target: jobs
# publish_to_ghcr: ${{ inputs.publish_to_ghcr }}
ghcr_image_name: platform-site-builder
secrets:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
1 change: 1 addition & 0 deletions .github/workflows/on_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
PLATFORM_IMAGE: ${{ needs.build-all.outputs.core-image }}
JOBS_IMAGE: ${{ needs.build-all.outputs.jobs-image }}
MIGRATIONS_IMAGE: ${{ needs.build-all.outputs.base-image }}
SITE_BUILDER_IMAGE: ${{ needs.build-all.outputs.site-builder-image }}
AWS_REGION: "us-east-1"
ALWAYS_ON: "main"
COMPOSE_FILES: docker-compose.preview.sandbox.yml
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: ./.github/workflows/ci.yml

build-all:
if: github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' || (github.event.action == 'labeled' && github.event.label.name == 'preview')
if: (github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' || (github.event.action == 'labeled' && github.event.label.name == 'preview'))
uses: ./.github/workflows/ecrbuild-all.yml
secrets:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -61,9 +61,14 @@ jobs:
pull-requests: write
statuses: write
with:
# PLATFORM_IMAGE: 246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-core:2b9a81a279c4e405bbedcdbb697c897ded52fbc0
# JOBS_IMAGE: 246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-jobs:c786662f4899de16a621e366a485eca5adda4d6a
# MIGRATIONS_IMAGE: 246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7:c786662f4899de16a621e366a485eca5adda4d6a
# SITE_BUILDER_IMAGE: 246372085946.dkr.ecr.us-east-1.amazonaws.com/pubpub-v7-site-builder:c786662f4899de16a621e366a485eca5adda4d6a
PLATFORM_IMAGE: ${{ needs.build-all.outputs.core-image }}
JOBS_IMAGE: ${{ needs.build-all.outputs.jobs-image }}
MIGRATIONS_IMAGE: ${{ needs.build-all.outputs.base-image }}
SITE_BUILDER_IMAGE: ${{ needs.build-all.outputs.site-builder-image }}
AWS_REGION: "us-east-1"
COMPOSE_FILES: docker-compose.preview.pr.yml
secrets:
Expand All @@ -85,6 +90,7 @@ jobs:
PLATFORM_IMAGE: "x" # not used
JOBS_IMAGE: "x" # not used
MIGRATIONS_IMAGE: "x" # not used
SITE_BUILDER_IMAGE: "x" # not used
AWS_REGION: "us-east-1"
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pull-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
MIGRATIONS_IMAGE:
required: true
type: string
SITE_BUILDER_IMAGE:
required: true
type: string
AWS_REGION:
required: true
type: string
Expand Down Expand Up @@ -52,10 +55,12 @@ jobs:
PLATFORM_IMAGE: ${{ inputs.PLATFORM_IMAGE }}
JOBS_IMAGE: ${{ inputs.JOBS_IMAGE }}
MIGRATIONS_IMAGE: ${{ inputs.MIGRATIONS_IMAGE }}
SITE_BUILDER_IMAGE: ${{ inputs.SITE_BUILDER_IMAGE }}
run: |
sed -i "s|image: PLATFORM_IMAGE|image: $PLATFORM_IMAGE|" docker-compose.preview.yml
sed -i "s|image: JOBS_IMAGE|image: $JOBS_IMAGE|" docker-compose.preview.yml
sed -i "s|image: MIGRATIONS_IMAGE|image: $MIGRATIONS_IMAGE|" docker-compose.preview.yml
sed -i "s|image: SITE_BUILDER_IMAGE|image: $SITE_BUILDER_IMAGE|" docker-compose.preview.yml
sed -i "s|DATACITE_REPOSITORY_ID: DATACITE_REPOSITORY_ID|DATACITE_REPOSITORY_ID: ${{ secrets.PREVIEW_DATACITE_REPOSITORY_ID }}|" docker-compose.preview.yml
sed -i "s|DATACITE_PASSWORD: DATACITE_PASSWORD|DATACITE_PASSWORD: ${{ secrets.PREVIEW_DATACITE_PASSWORD }}|" docker-compose.preview.yml
sed -i "s|email someone@example.com|email dev@pubpub.org|" self-host/caddy/Caddyfile
Expand All @@ -77,7 +82,7 @@ jobs:
default_port: 443
instance_type: small
always_on: ${{ inputs.ALWAYS_ON }}
ports: 80,443,9001
ports: 80,443
registries: docker://AWS:${{steps.ecrtoken.outputs.value}}@246372085946.dkr.ecr.us-east-1.amazonaws.com
github_token: ${{ secrets.GH_PAT_PR_PREVIEW_CLEANUP }}
pre_script: "./.github/workflows/pull-preview-script.sh"
Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
"NODE_OPTIONS": "--import=\"#register-loader\"",
"SKIP_VALIDATION": "true",
"DATABASE_URL": "postgresql://postgres:postgres@localhost:54322/postgres"
},
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,20 @@ RUN pnpm --filter $PACKAGE --prod deploy /tmp/app

FROM base AS jobs

ARG PACKAGE

WORKDIR /usr/src/app

COPY --from=prepare-jobs --chown=node:node /tmp/app .

# If the package is site-builder, create necessary directories and set permissions
RUN if [ "$PACKAGE" = "site-builder" ]; then \
mkdir -p /usr/src/app/builds /usr/src/app/.astro /usr/src/app/dist && \
chown -R node:node /usr/src/app/builds /usr/src/app/.astro /usr/src/app/dist; \
fi



USER node

CMD ["pnpm", "start"]
Expand Down
23 changes: 23 additions & 0 deletions config/prettier/astro.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @ts-check

import baseConfig from "./index.js";

/** @typedef {import("prettier").Config} PrettierConfig */
/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */

/** @type {PrettierConfig & SortImportsConfig & TailwindConfig} */
const config = {
...baseConfig,
plugins: [...(baseConfig.plugins ?? []), "prettier-plugin-astro"],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};

export default config;
2 changes: 1 addition & 1 deletion config/prettier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { fileURLToPath } from "url";
/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */

/** @type {PrettierConfig | SortImportsConfig | TailwindConfig} */
/** @type {PrettierConfig & SortImportsConfig & TailwindConfig} */
const config = {
arrowParens: "always",
printWidth: 100,
Expand Down
4 changes: 3 additions & 1 deletion config/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"version": "0.1.0",
"exports": {
".": "./index.js"
".": "./index.js",
"./astro": "./astro.js"
},
"scripts": {
"clean": "rm -rf .turbo node_modules",
Expand All @@ -15,6 +16,7 @@
"dependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.6.2",
"prettier": "catalog:",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-jsdoc": "^1.3.3",
"prettier-plugin-tailwindcss": "^0.6.14"
},
Expand Down
41 changes: 22 additions & 19 deletions core/.env.development
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
MAILGUN_SMTP_HOST=localhost
MAILGUN_SMTP_PORT=54325
API_KEY="super_secret_key"
DATABASE_URL="postgresql://postgres:postgres@localhost:54322/postgres"
PUBPUB_URL="http://localhost:3000"
ASSETS_BUCKET_NAME="assets.v7.pubpub.org"
ASSETS_REGION="us-east-1"
API_KEY=super_secret_key
DATABASE_URL=postgresql://postgres:postgres@localhost:54322/postgres
PUBPUB_URL=http://localhost:3000
ASSETS_BUCKET_NAME=assets.v7.pubpub.org
ASSETS_REGION=us-east-1

# mninio defaults
ASSETS_UPLOAD_KEY="pubpubuser"
ASSETS_UPLOAD_SECRET_KEY="pubpubpass"
ASSETS_STORAGE_ENDPOINT="http://localhost:9000"
ASSETS_UPLOAD_KEY=pubpubuser
ASSETS_UPLOAD_SECRET_KEY=pubpubpass
ASSETS_STORAGE_ENDPOINT=http://localhost:9000

MAILGUN_SMTP_PASSWORD="xxx"
MAILGUN_SMTP_USERNAME="xxx"
MAILGUN_SMTP_PASSWORD=xxx
MAILGUN_SMTP_USERNAME=xxx

OTEL_SERVICE_NAME="pubpub-v7-dev" # should be shared across components but not environments
HONEYCOMB_API_KEY="xxx"
ARTILLERY_CLOUD_API_KEY="xxx"
OTEL_SERVICE_NAME=pubpub-v7-dev
HONEYCOMB_API_KEY=xxx
ARTILLERY_CLOUD_API_KEY=xxx

KYSELY_DEBUG="true"
KYSELY_DEBUG=true

DATACITE_REPOSITORY_ID=""
DATACITE_PASSWORD=""
DATACITE_API_URL="https://api.test.datacite.org"
DATACITE_REPOSITORY_ID=
DATACITE_PASSWORD=
DATACITE_API_URL=https://api.test.datacite.org

GCLOUD_KEY_FILE='xxx'
VALKEY_HOST='localhost'
GCLOUD_KEY_FILE=xxx

SITE_BUILDER_ENDPOINT=http://localhost:4000

VALKEY_HOST='localhost'
10 changes: 10 additions & 0 deletions core/actions/_lib/zodTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ class ActionInstance extends z.ZodObject<typeof actionInstanceShape, "strip", z.
});
}

class FieldName extends z.ZodString {
static create = () =>
new FieldName({
typeName: "FieldName" as z.ZodFirstPartyTypeKind.ZodString,
checks: [],
coerce: false,
});
}

Comment on lines +56 to +64

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really used for the sitebuilder action, but could be used in the future.

export const markdown = Markdown.create;
export const stringWithTokens = StringWithTokens.create;
export const actionInstance = ActionInstance.create;
export const fieldName = FieldName.create;
2 changes: 2 additions & 0 deletions core/actions/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
pubInStageForDuration,
pubLeftStage,
} from "../_lib/rules";
import * as buildJournalSite from "../buildJournalSite/action";
import * as datacite from "../datacite/action";
import * as email from "../email/action";
import * as googleDriveImport from "../googleDriveImport/action";
Expand All @@ -31,6 +32,7 @@ export const actions = {
[move.action.name]: move.action,
[googleDriveImport.action.name]: googleDriveImport.action,
[datacite.action.name]: datacite.action,
[buildJournalSite.action.name]: buildJournalSite.action,
} as const;

export const getActionByName = <N extends keyof typeof actions>(name: N) => {
Expand Down
28 changes: 28 additions & 0 deletions core/actions/buildJournalSite/action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Book } from "lucide-react";
import * as z from "zod";

import { Action } from "db/public";
import { FileText } from "ui/icon";

import { fieldName } from "../_lib/zodTypes";
import { defineAction } from "../types";

const schema = z.object({
token: z.string().describe("The token for the site builder"),
articles: fieldName(),
collections: fieldName(),
mainColor: fieldName(),
accentColor: fieldName(),
});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are not actually used, but we should do so in the future (or find some other way to configure it)


export const action = defineAction({
name: Action.buildJournalSite,
config: {
schema,
},
description: "Build a journal site and receive a zip file",
params: {
schema: schema.partial(),
},
icon: Book,
});
Loading
Loading