Skip to content

docs: refactor docs to use VitePress#1132

Merged
Shinigami92 merged 45 commits into
salsita:mainfrom
brenoepics:patch-2
Apr 30, 2024
Merged

docs: refactor docs to use VitePress#1132
Shinigami92 merged 45 commits into
salsita:mainfrom
brenoepics:patch-2

Conversation

@brenoepics

Copy link
Copy Markdown
Collaborator

This is a work in progress for the VP docs. Most of it is complete, but we need to make some decisions before I proceed.

  • Should I include a logo and/or favicon?
  • Are we using the default colors from VitePress for backgrounds and brand color, or do we have specific ones?
  • Currently, I have implemented local search. Are we planning to use Algolia for search functionality?
  • What do you prefer, migration pages as it was here or this new way I've done using alerts, tables..
  • Is there any feature list to home page or should I remove it?

Additionally, before merging, please remember to update the repository settings to deploy from actions rather than the branch.
image

demo: https://brenoepics.github.io/node-pg-migrate/

@Shinigami92 Shinigami92 added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent labels Apr 27, 2024
@Shinigami92 Shinigami92 added this to the vAnytime milestone Apr 27, 2024
@Shinigami92

Copy link
Copy Markdown
Collaborator

Should I include a logo and/or favicon?

I think we could use either the default Postgres Logo, or a modified version of it if you can provide such.

Are we using the default colors from VitePress for backgrounds and brand color, or do we have specific ones?

I would like to try an orange-brown text color.
The idea is coming from https://salsita.github.io/node-pg-migrate/#/migrations & https://knexjs.org/guide/
The light or dark mode background could stay for now as is / default.

Currently, I have implemented local search. Are we planning to use Algolia for search functionality?

For the start we should use local search, algolia could be enabled later in a separate PR.

What do you prefer, migration pages as it was here or this new way I've done using alerts, tables..

Your way is MUCH better!!! 😍
I wanted to rework them anyway 👍

Is there any feature list to home page or should I remove it?

We could do e.g. write one box for up-down migration/CLI, one for typescript/programmatic support and one for ... 🤔 I don't know
Maybe "steal" from https://github.com/salsita/node-pg-migrate#explanation--goals 🙂

Comment thread docs/.vitepress/config.mts Outdated
Comment thread docs/.vitepress/config.mts Outdated
Comment thread docs/.vitepress/config.mts Outdated
Comment thread docs/src/faq/transpiling.md Outdated
Comment thread docs/src/faq/transpiling.md Outdated
Comment thread docs/src/index.md Outdated
Comment thread docs/src/index.md Outdated
Comment thread docs/src/introduction.md Outdated
Comment thread package.json Outdated
Comment thread pnpm-lock.yaml Outdated
@Shinigami92 Shinigami92 linked an issue Apr 27, 2024 that may be closed by this pull request
@brenoepics

Copy link
Copy Markdown
Collaborator Author

#913 can be closed

@Shinigami92

Copy link
Copy Markdown
Collaborator

I will do a review tomorrow ❤️

@github-actions

github-actions Bot commented Apr 28, 2024

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 95.59% (🎯 90%)
🟰 ±0%
6746 / 7057
🟢 Statements 95.59% (🎯 90%)
🟰 ±0%
6746 / 7057
🟢 Functions 95.4% (🎯 90%)
🟰 ±0%
249 / 261
🟢 Branches 89.88% (🎯 85%)
🟰 ±0%
800 / 890
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Unchanged Files
src/db.ts 87.95% 88.46% 87.5% 87.95% 66-68, 98, 101-113, 153-155
src/index.ts 100% 100% 100% 100%
src/migration.ts 75.32% 78.04% 58.33% 75.32% 63, 66-68, 70-82, 111-117, 122-158, 215-216, 241-244, 252-253, 270-273, 302-303
src/migrationBuilder.ts 97.56% 92.3% 87.5% 97.56% 354-358, 497-502, 526-527
src/runner.ts 74.22% 58.92% 80% 74.22% 41, 69-70, 79-80, 83-91, 129-130, 172-175, 184-188, 201, 205-218, 237, 239-245, 248, 261, 273-286, 289-292, 302-303, 312-314, 323, 325-334, 346-353
src/sqlMigration.ts 90.19% 100% 80% 90.19% 45-49
src/types.ts 100% 100% 100% 100%
src/operations/sql.ts 100% 100% 100% 100%
src/operations/casts/createCast.ts 100% 100% 100% 100%
src/operations/casts/dropCast.ts 100% 100% 100% 100%
src/operations/casts/index.ts 100% 100% 100% 100%
src/operations/domains/alterDomain.ts 100% 100% 100% 100%
src/operations/domains/createDomain.ts 100% 100% 100% 100%
src/operations/domains/dropDomain.ts 100% 100% 100% 100%
src/operations/domains/index.ts 100% 100% 100% 100%
src/operations/domains/renameDomain.ts 100% 100% 100% 100%
src/operations/domains/shared.ts 100% 100% 100% 100%
src/operations/extensions/createExtension.ts 100% 100% 100% 100%
src/operations/extensions/dropExtension.ts 100% 100% 100% 100%
src/operations/extensions/index.ts 100% 100% 100% 100%
src/operations/extensions/shared.ts 100% 100% 100% 100%
src/operations/functions/createFunction.ts 100% 100% 100% 100%
src/operations/functions/dropFunction.ts 100% 100% 100% 100%
src/operations/functions/index.ts 100% 100% 100% 100%
src/operations/functions/renameFunction.ts 100% 100% 100% 100%
src/operations/functions/shared.ts 100% 100% 100% 100%
src/operations/grants/grantOnSchemas.ts 100% 100% 100% 100%
src/operations/grants/grantOnTables.ts 100% 100% 100% 100%
src/operations/grants/grantRoles.ts 100% 100% 100% 100%
src/operations/grants/index.ts 100% 100% 100% 100%
src/operations/grants/revokeOnSchemas.ts 100% 100% 100% 100%
src/operations/grants/revokeOnTables.ts 100% 100% 100% 100%
src/operations/grants/revokeRoles.ts 100% 100% 100% 100%
src/operations/grants/shared.ts 98.63% 85.71% 100% 98.63% 71
src/operations/indexes/createIndex.ts 98.03% 95.23% 100% 98.03% 74-75
src/operations/indexes/dropIndex.ts 100% 100% 100% 100%
src/operations/indexes/index.ts 100% 100% 100% 100%
src/operations/indexes/shared.ts 91.17% 86.95% 100% 91.17% 22, 32-35, 47
src/operations/materializedViews/alterMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/createMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/dropMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/index.ts 100% 100% 100% 100%
src/operations/materializedViews/refreshMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/renameMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/renameMaterializedViewColumn.ts 100% 100% 100% 100%
src/operations/materializedViews/shared.ts 100% 87.5% 100% 100%
src/operations/operators/addToOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/createOperator.ts 100% 100% 100% 100%
src/operations/operators/createOperatorClass.ts 100% 83.33% 100% 100%
src/operations/operators/createOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/dropOperator.ts 100% 100% 100% 100%
src/operations/operators/dropOperatorClass.ts 100% 100% 100% 100%
src/operations/operators/dropOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/index.ts 100% 100% 100% 100%
src/operations/operators/removeFromOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/renameOperatorClass.ts 100% 100% 100% 100%
src/operations/operators/renameOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/shared.ts 90% 75% 100% 90% 24-25, 37-38
src/operations/policies/alterPolicy.ts 100% 100% 100% 100%
src/operations/policies/createPolicy.ts 100% 100% 100% 100%
src/operations/policies/dropPolicy.ts 100% 100% 100% 100%
src/operations/policies/index.ts 100% 100% 100% 100%
src/operations/policies/renamePolicy.ts 100% 100% 100% 100%
src/operations/policies/shared.ts 100% 100% 100% 100%
src/operations/roles/alterRole.ts 100% 100% 100% 100%
src/operations/roles/createRole.ts 100% 75% 100% 100%
src/operations/roles/dropRole.ts 100% 100% 100% 100%
src/operations/roles/index.ts 100% 100% 100% 100%
src/operations/roles/renameRole.ts 100% 100% 100% 100%
src/operations/roles/shared.ts 98.97% 76.92% 100% 98.97% 78
src/operations/schemas/createSchema.ts 100% 100% 100% 100%
src/operations/schemas/dropSchema.ts 100% 100% 100% 100%
src/operations/schemas/index.ts 100% 100% 100% 100%
src/operations/schemas/renameSchema.ts 100% 100% 100% 100%
src/operations/sequences/alterSequence.ts 96.87% 75% 100% 96.87% 23
src/operations/sequences/createSequence.ts 100% 100% 100% 100%
src/operations/sequences/dropSequence.ts 100% 100% 100% 100%
src/operations/sequences/index.ts 100% 100% 100% 100%
src/operations/sequences/renameSequence.ts 100% 100% 100% 100%
src/operations/sequences/shared.ts 87.67% 68.75% 100% 87.67% 41, 43-44, 49-50, 63-64, 69-70
src/operations/tables/addColumns.ts 100% 80% 100% 100%
src/operations/tables/addConstraint.ts 100% 100% 100% 100%
src/operations/tables/alterColumn.ts 92.5% 76.47% 100% 92.5% 75, 82-89
src/operations/tables/alterTable.ts 100% 100% 100% 100%
src/operations/tables/createTable.ts 90.47% 66.66% 100% 90.47% 44-48, 65, 75-76
src/operations/tables/dropColumns.ts 100% 100% 100% 100%
src/operations/tables/dropConstraint.ts 100% 100% 100% 100%
src/operations/tables/dropTable.ts 100% 100% 100% 100%
src/operations/tables/index.ts 100% 100% 100% 100%
src/operations/tables/renameColumn.ts 100% 100% 100% 100%
src/operations/tables/renameConstraint.ts 100% 100% 100% 100%
src/operations/tables/renameTable.ts 100% 100% 100% 100%
src/operations/tables/shared.ts 88.47% 78.46% 80% 88.47% 137-138, 141-142, 195-199, 224, 228-229, 248-249, 274-275, 278-285, 288-289, 426-451
src/operations/triggers/createTrigger.ts 90.83% 68.18% 100% 90.83% 53-54, 66-67, 70-71, 74-77, 113
src/operations/triggers/dropTrigger.ts 100% 100% 100% 100%
src/operations/triggers/index.ts 100% 100% 100% 100%
src/operations/triggers/renameTrigger.ts 100% 100% 100% 100%
src/operations/triggers/shared.ts 100% 100% 100% 100%
src/operations/types/addTypeAttribute.ts 100% 100% 100% 100%
src/operations/types/addTypeValue.ts 100% 100% 100% 100%
src/operations/types/createType.ts 100% 100% 100% 100%
src/operations/types/dropType.ts 100% 100% 100% 100%
src/operations/types/dropTypeAttribute.ts 100% 100% 100% 100%
src/operations/types/index.ts 100% 100% 100% 100%
src/operations/types/renameType.ts 100% 100% 100% 100%
src/operations/types/renameTypeAttribute.ts 100% 100% 100% 100%
src/operations/types/renameTypeValue.ts 100% 100% 100% 100%
src/operations/types/setTypeAttribute.ts 100% 100% 100% 100%
src/operations/views/alterView.ts 100% 100% 100% 100%
src/operations/views/alterViewColumn.ts 100% 100% 100% 100%
src/operations/views/createView.ts 100% 100% 100% 100%
src/operations/views/dropView.ts 100% 100% 100% 100%
src/operations/views/index.ts 100% 100% 100% 100%
src/operations/views/renameView.ts 100% 100% 100% 100%
src/operations/views/shared.ts 100% 66.66% 100% 100%
src/utils/PgLiteral.ts 96.49% 100% 66.66% 96.49% 37-38
src/utils/StringIdGenerator.ts 100% 100% 100% 100%
src/utils/createSchemalize.ts 100% 100% 100% 100%
src/utils/createTransformer.ts 100% 100% 100% 100%
src/utils/decamelize.ts 100% 100% 100% 100%
src/utils/escapeValue.ts 100% 100% 100% 100%
src/utils/formatLines.ts 100% 100% 100% 100%
src/utils/formatParams.ts 100% 100% 100% 100%
src/utils/getMigrationTableSchema.ts 100% 100% 100% 100%
src/utils/getSchemas.ts 100% 100% 100% 100%
src/utils/identity.ts 100% 100% 100% 100%
src/utils/index.ts 100% 100% 100% 100%
src/utils/intersection.ts 100% 100% 100% 100%
src/utils/makeComment.ts 100% 100% 100% 100%
src/utils/quote.ts 100% 100% 100% 100%
src/utils/toArray.ts 100% 100% 100% 100%
src/utils/types.ts 100% 100% 100% 100%
Generated in workflow #714

@Shinigami92

Copy link
Copy Markdown
Collaborator

I had a first look and this is SO MUCH STRAIGHT UP BETTER 🤩
OH MY GOD thx 🙏

I see there is still much todo for some more to-table conversions
Let me know if I should merge something in between or if I should just wait until you mark the PR as ready-for-review

I also made some minor changes in terms of preferred style in docs.yml

@Shinigami92

Copy link
Copy Markdown
Collaborator

I invited you to the repo with granted "write" access, so you can (if you want to) help maintaining the documentation further in the future for inside the repo

@brenoepics

Copy link
Copy Markdown
Collaborator Author

ok thx, the migration to vitepress is almost complete, just need to refactor some migration pages to tables, you can merge to avoid conflicts and I'll be updating the migrations until they're all more readable

@brenoepics
brenoepics marked this pull request as ready for review April 29, 2024 21:55
@Shinigami92

Shinigami92 commented Apr 30, 2024

Copy link
Copy Markdown
Collaborator

ok thx, the migration to vitepress is almost complete, just need to refactor some migration pages to tables, you can merge to avoid conflicts and I'll be updating the migrations until they're all more readable

Yeah I will do so 👍

You got an invite to the repo, so if you like, you can then remove your fork, re-clone from origin (salsita/node-pg-migrate) and then do PRs from there. This improves co-working from my side if needed.

@Shinigami92
Shinigami92 merged commit 357c911 into salsita:main Apr 30, 2024
@Shinigami92

Copy link
Copy Markdown
Collaborator

"deploy from actions" activated

@brenoepics
brenoepics deleted the patch-2 branch May 29, 2025 07:47
acoulton added a commit to acoulton/node-pg-migrate that referenced this pull request May 14, 2026
The documentation currently shows that JSON config options should be given in camelCase.

However, this is incorrect - [readJson uses the same keys as the CLI argument values](https://github.com/salsita/node-pg-migrate/blob/main/bin/node-pg-migrate.ts#L325). 

So for example `"migrationsDir": "migrations"` will never be applied, it should instead be `"migrations-dir": "migrations"`. It looks like this has always been the case - the old documentation  mentions using the CLI argument names but this was replaced with a JSON example when the docs were rewritten in salsita#1132.

I have also added an example showing the support for using different config sections and the `-config-value` flag, which is not currently documented AFAICS.
Shinigami92 pushed a commit to acoulton/node-pg-migrate that referenced this pull request May 29, 2026
The documentation currently shows that JSON config options should be given in camelCase.

However, this is incorrect - [readJson uses the same keys as the CLI argument values](https://github.com/salsita/node-pg-migrate/blob/main/bin/node-pg-migrate.ts#L325). 

So for example `"migrationsDir": "migrations"` will never be applied, it should instead be `"migrations-dir": "migrations"`. It looks like this has always been the case - the old documentation  mentions using the CLI argument names but this was replaced with a JSON example when the docs were rewritten in salsita#1132.

I have also added an example showing the support for using different config sections and the `-config-value` flag, which is not currently documented AFAICS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: docs Improvements or additions to documentation p: 1-normal Nothing urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite full documentation to VitePress

2 participants