studiocms 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -0
- package/dist/cli/add/index.d.ts +2 -2
- package/dist/cli/add/index.js +4 -3
- package/dist/cli/add/npm-utils.d.ts +6 -6
- package/dist/cli/add/tryToInstallPlugins.d.ts +1 -1
- package/dist/cli/add/tryToInstallPlugins.js +6 -5
- package/dist/cli/add/updateStudioCMSConfig.d.ts +1 -1
- package/dist/cli/add/updateStudioCMSConfig.js +3 -4
- package/dist/cli/add/validatePlugins.d.ts +1 -2
- package/dist/cli/add/validatePlugins.js +15 -9
- package/dist/cli/crypto/genJWT/index.d.ts +1 -1
- package/dist/cli/crypto/genJWT/index.js +8 -9
- package/dist/cli/crypto/index.d.ts +1 -1
- package/dist/cli/init/steps/env.js +14 -4
- package/dist/cli/init/steps/next.d.ts +1 -1
- package/dist/cli/init/steps/next.js +6 -5
- package/dist/cli/migrator/index.d.ts +1 -1
- package/dist/cli/migrator/index.js +2 -2
- package/dist/cli/users/index.d.ts +1 -1
- package/dist/cli/users/shared.js +2 -2
- package/dist/cli/users/steps/createUsers.js +7 -7
- package/dist/cli/users/steps/modifyUsers.js +2 -2
- package/dist/cli/users/steps/next.d.ts +1 -1
- package/dist/cli/utils/checkRequiredEnvVars.js +2 -2
- package/dist/cli/utils/context.d.ts +2 -4
- package/dist/cli/utils/context.js +1 -3
- package/dist/cli/utils/getCliDbClient.d.ts +1 -1
- package/dist/cli/utils/intro.d.ts +1 -1
- package/dist/cli/utils/loadConfig.d.ts +54 -49
- package/dist/cli/utils/loadConfig.js +5 -8
- package/dist/cli/utils/logger.js +3 -3
- package/dist/cli/utils/user-utils.d.ts +1 -1
- package/dist/cli/utils/user-utils.js +4 -3
- package/dist/client/apiClient.d.ts +4923 -0
- package/dist/client/apiClient.js +72 -0
- package/dist/config.d.ts +1734 -1
- package/dist/consts.d.ts +5 -5
- package/dist/consts.js +3 -2
- package/dist/db/plugins.d.ts +1 -1
- package/dist/db/plugins.js +5 -8
- package/dist/handlers/frontend/routes.d.ts +4 -18
- package/dist/handlers/frontend/routes.js +13 -152
- package/dist/handlers/frontend/types.d.ts +1 -1
- package/dist/handlers/frontend/utils.js +0 -18
- package/dist/handlers/pluginHandler.d.ts +34 -257
- package/dist/handlers/pluginHandler.js +92 -46
- package/dist/handlers/routeHandler.js +32 -11
- package/dist/handlers/setupDbStudio.d.ts +3 -1
- package/dist/handlers/setupDbStudio.js +19 -10
- package/dist/handlers/storage-manager/core/effectify-astro-context.d.ts +25 -0
- package/dist/handlers/storage-manager/core/effectify-astro-context.js +78 -0
- package/dist/handlers/storage-manager/no-op.d.ts +2 -2
- package/dist/handlers/storage-manager/no-op.js +2 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +10 -20
- package/dist/integrations/robots/index.d.ts +2 -2
- package/dist/integrations/robots/index.js +1 -3
- package/dist/integrations/robots/schema.d.ts +102 -273
- package/dist/integrations/robots/schema.js +220 -209
- package/dist/plugins/analytics/assets/schemas.d.ts +14 -9
- package/dist/plugins/analytics/assets/schemas.js +25 -17
- package/dist/plugins/analytics/db-client.d.ts +1 -1
- package/dist/plugins/analytics/index.d.ts +823 -3
- package/dist/plugins/analytics/index.js +4 -5
- package/dist/plugins/analytics/schemas.d.ts +54 -62
- package/dist/plugins/analytics/schemas.js +64 -13
- package/dist/plugins/analytics/table.d.ts +1 -1
- package/dist/plugins.d.ts +0 -1
- package/dist/schemas/config/api.d.ts +17 -0
- package/dist/schemas/config/api.js +14 -0
- package/dist/schemas/config/auth.d.ts +55 -59
- package/dist/schemas/config/auth.js +34 -11
- package/dist/schemas/config/dashboard.d.ts +43 -79
- package/dist/schemas/config/dashboard.js +43 -12
- package/dist/schemas/config/db.d.ts +15 -17
- package/dist/schemas/config/db.js +13 -5
- package/dist/schemas/config/developer.d.ts +33 -45
- package/dist/schemas/config/developer.js +22 -5
- package/dist/schemas/config/index.d.ts +398 -521
- package/dist/schemas/config/index.js +115 -57
- package/dist/schemas/config/sdk.d.ts +50 -196
- package/dist/schemas/config/sdk.js +61 -73
- package/dist/schemas/custom.d.ts +40 -0
- package/dist/schemas/custom.js +41 -0
- package/dist/schemas/external-schemas.d.ts +171 -0
- package/dist/schemas/external-schemas.js +179 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/plugins/i18n.d.ts +59 -39
- package/dist/schemas/plugins/i18n.js +42 -5
- package/dist/schemas/plugins/index.d.ts +7126 -10296
- package/dist/schemas/plugins/index.js +260 -276
- package/dist/schemas/plugins/shared.d.ts +1293 -3718
- package/dist/schemas/plugins/shared.js +320 -329
- package/dist/test-utils.d.ts +15 -4
- package/dist/test-utils.js +27 -11
- package/dist/toolbar/db-viewer/db-shared-types.d.ts +6 -6
- package/dist/toolbar/db-viewer/studio/connection.d.ts +8 -4
- package/dist/toolbar/db-viewer/studio/connection.js +2 -28
- package/dist/toolbar/db-viewer/studio/env/libsql.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/libsql.js +17 -0
- package/dist/toolbar/db-viewer/studio/env/mysql.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/mysql.js +23 -0
- package/dist/toolbar/db-viewer/studio/env/postgres.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/postgres.js +23 -0
- package/dist/toolbar/db-viewer/studio/index.js +20 -56
- package/dist/toolbar/db-viewer/studio/type.d.ts +1 -2
- package/dist/toolbar/db-viewer/studio/virtual-connection/libsql.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/libsql.js +24 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/mysql.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/mysql.js +9 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/postgres.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/postgres.js +9 -0
- package/dist/toolbar/db-viewer/viewer.js +20 -21
- package/dist/types.d.ts +30 -0
- package/dist/utils/effects/smtp.d.ts +1 -1
- package/dist/utils/lang-helper.d.ts +10 -2
- package/dist/virtual.d.ts +35 -28
- package/dist/virtuals/auth/core.d.ts +5 -5
- package/dist/virtuals/auth/verify-email.d.ts +6 -6
- package/dist/virtuals/components/Generator.astro +2 -2
- package/dist/virtuals/components/Renderer.astro +9 -1
- package/dist/virtuals/components/renderFn.d.ts +3 -1
- package/dist/virtuals/components/renderFn.js +18 -0
- package/dist/virtuals/lib/headDefaults.d.ts +4 -2
- package/dist/virtuals/lib/headDefaults.js +0 -2
- package/dist/virtuals/lib/routeMap.d.ts +0 -12
- package/dist/virtuals/lib/routeMap.js +2 -14
- package/dist/virtuals/mailer/index.d.ts +3 -3
- package/dist/virtuals/notifier/index.d.ts +5 -5
- package/dist/virtuals/plugins/dashboard-pages.d.ts +2 -64
- package/dist/virtuals/scripts/StorageFileBrowser.d.ts +1 -172
- package/dist/virtuals/scripts/StorageFileBrowser.js +216 -119
- package/dist/virtuals/template-engine/index.d.ts +4 -4
- package/frontend/components/dashboard/configuration/ConfigForm.astro +218 -110
- package/frontend/components/dashboard/content-mgmt/ContentSearch.astro +21 -22
- package/frontend/components/dashboard/content-mgmt/CreateFolder.astro +66 -54
- package/frontend/components/dashboard/content-mgmt/CreatePage.astro +58 -104
- package/frontend/components/dashboard/content-mgmt/EditFolder.astro +65 -67
- package/frontend/components/dashboard/content-mgmt/EditPage.astro +86 -134
- package/frontend/components/dashboard/content-mgmt/InnerSidebarElement.astro +0 -1
- package/frontend/components/dashboard/content-mgmt/PageHeader.astro +33 -52
- package/frontend/components/dashboard/content-mgmt/PageTypeHandler.astro +2 -2
- package/frontend/components/dashboard/profile/APITokens.astro +219 -158
- package/frontend/components/dashboard/profile/BasicInfo.astro +165 -106
- package/frontend/components/dashboard/profile/Notifications.astro +27 -18
- package/frontend/components/dashboard/profile/UpdatePassword.astro +134 -94
- package/frontend/components/dashboard/sidebar/VersionCheck.astro +31 -16
- package/frontend/components/dashboard/sidebar/VersionCheckChangelog.astro +18 -11
- package/frontend/components/dashboard/sidebar-modals/VersionModal.astro +2 -2
- package/frontend/components/dashboard/smtp-config/TemplateEditor.astro +14 -14
- package/frontend/components/dashboard/taxonomy/InnerSidebarElement.astro +0 -1
- package/frontend/components/dashboard/taxonomy/MetaContainer.astro +0 -2
- package/frontend/components/dashboard/taxonomy/PageHeader.astro +16 -24
- package/frontend/components/dashboard/taxonomy/TaxonomySearch.astro +23 -27
- package/frontend/components/dashboard/user-mgmt/InnerSidebarElement.astro +111 -104
- package/frontend/components/dashboard/user-mgmt/UserListItem.astro +9 -22
- package/frontend/components/dashboard/user-mgmt/UserListItems.astro +18 -0
- package/frontend/components/first-time-setup/snippets/{opt2-studiocms.config.diff → studiocms.config.diff} +1 -0
- package/frontend/components/shared/Code.astro +1 -4
- package/frontend/components/shared/DynamicSettingsRenderer.astro +1 -1
- package/frontend/components/shared/SSRUser.astro +2 -4
- package/frontend/components/shared/foldertree/FolderTreeNode.astro +0 -6
- package/frontend/components/shared/storage-manager/StorageCopyOutput.astro +0 -1
- package/frontend/components/shared/taxonomy/TaxonomyTreeNode.astro +0 -6
- package/frontend/layouts/DashboardLayout.astro +1 -10
- package/frontend/layouts/TaxonomyLayout.astro +0 -1
- package/frontend/middleware/index.ts +102 -61
- package/frontend/pages/404.astro +5 -9
- package/frontend/pages/[dashboard]/[...pluginPage].astro +10 -1
- package/frontend/pages/[dashboard]/configuration.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/createfolder.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/createpage.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/diff.astro +39 -14
- package/frontend/pages/[dashboard]/content-management/editfolder.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/editpage.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/index.astro +10 -1
- package/frontend/pages/[dashboard]/index.astro +10 -1
- package/frontend/pages/[dashboard]/login.astro +86 -25
- package/frontend/pages/[dashboard]/password-reset.astro +22 -16
- package/frontend/pages/[dashboard]/plugins/[plugin].astro +10 -1
- package/frontend/pages/[dashboard]/profile.astro +10 -1
- package/frontend/pages/[dashboard]/signup.astro +153 -52
- package/frontend/pages/[dashboard]/smtp-configuration.astro +77 -75
- package/frontend/pages/[dashboard]/system-management.astro +10 -1
- package/frontend/pages/[dashboard]/taxonomy/categories.astro +30 -41
- package/frontend/pages/[dashboard]/taxonomy/index.astro +10 -0
- package/frontend/pages/[dashboard]/taxonomy/tags.astro +33 -43
- package/frontend/pages/[dashboard]/unverified-email.astro +29 -21
- package/frontend/pages/[dashboard]/user-management/edit.astro +170 -90
- package/frontend/pages/[dashboard]/user-management/index.astro +10 -1
- package/frontend/pages/studiocms_api/[...all].ts +106 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/auth.ts +26 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/changelog.ts +147 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/db-studio-driver.ts +46 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/parseLogLevel.ts +27 -0
- package/frontend/pages/studiocms_api/_handlers/auth/auth.ts +459 -0
- package/frontend/pages/studiocms_api/_handlers/auth/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/auth/oauth.ts +91 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/_shared.ts +57 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/apiTokens.ts +134 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/config.ts +64 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/content.ts +741 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/create.ts +480 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/emailNotifications.ts +49 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/index.ts +45 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/mailer.ts +136 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/plugins.ts +80 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/profile.ts +275 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/resetPassword.ts +140 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/search.ts +63 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/taxonomy.ts +285 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/templates.ts +75 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/users.ts +312 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/verifyEndpoints.ts +307 -0
- package/frontend/pages/studiocms_api/_handlers/integration/dbStudio.ts +98 -0
- package/frontend/pages/studiocms_api/_handlers/integration/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/integration/storageManager.ts +107 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/index.ts +8 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/_shared.ts +41 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/public.ts +195 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/secure.ts +1726 -0
- package/frontend/pages/studiocms_api/_handlers/sdk.ts +129 -0
- package/frontend/pages/studiocms_api/_middleware/astroLocals.ts +36 -0
- package/frontend/pages/studiocms_api/_middleware/restApi.ts +56 -0
- package/frontend/pages/studiocms_api/integrations/[...all].ts +8 -0
- package/frontend/scripts/formdata.ts +219 -0
- package/frontend/setup-pages/3-done.astro +4 -20
- package/frontend/setup-pages/studiocms_api/dashboard/step-2.ts +3 -6
- package/frontend/styles/dashboard-base.css +0 -1
- package/frontend/web-vitals/endpoint.ts +2 -1
- package/package.json +35 -31
- package/dist/global.d.ts +0 -9
- package/frontend/components/dashboard/LoginChecker.astro +0 -68
- package/frontend/components/dashboard/user-mgmt/RankCheck.astro +0 -57
- package/frontend/components/first-time-setup/snippets/opt1-astro.config.diff +0 -14
- package/frontend/components/first-time-setup/snippets/opt2-astro.config.diff +0 -9
- package/frontend/middleware/_authmap.ts +0 -63
- package/frontend/pages/studiocms_api/auth/[path].ts +0 -390
- package/frontend/pages/studiocms_api/auth/[provider]/[...id].ts +0 -64
- package/frontend/pages/studiocms_api/auth/[provider]/_effects/index.ts +0 -101
- package/frontend/pages/studiocms_api/auth/_shared.ts +0 -52
- package/frontend/pages/studiocms_api/dashboard/api-tokens.ts +0 -115
- package/frontend/pages/studiocms_api/dashboard/config.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/content/diff.ts +0 -73
- package/frontend/pages/studiocms_api/dashboard/content/folder.ts +0 -220
- package/frontend/pages/studiocms_api/dashboard/content/page.ts +0 -359
- package/frontend/pages/studiocms_api/dashboard/create-reset-link.ts +0 -77
- package/frontend/pages/studiocms_api/dashboard/create-user-invite.ts +0 -231
- package/frontend/pages/studiocms_api/dashboard/create-user.ts +0 -186
- package/frontend/pages/studiocms_api/dashboard/email-notification-settings-site.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/mailer/check-email.ts +0 -75
- package/frontend/pages/studiocms_api/dashboard/mailer/config.ts +0 -136
- package/frontend/pages/studiocms_api/dashboard/plugins/[plugin].ts +0 -80
- package/frontend/pages/studiocms_api/dashboard/profile.ts +0 -245
- package/frontend/pages/studiocms_api/dashboard/resend-verify-email.ts +0 -77
- package/frontend/pages/studiocms_api/dashboard/reset-password.ts +0 -124
- package/frontend/pages/studiocms_api/dashboard/search-list.ts +0 -59
- package/frontend/pages/studiocms_api/dashboard/taxonomy-search.ts +0 -47
- package/frontend/pages/studiocms_api/dashboard/taxonomy.ts +0 -230
- package/frontend/pages/studiocms_api/dashboard/templates.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/update-user-notifications.ts +0 -86
- package/frontend/pages/studiocms_api/dashboard/users.ts +0 -236
- package/frontend/pages/studiocms_api/dashboard/verify-email.ts +0 -83
- package/frontend/pages/studiocms_api/dashboard/verify-session.ts +0 -187
- package/frontend/pages/studiocms_api/integrations/[type]/[...id].ts +0 -15
- package/frontend/pages/studiocms_api/integrations/[type]/_routes/db-studio.ts +0 -173
- package/frontend/pages/studiocms_api/integrations/[type]/_routes/storage.ts +0 -88
- package/frontend/pages/studiocms_api/partials/editor.astro +0 -74
- package/frontend/pages/studiocms_api/partials/render.astro +0 -39
- package/frontend/pages/studiocms_api/partials/user-list-items.astro +0 -43
- package/frontend/pages/studiocms_api/rest/utils/auth-token.ts +0 -59
- package/frontend/pages/studiocms_api/rest/v1/[type]/[...id].ts +0 -23
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/categories.ts +0 -267
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/folders.ts +0 -283
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/pages.ts +0 -505
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/settings.ts +0 -100
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/tags.ts +0 -229
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/users.ts +0 -553
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/[...id].ts +0 -19
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/categories.ts +0 -74
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/folders.ts +0 -85
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/pages.ts +0 -103
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/tags.ts +0 -67
- package/frontend/pages/studiocms_api/sdk/[...path].ts +0 -97
- package/frontend/pages/studiocms_api/sdk/utils/changelog.ts +0 -119
- package/frontend/scripts/auth/formListener.ts +0 -81
- package/frontend/scripts/formdata-utils.ts +0 -116
- package/frontend/utils/build-partial-schema.ts +0 -46
- package/frontend/utils/errors.ts +0 -6
- package/frontend/utils/param-extractor.ts +0 -83
- package/frontend/utils/rest-router.ts +0 -444
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,127 @@
|
|
|
1
1
|
# studiocms
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1401](https://github.com/withstudiocms/studiocms/pull/1401) [`de6bb17`](https://github.com/withstudiocms/studiocms/commit/de6bb17d75f74d91776658cf1a608eebe94be495) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Migrates RestAPI to utilize new API-Spec package for better type safety
|
|
8
|
+
|
|
9
|
+
- [#1421](https://github.com/withstudiocms/studiocms/pull/1421) [`d7a0217`](https://github.com/withstudiocms/studiocms/commit/d7a0217e5ece55eddfa34399075614bef2041052) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Removes deprecated and unused SDK listpages endpoint, and updates the changelog json endpoint to not use .json in the pathname
|
|
10
|
+
|
|
11
|
+
- [#1433](https://github.com/withstudiocms/studiocms/pull/1433) [`64ff643`](https://github.com/withstudiocms/studiocms/commit/64ff64357f5e34960a2a044d427350bcba389304) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Migrates StorageFileBrowser script to utilize new API spec client for typesafe API interactions
|
|
12
|
+
|
|
13
|
+
- [#1440](https://github.com/withstudiocms/studiocms/pull/1440) [`9eec9c3`](https://github.com/withstudiocms/studiocms/commit/9eec9c3b45523b635cfe16d55aa55afabacbebe3) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Introduces new admin level api token revocation endpoint
|
|
14
|
+
|
|
15
|
+
- [#1438](https://github.com/withstudiocms/studiocms/pull/1438) [`f4a209f`](https://github.com/withstudiocms/studiocms/commit/f4a209fc090c90195e2419fff47b48a46eab7441) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactors and cleans up API spec handlers to remove un-needed variables and tighten security
|
|
16
|
+
|
|
17
|
+
- [#1448](https://github.com/withstudiocms/studiocms/pull/1448) [`35a1984`](https://github.com/withstudiocms/studiocms/commit/35a19845b30b6eed5b1273a40d99d9b405eeab9f) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Deprecates the `studiocmsMinimumVersion` setting from the plugins API, it is recommended to rely on `peerDependencies` instead.
|
|
18
|
+
|
|
19
|
+
- [#1322](https://github.com/withstudiocms/studiocms/pull/1322) [`0ae47b0`](https://github.com/withstudiocms/studiocms/commit/0ae47b06a4ff03ed9cdf01b136e1a50f4c8c4add) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Migrate from Zod Schemas to Effect Schemas
|
|
20
|
+
|
|
21
|
+
- [#1342](https://github.com/withstudiocms/studiocms/pull/1342) [`7773e9c`](https://github.com/withstudiocms/studiocms/commit/7773e9c094802d678edb89540b82744db7a4dcbd) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Moves to new data-middleware system for being able to handle dynamic authentication checks.
|
|
22
|
+
|
|
23
|
+
- [#1375](https://github.com/withstudiocms/studiocms/pull/1375) [`c9f32d0`](https://github.com/withstudiocms/studiocms/commit/c9f32d07ab88fdd11806ace656748494b5a782ec) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Extends rendering functionality to allow site-wide post-processors, or single page post-processors (augments)
|
|
24
|
+
|
|
25
|
+
- [#1430](https://github.com/withstudiocms/studiocms/pull/1430) [`a78f6d5`](https://github.com/withstudiocms/studiocms/commit/a78f6d513b0fc2bd7aa83837624460452a38539e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Migrates dashboard components to use new api spec clients
|
|
26
|
+
|
|
27
|
+
- [#1434](https://github.com/withstudiocms/studiocms/pull/1434) [`ef7197e`](https://github.com/withstudiocms/studiocms/commit/ef7197ed9ca8dff757e9e791b0452279aa3791ad) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Adds SDK utility endpoints for markdown rendering and user-list HTML, replacing legacy page partial routes.
|
|
28
|
+
Consumers now go through the SDK utilities for these renders, and the markdown render route is POST-based.
|
|
29
|
+
|
|
30
|
+
- [#1373](https://github.com/withstudiocms/studiocms/pull/1373) [`5d6ec77`](https://github.com/withstudiocms/studiocms/commit/5d6ec77bd7105118239fbd015f182e381dbfcb2c) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Reworks API handling and migrates to Effect HttpApi Spec
|
|
31
|
+
|
|
32
|
+
- [#1429](https://github.com/withstudiocms/studiocms/pull/1429) [`1cc8957`](https://github.com/withstudiocms/studiocms/commit/1cc8957db3f1e3af2c5f4763103a0d7d46aa1c6d) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Migrates various frontend pages to utilize new dashboard API client
|
|
33
|
+
|
|
34
|
+
- [#1374](https://github.com/withstudiocms/studiocms/pull/1374) [`33d3c2b`](https://github.com/withstudiocms/studiocms/commit/33d3c2bf91cf39abc15b5df136c9eeb01b1ba317) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Migrates frontend utils to use new API spec for SDK and Auth endpoints
|
|
35
|
+
|
|
36
|
+
- [#1307](https://github.com/withstudiocms/studiocms/pull/1307) [`a855f94`](https://github.com/withstudiocms/studiocms/commit/a855f94e40b24c938dc09cdbacb72fee5a8a012a) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - New Effect Schema based validation for plugin schemas
|
|
37
|
+
|
|
38
|
+
- [#1322](https://github.com/withstudiocms/studiocms/pull/1322) [`0ae47b0`](https://github.com/withstudiocms/studiocms/commit/0ae47b06a4ff03ed9cdf01b136e1a50f4c8c4add) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update Plugin hooks to align with new schemas
|
|
39
|
+
|
|
40
|
+
- [#1311](https://github.com/withstudiocms/studiocms/pull/1311) [`2d2ff4e`](https://github.com/withstudiocms/studiocms/commit/2d2ff4e180e23215dcd4f95aa850a1844e0569a8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implements new Effect-based config schemas
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [#1351](https://github.com/withstudiocms/studiocms/pull/1351) [`94b6d4f`](https://github.com/withstudiocms/studiocms/commit/94b6d4f53d40d95ae7238fb91839174d61f43c8b) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fixes folder deletion schema calls that caused folder deletion to return a server error
|
|
45
|
+
|
|
46
|
+
- [#1381](https://github.com/withstudiocms/studiocms/pull/1381) [`07b3508`](https://github.com/withstudiocms/studiocms/commit/07b35088c55a817a218b1568dd9d3f418b01a26d) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Deduplicates API spec definitions and expands LocalsSessionData middleware context data
|
|
47
|
+
|
|
48
|
+
- [#1287](https://github.com/withstudiocms/studiocms/pull/1287) [`2ea1074`](https://github.com/withstudiocms/studiocms/commit/2ea107448571e1d42bf0d21dd832b1e71e464a51) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update studiocms dependencies
|
|
49
|
+
|
|
50
|
+
- [#1336](https://github.com/withstudiocms/studiocms/pull/1336) [`e85f46b`](https://github.com/withstudiocms/studiocms/commit/e85f46b6453b7a8abfdda7d1046399a1dbc99df6) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @inox-tools/runtime-logger to ^0.8.1
|
|
51
|
+
|
|
52
|
+
- [#1385](https://github.com/withstudiocms/studiocms/pull/1385) [`9ef4b85`](https://github.com/withstudiocms/studiocms/commit/9ef4b854ed5915d7653059154798adce4abca859) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @iconify-json/simple-icons to ^1.2.71
|
|
53
|
+
|
|
54
|
+
- [#1402](https://github.com/withstudiocms/studiocms/pull/1402) [`2123645`](https://github.com/withstudiocms/studiocms/commit/2123645553911c3b1f97958e67f9c5f14c47d5f5) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency nanostores to ^1.1.1
|
|
55
|
+
|
|
56
|
+
- [#1442](https://github.com/withstudiocms/studiocms/pull/1442) [`ea2298e`](https://github.com/withstudiocms/studiocms/commit/ea2298e10a94a5334e75f9af806d9a03195206c8) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @iconify-json/simple-icons to ^1.2.72
|
|
57
|
+
|
|
58
|
+
- [#1453](https://github.com/withstudiocms/studiocms/pull/1453) [`fb59e23`](https://github.com/withstudiocms/studiocms/commit/fb59e23b3d906b69b8c53430ae594a5d895180d5) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update studiocms dependencies
|
|
59
|
+
|
|
60
|
+
- [#1352](https://github.com/withstudiocms/studiocms/pull/1352) [`27fd734`](https://github.com/withstudiocms/studiocms/commit/27fd73476ccd06f4e8ec6b8a64d86319f21b083a) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fixes outdated done page instructions
|
|
61
|
+
|
|
62
|
+
- [#1446](https://github.com/withstudiocms/studiocms/pull/1446) [`7d2ebfb`](https://github.com/withstudiocms/studiocms/commit/7d2ebfb35a77982b31a7edc95bce01223f77cf15) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Code cleanup and OCD, purges dead and unused code
|
|
63
|
+
|
|
64
|
+
- [#1441](https://github.com/withstudiocms/studiocms/pull/1441) [`39e367d`](https://github.com/withstudiocms/studiocms/commit/39e367d1433ef577b018586b347216df92e21d20) Thanks [@renovate](https://github.com/apps/renovate)! - fixes CSS lint error with duplicate CSS variable
|
|
65
|
+
|
|
66
|
+
- [#1422](https://github.com/withstudiocms/studiocms/pull/1422) [`de78276`](https://github.com/withstudiocms/studiocms/commit/de78276f1f940be413a1510aa57cc4caa2aac6fd) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Ensures proper permissions for API route, and updates client script to align with new API spec
|
|
67
|
+
|
|
68
|
+
- [#1353](https://github.com/withstudiocms/studiocms/pull/1353) [`54d5a3e`](https://github.com/withstudiocms/studiocms/commit/54d5a3eaec5b6bf3d75c190cf31f80ca27ebd96e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fixes `studiocms init` optional option parsing
|
|
69
|
+
|
|
70
|
+
- [#1281](https://github.com/withstudiocms/studiocms/pull/1281) [`b5d5719`](https://github.com/withstudiocms/studiocms/commit/b5d5719b612545622813f1a944313e61a08e50f8) Thanks [@renovate](https://github.com/apps/renovate)! - lint
|
|
71
|
+
|
|
72
|
+
- [#1420](https://github.com/withstudiocms/studiocms/pull/1420) [`139b3a6`](https://github.com/withstudiocms/studiocms/commit/139b3a6820c848c9052e319f53a855172e023091) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Adds new config option for built-in API spec docs available in studiocms config as a boolean option `features.api.apiDocs`
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [[`a67bcc0`](https://github.com/withstudiocms/studiocms/commit/a67bcc0967c49d366552b76ce1f061472020ade6), [`d7a0217`](https://github.com/withstudiocms/studiocms/commit/d7a0217e5ece55eddfa34399075614bef2041052), [`48a5334`](https://github.com/withstudiocms/studiocms/commit/48a5334051252f4f1192faa9023d56a41f9fe95c), [`07b3508`](https://github.com/withstudiocms/studiocms/commit/07b35088c55a817a218b1568dd9d3f418b01a26d), [`6280e24`](https://github.com/withstudiocms/studiocms/commit/6280e246369fa9732978a335ea6ddc3178f75e71), [`9a1180c`](https://github.com/withstudiocms/studiocms/commit/9a1180c6fe1e09599aa63a323ffcc4ba081a6e16), [`fbb5e47`](https://github.com/withstudiocms/studiocms/commit/fbb5e4749674ff4fd0593f37ae29614061d1f362), [`b7b76cb`](https://github.com/withstudiocms/studiocms/commit/b7b76cbb8e3b4ea4fe7f0d86e4f57acac47a94fe), [`3cff26c`](https://github.com/withstudiocms/studiocms/commit/3cff26c53e7b8ec1781ec7c390666a0276f50c46), [`5c0c17b`](https://github.com/withstudiocms/studiocms/commit/5c0c17b17a65046bcb93654d8bd7b0bfdad4c773), [`ff4e543`](https://github.com/withstudiocms/studiocms/commit/ff4e543a516350cd4139827b925061d8355d4932), [`ba50598`](https://github.com/withstudiocms/studiocms/commit/ba50598168030af18ccea5fedb263379507d5112), [`26d0584`](https://github.com/withstudiocms/studiocms/commit/26d05848b444cb53a26c6e89baa83203bf0398cc), [`466d3c5`](https://github.com/withstudiocms/studiocms/commit/466d3c599fdf54b95788e377cd0c817a53bb6fd3), [`d0ef542`](https://github.com/withstudiocms/studiocms/commit/d0ef542490b45bc65e276c30ae422b3386ed9f88), [`9eec9c3`](https://github.com/withstudiocms/studiocms/commit/9eec9c3b45523b635cfe16d55aa55afabacbebe3), [`f4a209f`](https://github.com/withstudiocms/studiocms/commit/f4a209fc090c90195e2419fff47b48a46eab7441), [`d0ef542`](https://github.com/withstudiocms/studiocms/commit/d0ef542490b45bc65e276c30ae422b3386ed9f88), [`6c9497d`](https://github.com/withstudiocms/studiocms/commit/6c9497d29f2dd84edc3400c1f9dda98e2aaf1ec8), [`0ae47b0`](https://github.com/withstudiocms/studiocms/commit/0ae47b06a4ff03ed9cdf01b136e1a50f4c8c4add), [`0cafedf`](https://github.com/withstudiocms/studiocms/commit/0cafedf4dee4edae1a2e859e6066365c4bea9ed5), [`de6bb17`](https://github.com/withstudiocms/studiocms/commit/de6bb17d75f74d91776658cf1a608eebe94be495), [`1e13417`](https://github.com/withstudiocms/studiocms/commit/1e1341773ea163ae25529b14877078e965899a30), [`9ea0cc9`](https://github.com/withstudiocms/studiocms/commit/9ea0cc90e69e98eb89c793f178928a3cff3f34a5), [`3cc5cff`](https://github.com/withstudiocms/studiocms/commit/3cc5cfffff082d6eaa1b928c1370e661b8cbde07), [`ef7197e`](https://github.com/withstudiocms/studiocms/commit/ef7197ed9ca8dff757e9e791b0452279aa3791ad), [`5d6ec77`](https://github.com/withstudiocms/studiocms/commit/5d6ec77bd7105118239fbd015f182e381dbfcb2c), [`33d3c2b`](https://github.com/withstudiocms/studiocms/commit/33d3c2bf91cf39abc15b5df136c9eeb01b1ba317), [`170adc4`](https://github.com/withstudiocms/studiocms/commit/170adc47216cefdce6b56e01973e3fa7812a1527), [`5d6ec77`](https://github.com/withstudiocms/studiocms/commit/5d6ec77bd7105118239fbd015f182e381dbfcb2c), [`0ae47b0`](https://github.com/withstudiocms/studiocms/commit/0ae47b06a4ff03ed9cdf01b136e1a50f4c8c4add), [`ae9ce1f`](https://github.com/withstudiocms/studiocms/commit/ae9ce1f73545a9db6b54b2bffc145a59ca598aaf), [`9eec9c3`](https://github.com/withstudiocms/studiocms/commit/9eec9c3b45523b635cfe16d55aa55afabacbebe3), [`8743206`](https://github.com/withstudiocms/studiocms/commit/87432066bf8c6788f1af0840b9a793e03d119815), [`5e56327`](https://github.com/withstudiocms/studiocms/commit/5e56327bf0084ab42eec8a59211a9f90a4611b81), [`b5d5719`](https://github.com/withstudiocms/studiocms/commit/b5d5719b612545622813f1a944313e61a08e50f8)]:
|
|
75
|
+
- @withstudiocms/effect@0.4.0
|
|
76
|
+
- effectify@0.1.0
|
|
77
|
+
- @withstudiocms/api-spec@0.3.0
|
|
78
|
+
- @withstudiocms/sdk@0.3.0
|
|
79
|
+
- @withstudiocms/cli-kit@0.2.1
|
|
80
|
+
- @withstudiocms/internal_helpers@0.2.0
|
|
81
|
+
- @withstudiocms/kysely@0.2.1
|
|
82
|
+
- @withstudiocms/config-utils@0.2.0
|
|
83
|
+
- @withstudiocms/auth-kit@0.1.4
|
|
84
|
+
- @withstudiocms/component-registry@0.1.4
|
|
85
|
+
|
|
86
|
+
## 0.3.0
|
|
87
|
+
|
|
88
|
+
### Minor Changes
|
|
89
|
+
|
|
90
|
+
- [#1254](https://github.com/withstudiocms/studiocms/pull/1254) [`180b959`](https://github.com/withstudiocms/studiocms/commit/180b95972f9d51731eb570685e251532cbae2f62) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Replaces chalk with node:util's styleText
|
|
91
|
+
|
|
92
|
+
- [#1271](https://github.com/withstudiocms/studiocms/pull/1271) [`9a450cb`](https://github.com/withstudiocms/studiocms/commit/9a450cb9167e2f2ea4c197bc812131d2fdeda6c9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Removes deprecated and unused virtual modules.
|
|
93
|
+
|
|
94
|
+
The following modules have been removed.
|
|
95
|
+
|
|
96
|
+
- `studiocms:astro-config/adapter`
|
|
97
|
+
- `studiocms:auth/utils/getLabelForPermissionLevel`
|
|
98
|
+
- `virtual:studiocms/sdk/env`
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- [#1237](https://github.com/withstudiocms/studiocms/pull/1237) [`fb6c96a`](https://github.com/withstudiocms/studiocms/commit/fb6c96ac6ae25887a0f673618770a67b2deffae6) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update studiocms dependencies
|
|
103
|
+
|
|
104
|
+
- [#1259](https://github.com/withstudiocms/studiocms/pull/1259) [`0525390`](https://github.com/withstudiocms/studiocms/commit/05253906d33a9b7bd12a27cdf2b8c9e9f693177f) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update studiocms dependencies
|
|
105
|
+
|
|
106
|
+
- [#1267](https://github.com/withstudiocms/studiocms/pull/1267) [`d56b066`](https://github.com/withstudiocms/studiocms/commit/d56b066554848d819cc3dd59cfacfbda51565ad5) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @nanostores/persistent to ^1.3.0
|
|
107
|
+
|
|
108
|
+
- [#1255](https://github.com/withstudiocms/studiocms/pull/1255) [`e12e074`](https://github.com/withstudiocms/studiocms/commit/e12e074e6432398181be1f58f5c89df96a516cbb) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix new type issues due to updated clack version
|
|
109
|
+
|
|
110
|
+
- [#1270](https://github.com/withstudiocms/studiocms/pull/1270) [`c9727f7`](https://github.com/withstudiocms/studiocms/commit/c9727f7a218113d68254de825b84ddb926721b56) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fixes issue with pg and mysql2 being required to be installed when they should be optional
|
|
111
|
+
|
|
112
|
+
- [#1272](https://github.com/withstudiocms/studiocms/pull/1272) [`38e74bb`](https://github.com/withstudiocms/studiocms/commit/38e74bbeec97e054e8545d6665452c5246a1fdd3) Thanks [@RATIU5](https://github.com/RATIU5)! - Fix client regex in frontend to allow for slashes within a slug, but not on the outside. This unblocks creating pages under sub-paths just using the slug (e.g., `docs/getting-started`) and only affects client-side validation.
|
|
113
|
+
|
|
114
|
+
- [#1265](https://github.com/withstudiocms/studiocms/pull/1265) [`6d9b601`](https://github.com/withstudiocms/studiocms/commit/6d9b601b0a29ca2221d47efa65bc1356870e0339) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Removes legacy email domain verification code
|
|
115
|
+
|
|
116
|
+
- [#1231](https://github.com/withstudiocms/studiocms/pull/1231) [`e7b39ef`](https://github.com/withstudiocms/studiocms/commit/e7b39ef6c3e1e2a54201e200b32fb1c02cd5fc3e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fixes default 404 route rendering
|
|
117
|
+
|
|
118
|
+
- Updated dependencies [[`6b826b8`](https://github.com/withstudiocms/studiocms/commit/6b826b80104fe23e35763edf275f1800e5629c32), [`8b46bf5`](https://github.com/withstudiocms/studiocms/commit/8b46bf5861f3ab884bb8cbac1b73a1e97fcabe96), [`f129eec`](https://github.com/withstudiocms/studiocms/commit/f129eec8d0a6f18c446c319dec9925cc31a890b4), [`e12e074`](https://github.com/withstudiocms/studiocms/commit/e12e074e6432398181be1f58f5c89df96a516cbb)]:
|
|
119
|
+
- @withstudiocms/internal_helpers@0.1.1
|
|
120
|
+
- @withstudiocms/effect@0.3.0
|
|
121
|
+
- @withstudiocms/auth-kit@0.1.3
|
|
122
|
+
- @withstudiocms/component-registry@0.1.3
|
|
123
|
+
- @withstudiocms/sdk@0.2.0
|
|
124
|
+
|
|
3
125
|
## 0.2.0
|
|
4
126
|
|
|
5
127
|
### Minor Changes
|
package/dist/cli/add/index.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ export declare const STUBS: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const toIdent: (name: string) => string;
|
|
21
21
|
export declare const createPrettyError: (err: Error) => Error;
|
|
22
|
-
export declare const resolveConfigPath: (root: URL) => Effect.Effect<URL | undefined, import("effect/
|
|
22
|
+
export declare const resolveConfigPath: (root: URL) => Effect.Effect<URL | undefined, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException, never>;
|
|
23
23
|
export declare function appendForwardSlash(path: string): string;
|
|
24
24
|
export declare const plugin: Cli.Args.Args<string[]>;
|
|
25
|
-
export declare const addPlugin: Cli.Command.Command<"add", never, import("effect/
|
|
25
|
+
export declare const addPlugin: Cli.Command.Command<"add", never, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("@withstudiocms/effect").DeepmergeError | import("@withstudiocms/effect/clack").ClackError | StudioCMSCliError, {
|
|
26
26
|
readonly plugin: string[];
|
|
27
27
|
}>;
|
package/dist/cli/add/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, promises as fs } from "node:fs";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { styleText } from "node:util";
|
|
3
4
|
import { cancelled, success } from "@withstudiocms/cli-kit/messages";
|
|
4
5
|
import { exists, pathToFileURL, resolveRoot } from "@withstudiocms/cli-kit/utils";
|
|
5
6
|
import { intro, note, outro } from "@withstudiocms/effect/clack";
|
|
@@ -130,7 +131,7 @@ const addPlugin = Cli.Command.make(
|
|
|
130
131
|
UpdateStudioCMSConfig,
|
|
131
132
|
genContext
|
|
132
133
|
]);
|
|
133
|
-
const { cwd
|
|
134
|
+
const { cwd } = context;
|
|
134
135
|
yield* intro("StudioCMS CLI Utilities (add)");
|
|
135
136
|
const pluginNames = plugin2.map((name) => {
|
|
136
137
|
const aliasName = ALIASES.get(name);
|
|
@@ -149,7 +150,7 @@ const addPlugin = Cli.Command.make(
|
|
|
149
150
|
case 2 /* cancelled */: {
|
|
150
151
|
yield* note(
|
|
151
152
|
cancelled(
|
|
152
|
-
`Dependencies ${
|
|
153
|
+
`Dependencies ${styleText("bold", "NOT")} installed.`,
|
|
153
154
|
"Be sure to install them manually before continuing!"
|
|
154
155
|
)
|
|
155
156
|
);
|
|
@@ -176,7 +177,7 @@ const addPlugin = Cli.Command.make(
|
|
|
176
177
|
}
|
|
177
178
|
switch (configResult) {
|
|
178
179
|
case 2 /* cancelled */: {
|
|
179
|
-
yield* outro(cancelled(`Your configuration has ${
|
|
180
|
+
yield* outro(cancelled(`Your configuration has ${styleText("bold", "NOT")} been updated.`));
|
|
180
181
|
break;
|
|
181
182
|
}
|
|
182
183
|
case 0 /* none */: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Effect } from '../../effect.js';
|
|
2
2
|
import type { PluginInfo } from './index.js';
|
|
3
|
-
export declare const getRegistry: Effect.Effect<string, import("effect/
|
|
4
|
-
export declare const fetchPackageVersions: (packageName: string) => Effect.Effect<
|
|
3
|
+
export declare const getRegistry: Effect.Effect<string, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException, never>;
|
|
4
|
+
export declare const fetchPackageVersions: (packageName: string) => Effect.Effect<string[] | Error, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException, never>;
|
|
5
5
|
/**
|
|
6
6
|
* Resolves package with a given range to a STABLE version
|
|
7
7
|
* peerDependencies might specify a compatible prerelease,
|
|
8
8
|
* but `studiocms add` should only ever install stable releases
|
|
9
9
|
*/
|
|
10
|
-
export declare const resolveRangeToInstallSpecifier: (name: string, range: string) => Effect.Effect<string, import("effect/
|
|
11
|
-
export declare const convertPluginsToInstallSpecifiers: (plugins: PluginInfo[]) => Effect.Effect<string[], import("effect/
|
|
12
|
-
export declare const fetchPackageJson: (scope: string | undefined, name: string, tag: string) => Effect.Effect<any, import("effect/
|
|
10
|
+
export declare const resolveRangeToInstallSpecifier: (name: string, range: string) => Effect.Effect<string, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException, never>;
|
|
11
|
+
export declare const convertPluginsToInstallSpecifiers: (plugins: PluginInfo[]) => Effect.Effect<string[], import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException, never>;
|
|
12
|
+
export declare const fetchPackageJson: (scope: string | undefined, name: string, tag: string) => Effect.Effect<any, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException, never>;
|
|
13
13
|
export declare const parseNpmName: (spec: string) => Effect.Effect<{
|
|
14
14
|
scope: string | undefined;
|
|
15
15
|
name: string;
|
|
@@ -19,4 +19,4 @@ export declare const parsePluginName: (spec: string) => Effect.Effect<{
|
|
|
19
19
|
scope: string | undefined;
|
|
20
20
|
name: string;
|
|
21
21
|
tag: string;
|
|
22
|
-
} | undefined, import("effect/
|
|
22
|
+
} | undefined, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException, never>;
|
|
@@ -4,7 +4,7 @@ import { StudioCMSCliError } from '../utils/errors.js';
|
|
|
4
4
|
import { type PluginInfo, UpdateResult } from './index.js';
|
|
5
5
|
declare const TryToInstallPlugins_base: Effect.Service.Class<TryToInstallPlugins, "TryToInstallPlugins", {
|
|
6
6
|
readonly effect: Effect.Effect<{
|
|
7
|
-
run: (plugins: PluginInfo[]) => Effect.Effect<UpdateResult, import("effect/
|
|
7
|
+
run: (plugins: PluginInfo[]) => Effect.Effect<UpdateResult, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("@withstudiocms/effect").DeepmergeError | import("@withstudiocms/effect/clack").ClackError | StudioCMSCliError, CliContext>;
|
|
8
8
|
}, never, never>;
|
|
9
9
|
}>;
|
|
10
10
|
export declare class TryToInstallPlugins extends TryToInstallPlugins_base {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { styleText } from "node:util";
|
|
1
2
|
import { exec } from "@withstudiocms/cli-kit/utils";
|
|
2
3
|
import { askToContinue, note, spinner } from "@withstudiocms/effect/clack";
|
|
3
4
|
import { detect, resolveCommand } from "package-manager-detector";
|
|
@@ -12,7 +13,7 @@ class TryToInstallPlugins extends Effect.Service()(
|
|
|
12
13
|
{
|
|
13
14
|
effect: genLogger("studiocms/cli/add/validatePlugins/TryToInstallPlugins.effect")(function* () {
|
|
14
15
|
const run = (plugins) => genLogger("studiocms/cli/add/validatePlugins/TryToInstallPlugins.effect.run")(function* () {
|
|
15
|
-
const {
|
|
16
|
+
const { cwd } = yield* CliContext;
|
|
16
17
|
const packageManager = yield* Effect.tryPromise(
|
|
17
18
|
() => detect({
|
|
18
19
|
cwd,
|
|
@@ -37,7 +38,7 @@ class TryToInstallPlugins extends Effect.Service()(
|
|
|
37
38
|
const installSpecifiers = (yield* convertPluginsToInstallSpecifiers(plugins)).map(
|
|
38
39
|
(specifier) => installCommand.command === "deno" ? `npm:${specifier}` : specifier
|
|
39
40
|
);
|
|
40
|
-
const coloredOutput = `${
|
|
41
|
+
const coloredOutput = `${styleText("bold", installCommand.command)} ${installCommand.args.join(" ")} ${styleText("magenta", installSpecifiers.join(" "))}`;
|
|
41
42
|
const boxenMessage = yield* effectBoxen(
|
|
42
43
|
(boxen) => boxen(coloredOutput, {
|
|
43
44
|
margin: 0.5,
|
|
@@ -49,8 +50,8 @@ class TryToInstallPlugins extends Effect.Service()(
|
|
|
49
50
|
${boxenMessage}
|
|
50
51
|
`;
|
|
51
52
|
yield* note(
|
|
52
|
-
`${
|
|
53
|
-
${
|
|
53
|
+
`${styleText("magenta", "StudioCMS will run the following command:")}
|
|
54
|
+
${styleText("dim", "If you skip this step, you can always run it yourself later")}
|
|
54
55
|
${message}`
|
|
55
56
|
);
|
|
56
57
|
if (yield* askToContinue()) {
|
|
@@ -83,7 +84,7 @@ ${response.stdout || response.message}
|
|
|
83
84
|
`);
|
|
84
85
|
yield* Console.error(
|
|
85
86
|
`
|
|
86
|
-
${
|
|
87
|
+
${styleText("yellow", "You may want to try:")}
|
|
87
88
|
- Checking your network connection
|
|
88
89
|
- Running the package manager command manually
|
|
89
90
|
- Ensuring you have permissions to install packages
|
|
@@ -4,7 +4,7 @@ import { CliContext } from '../utils/context.js';
|
|
|
4
4
|
import { UpdateResult } from './index.js';
|
|
5
5
|
declare const UpdateStudioCMSConfig_base: Effect.Service.Class<UpdateStudioCMSConfig, "UpdateStudioCMSConfig", {
|
|
6
6
|
readonly effect: Effect.Effect<{
|
|
7
|
-
run: (configURL: URL, mod: ProxifiedModule<any>) => Effect.Effect<UpdateResult.none | UpdateResult.updated | UpdateResult.cancelled, import("effect/
|
|
7
|
+
run: (configURL: URL, mod: ProxifiedModule<any>) => Effect.Effect<UpdateResult.none | UpdateResult.updated | UpdateResult.cancelled, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("@withstudiocms/effect").DeepmergeError | import("@withstudiocms/effect/clack").ClackError | import("../utils/errors.js").StudioCMSCliError, CliContext>;
|
|
8
8
|
}, never, never>;
|
|
9
9
|
}>;
|
|
10
10
|
export declare class UpdateStudioCMSConfig extends UpdateStudioCMSConfig_base {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { promises as fs } from "node:fs";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { styleText } from "node:util";
|
|
3
4
|
import { askToContinue, note } from "@withstudiocms/effect/clack";
|
|
4
5
|
import { diffWords } from "diff";
|
|
5
6
|
import { generateCode } from "magicast";
|
|
@@ -15,7 +16,6 @@ class UpdateStudioCMSConfig extends Effect.Service()(
|
|
|
15
16
|
const run = (configURL, mod) => genLogger("studiocms/cli/add/updateStudioCMSConfig/UpdateStudioCMSConfig.effect.run")(
|
|
16
17
|
function* () {
|
|
17
18
|
const context = yield* CliContext;
|
|
18
|
-
const { chalk } = context;
|
|
19
19
|
const input = yield* Effect.tryPromise(
|
|
20
20
|
() => fs.readFile(fileURLToPath(configURL), { encoding: "utf-8" })
|
|
21
21
|
);
|
|
@@ -46,7 +46,7 @@ ${boxenMessage}
|
|
|
46
46
|
`;
|
|
47
47
|
yield* note(
|
|
48
48
|
`
|
|
49
|
-
${
|
|
49
|
+
${styleText("magenta", "StudioCMS will make the following changes to your config file:")}
|
|
50
50
|
${message}`
|
|
51
51
|
);
|
|
52
52
|
if (yield* askToContinue()) {
|
|
@@ -66,7 +66,6 @@ ${message}`
|
|
|
66
66
|
) {
|
|
67
67
|
}
|
|
68
68
|
const getDiffContent = (input, output) => genLogger("studiocms/cli/add/updateStudioCMSConfig.getDiffContentNew")(function* () {
|
|
69
|
-
const { chalk } = yield* CliContext;
|
|
70
69
|
const changes = [];
|
|
71
70
|
for (const change of diffWords(input, output)) {
|
|
72
71
|
const lines = change.value.trim().split("\n").slice(0, change.count);
|
|
@@ -81,7 +80,7 @@ const getDiffContent = (input, output) => genLogger("studiocms/cli/add/updateStu
|
|
|
81
80
|
}
|
|
82
81
|
let diffed = output;
|
|
83
82
|
for (const newContent of changes) {
|
|
84
|
-
const coloredOutput = newContent.split("\n").map((ln) => ln ?
|
|
83
|
+
const coloredOutput = newContent.split("\n").map((ln) => ln ? styleText("green", ln) : "").join("\n");
|
|
85
84
|
diffed = diffed.replace(newContent, coloredOutput);
|
|
86
85
|
}
|
|
87
86
|
return diffed;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Effect } from '../../effect.js';
|
|
2
|
-
import { CliContext } from '../utils/context.js';
|
|
3
2
|
import { type PluginInfo } from './index.js';
|
|
4
3
|
declare const ValidatePlugins_base: Effect.Service.Class<ValidatePlugins, "ValidatePlugins", {
|
|
5
4
|
readonly effect: Effect.Effect<{
|
|
6
|
-
run: (names: string[]) => Effect.Effect<PluginInfo[], import("effect/
|
|
5
|
+
run: (names: string[]) => Effect.Effect<PluginInfo[], import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("@withstudiocms/effect").DeepmergeError | import("@withstudiocms/effect/clack").ClackError, never>;
|
|
7
6
|
}, never, never>;
|
|
8
7
|
}>;
|
|
9
8
|
export declare class ValidatePlugins extends ValidatePlugins_base {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { styleText } from "node:util";
|
|
1
2
|
import { askToContinue, spinner } from "@withstudiocms/effect/clack";
|
|
2
3
|
import { Effect, genLogger } from "../../effect.js";
|
|
3
|
-
import { CliContext } from "../utils/context.js";
|
|
4
4
|
import { StudioCMSScopes } from "./index.js";
|
|
5
5
|
import { fetchPackageJson, parsePluginName } from "./npm-utils.js";
|
|
6
6
|
class ValidatePlugins extends Effect.Service()("ValidatePlugins", {
|
|
7
7
|
effect: genLogger("studiocms/cli/add/validatePlugins/ValidatePlugins.effect")(function* () {
|
|
8
8
|
const run = (names) => genLogger("studiocms/cli/add/validatePlugins/ValidatePlugins.effect.run")(function* () {
|
|
9
|
-
const { chalk } = yield* CliContext;
|
|
10
9
|
const spin = yield* spinner();
|
|
11
10
|
yield* spin.start("Resolving packages...");
|
|
12
11
|
const entries = [];
|
|
13
12
|
for (const plugin of names) {
|
|
14
13
|
const parsed = yield* parsePluginName(plugin);
|
|
15
14
|
if (!parsed)
|
|
16
|
-
throw new Error(
|
|
15
|
+
throw new Error(
|
|
16
|
+
`${styleText("bold", plugin)} does not appear to be a valid package name!`
|
|
17
|
+
);
|
|
17
18
|
const { scope, name, tag } = parsed;
|
|
18
19
|
let pkgJson = {};
|
|
19
20
|
let pkgType;
|
|
@@ -23,14 +24,17 @@ class ValidatePlugins extends Effect.Service()("ValidatePlugins", {
|
|
|
23
24
|
const firstPartyPkgCheck = yield* fetchPackageJson(scope, name, tag);
|
|
24
25
|
if (firstPartyPkgCheck instanceof Error) {
|
|
25
26
|
if (firstPartyPkgCheck.message) {
|
|
26
|
-
yield* spin.message(
|
|
27
|
+
yield* spin.message(styleText("yellow", firstPartyPkgCheck.message));
|
|
27
28
|
}
|
|
28
29
|
yield* spin.message(
|
|
29
|
-
|
|
30
|
+
styleText(
|
|
31
|
+
"yellow",
|
|
32
|
+
`${styleText("bold", plugin)} is not an official StudioCMS package.`
|
|
33
|
+
)
|
|
30
34
|
);
|
|
31
35
|
if (!(yield* askToContinue())) {
|
|
32
36
|
throw new Error(
|
|
33
|
-
`No problem! Find our official plugins at ${
|
|
37
|
+
`No problem! Find our official plugins at ${styleText("magenta", "https://docs.studiocms.dev")}`
|
|
34
38
|
);
|
|
35
39
|
}
|
|
36
40
|
yield* spin.start("Resolving with third party packages...");
|
|
@@ -44,9 +48,11 @@ class ValidatePlugins extends Effect.Service()("ValidatePlugins", {
|
|
|
44
48
|
const thirdPartyPkgCheck = yield* fetchPackageJson(scope, name, tag);
|
|
45
49
|
if (thirdPartyPkgCheck instanceof Error) {
|
|
46
50
|
if (thirdPartyPkgCheck.message) {
|
|
47
|
-
yield* spin.message(
|
|
51
|
+
yield* spin.message(styleText("yellow", thirdPartyPkgCheck.message));
|
|
48
52
|
}
|
|
49
|
-
throw new Error(
|
|
53
|
+
throw new Error(
|
|
54
|
+
`Unable to fetch ${styleText("bold", plugin)}. Does the package exist?`
|
|
55
|
+
);
|
|
50
56
|
}
|
|
51
57
|
pkgJson = thirdPartyPkgCheck;
|
|
52
58
|
}
|
|
@@ -67,7 +73,7 @@ class ValidatePlugins extends Effect.Service()("ValidatePlugins", {
|
|
|
67
73
|
const keywords = Array.isArray(pkgJson.keywords) ? pkgJson.keywords : [];
|
|
68
74
|
if (!keywords.includes("studiocms-plugin")) {
|
|
69
75
|
throw new Error(
|
|
70
|
-
`${
|
|
76
|
+
`${styleText("bold", plugin)} doesn't appear to be an StudioCMS Plugin. Find our official plugins at ${styleText("magenta", "https://docs.studiocms.dev")}`
|
|
71
77
|
);
|
|
72
78
|
}
|
|
73
79
|
entries.push({
|
|
@@ -6,7 +6,7 @@ import { StudioCMSCliError } from '../../utils/errors.js';
|
|
|
6
6
|
export declare const OneYear = 31556926;
|
|
7
7
|
export declare const keyFile: Cli.Args.Args<string>;
|
|
8
8
|
export declare const expire: Cli.Options.Options<31556926 | import("effect/Option").Option<number>>;
|
|
9
|
-
export declare const genJWT: Cli.Command.Command<"gen-jwt", never, import("effect/
|
|
9
|
+
export declare const genJWT: Cli.Command.Command<"gen-jwt", never, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("@withstudiocms/effect/clack").ClackError | import("effect/Cause").NoSuchElementException | StudioCMSCliError, {
|
|
10
10
|
readonly keyFile: string;
|
|
11
11
|
readonly expire: 31556926 | import("effect/Option").Option<number>;
|
|
12
12
|
readonly debug: false | import("effect/Option").Option<boolean>;
|
|
@@ -10,7 +10,6 @@ import { intro, log, outro, spinner } from "@withstudiocms/effect/clack";
|
|
|
10
10
|
import { SignJWT } from "jose";
|
|
11
11
|
import { importPKCS8 } from "jose/key/import";
|
|
12
12
|
import { Cli, Effect, genLogger } from "../../../effect.js";
|
|
13
|
-
import { genContext } from "../../utils/context.js";
|
|
14
13
|
import { dateAdd } from "../../utils/dateAdd.js";
|
|
15
14
|
import { debug } from "../../utils/debugOpt.js";
|
|
16
15
|
import { StudioCMSCliError } from "../../utils/errors.js";
|
|
@@ -57,9 +56,6 @@ const genJWT = Cli.Command.make(
|
|
|
57
56
|
logger.debug(`Key file: ${keyFile2}`);
|
|
58
57
|
logger.debug(`Expiration: ${exp}`);
|
|
59
58
|
}
|
|
60
|
-
if (debug2) logger.debug("Getting context");
|
|
61
|
-
const context = yield* genContext;
|
|
62
|
-
const { chalk } = context;
|
|
63
59
|
if (debug2) logger.debug("Init complete, starting...");
|
|
64
60
|
yield* intro(label("StudioCMS Crypto: Generate JWT", StudioCMSColorwayBg, "bold"));
|
|
65
61
|
const spin = yield* spinner();
|
|
@@ -90,11 +86,14 @@ const genJWT = Cli.Command.make(
|
|
|
90
86
|
const base64UrlJwt = yield* convertJwtToBase64Url(jwt);
|
|
91
87
|
yield* spin.stop("Token Generated.");
|
|
92
88
|
yield* log.success(
|
|
93
|
-
boxen(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
boxen(
|
|
90
|
+
styleText("bold", `${label("Token Generated!", StudioCMSColorwayInfoBg, "bold")}`),
|
|
91
|
+
{
|
|
92
|
+
ln1: "Your new Token has been generated successfully:",
|
|
93
|
+
ln3: `Token: ${styleText("magenta", jwt)}`,
|
|
94
|
+
ln5: `Base64Url Token: ${styleText("blue", base64UrlJwt)}`
|
|
95
|
+
}
|
|
96
|
+
)
|
|
98
97
|
);
|
|
99
98
|
yield* outro(
|
|
100
99
|
`${label("You can now use this token where needed.", StudioCMSColorwayBg, "bold")} Stuck? Join us on Discord at ${StudioCMSColorway(styleText(["bold", "underline"], "https://chat.studiocms.dev"))}`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cli } from '../../effect.js';
|
|
2
|
-
export declare const cryptoCMD: Cli.Command.Command<"crypto", never, import("effect/
|
|
2
|
+
export declare const cryptoCMD: Cli.Command.Command<"crypto", never, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("@withstudiocms/effect/clack").ClackError | import("effect/Cause").NoSuchElementException | import("../utils/errors.js").StudioCMSCliError, {
|
|
3
3
|
readonly subcommand: import("effect/Option").Option<{
|
|
4
4
|
readonly keyFile: string;
|
|
5
5
|
readonly expire: 31556926 | import("effect/Option").Option<number>;
|
|
@@ -29,14 +29,24 @@ var EnvBuilderAction = /* @__PURE__ */ ((EnvBuilderAction2) => {
|
|
|
29
29
|
return EnvBuilderAction2;
|
|
30
30
|
})(EnvBuilderAction || {});
|
|
31
31
|
function emptyStringToUndefined(value) {
|
|
32
|
-
|
|
32
|
+
if (typeof value !== "string") {
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
if (value.trim() === "") {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
33
39
|
}
|
|
34
40
|
function NumberStringToUndefined(value) {
|
|
35
|
-
const
|
|
41
|
+
const emptyStringResult = emptyStringToUndefined(value);
|
|
42
|
+
if (emptyStringResult === void 0) {
|
|
43
|
+
return void 0;
|
|
44
|
+
}
|
|
45
|
+
const num = Number(emptyStringResult);
|
|
36
46
|
return Number.isNaN(num) ? void 0 : num;
|
|
37
47
|
}
|
|
38
48
|
const env = Effect.fn(function* (context, debug, dryRun) {
|
|
39
|
-
const {
|
|
49
|
+
const { cwd, pCancel, pOnCancel } = context;
|
|
40
50
|
const debugLogger = yield* buildDebugLogger(debug);
|
|
41
51
|
yield* debugLogger("Running env...");
|
|
42
52
|
let _env = false;
|
|
@@ -436,7 +446,7 @@ const env = Effect.fn(function* (context, debug, dryRun) {
|
|
|
436
446
|
});
|
|
437
447
|
} else if (_env) {
|
|
438
448
|
context.tasks.push({
|
|
439
|
-
title:
|
|
449
|
+
title: styleText("dim", "Creating environment file..."),
|
|
440
450
|
task: async (message) => {
|
|
441
451
|
try {
|
|
442
452
|
await fs.writeFile(path.join(cwd, ".env"), envFileContent, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Effect } from '../../../effect.js';
|
|
2
2
|
import { CliContext } from '../../utils/context.js';
|
|
3
|
-
export declare const next: (debug: boolean) => Effect.Effect<void, import("effect/
|
|
3
|
+
export declare const next: (debug: boolean) => Effect.Effect<void, import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("@withstudiocms/effect/clack").ClackError, CliContext>;
|
|
@@ -22,7 +22,7 @@ const runCmdMap = {
|
|
|
22
22
|
pnpm: "pnpm run"
|
|
23
23
|
};
|
|
24
24
|
const next = (debug) => genLogger("studiocms/cli/init/steps/next")(function* () {
|
|
25
|
-
const [{
|
|
25
|
+
const [{ packageManager }, debugLogger] = yield* Effect.all([
|
|
26
26
|
CliContext,
|
|
27
27
|
buildDebugLogger(debug)
|
|
28
28
|
]);
|
|
@@ -33,13 +33,14 @@ const next = (debug) => genLogger("studiocms/cli/init/steps/next")(function* ()
|
|
|
33
33
|
debugLogger("Running next steps fn..."),
|
|
34
34
|
log.success(
|
|
35
35
|
boxen(
|
|
36
|
-
|
|
36
|
+
styleText(
|
|
37
|
+
"bold",
|
|
37
38
|
`${label("Init Complete!", StudioCMSColorwayInfoBg, "bold")} Get started with StudioCMS:`
|
|
38
39
|
),
|
|
39
40
|
{
|
|
40
|
-
ln1: `Ensure your ${
|
|
41
|
-
ln3: `Run ${
|
|
42
|
-
ln4: `Run ${
|
|
41
|
+
ln1: `Ensure your ${styleText("cyanBright", ".env")} file is configured correctly.`,
|
|
42
|
+
ln3: `Run ${styleText("cyan", `${runCmd} studiocms migrate`)} to sync your database schema.`,
|
|
43
|
+
ln4: `Run ${styleText("cyan", devCmd)} to start the dev server. ${styleText("cyanBright", "CTRL+C")} to stop.`
|
|
43
44
|
}
|
|
44
45
|
)
|
|
45
46
|
)
|
|
@@ -2,7 +2,7 @@ import { Cli } from '@withstudiocms/effect';
|
|
|
2
2
|
export declare const rollback: Cli.Options.Options<import("effect/Option").Option<boolean>>;
|
|
3
3
|
export declare const latest: Cli.Options.Options<import("effect/Option").Option<boolean>>;
|
|
4
4
|
export declare const status: Cli.Options.Options<import("effect/Option").Option<boolean>>;
|
|
5
|
-
export declare const migratorCMD: Cli.Command.Command<"migrate", never, import("effect/
|
|
5
|
+
export declare const migratorCMD: Cli.Command.Command<"migrate", never, import("effect/ParseResult").ParseError | import("effect/ConfigError").ConfigError | import("effect/Cause").UnknownException | import("../../db/index.js").UnsupportedDialectError | import("../../db/index.js").DriverImportError | import("@withstudiocms/effect/clack").ClackError | import("effect/Cause").NoSuchElementException | import("@withstudiocms/kysely/core/errors").MigratorError, {
|
|
6
6
|
readonly debug: false | import("effect/Option").Option<boolean>;
|
|
7
7
|
readonly rollback: import("effect/Option").Option<boolean>;
|
|
8
8
|
readonly latest: import("effect/Option").Option<boolean>;
|
|
@@ -143,11 +143,11 @@ const migratorCMD = Cli.Command.make(
|
|
|
143
143
|
const migrationTotal = status3.length;
|
|
144
144
|
const appliedMigrations = status3.filter((m) => m.executedAt).length;
|
|
145
145
|
const migrationPercent = appliedMigrations / migrationTotal * 100;
|
|
146
|
-
const migrationTotalColor = migrationPercent === 100 ?
|
|
146
|
+
const migrationTotalColor = migrationPercent === 100 ? (text) => styleText("green", text) : migrationPercent > 50 ? (text) => styleText("yellow", text) : (text) => styleText("red", text);
|
|
147
147
|
const labelParts = [
|
|
148
148
|
label("Migration Status", StudioCMSColorwayInfoBg, "black"),
|
|
149
149
|
label(
|
|
150
|
-
`(${
|
|
150
|
+
`(${styleText("green", appliedMigrations.toString())}/${migrationTotalColor(migrationTotal.toString())}) Applied`,
|
|
151
151
|
(text) => styleText("bold", text),
|
|
152
152
|
"black"
|
|
153
153
|
)
|
|
@@ -4,7 +4,7 @@ export declare enum DBEditOptions {
|
|
|
4
4
|
create = "create",
|
|
5
5
|
modify = "modify"
|
|
6
6
|
}
|
|
7
|
-
export declare const usersCMD: Cli.Command.Command<"users", never, Error | import("effect/ConfigError").ConfigError, {
|
|
7
|
+
export declare const usersCMD: Cli.Command.Command<"users", never, import("effect/ParseResult").ParseError | Error | import("effect/ConfigError").ConfigError, {
|
|
8
8
|
readonly debug: false | import("effect/Option").Option<boolean>;
|
|
9
9
|
readonly dryRun: import("effect/Option").Option<boolean>;
|
|
10
10
|
}>;
|
package/dist/cli/users/shared.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { styleText } from "node:util";
|
|
1
2
|
import { Effect } from "@withstudiocms/effect";
|
|
2
3
|
import { log } from "@withstudiocms/effect/clack";
|
|
3
|
-
import chalk from "chalk";
|
|
4
4
|
const validateInputOrRePrompt = Effect.fn("validateInputOrRePrompt")(function* (opts) {
|
|
5
5
|
const { prompt, checkEffect } = opts;
|
|
6
6
|
while (true) {
|
|
@@ -12,7 +12,7 @@ const validateInputOrRePrompt = Effect.fn("validateInputOrRePrompt")(function* (
|
|
|
12
12
|
if (checkResult === true) {
|
|
13
13
|
return input;
|
|
14
14
|
}
|
|
15
|
-
yield* log.error(
|
|
15
|
+
yield* log.error(styleText("red", `Invalid input: ${checkResult}`));
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
export {
|