diff --git a/.changeset/chatty-kangaroos-rule.md b/.changeset/chatty-kangaroos-rule.md
index 962f4a1eb..342ac6efb 100644
--- a/.changeset/chatty-kangaroos-rule.md
+++ b/.changeset/chatty-kangaroos-rule.md
@@ -2,7 +2,6 @@
"@studiocms/dashboard": patch
"@studiocms/auth": patch
"@studiocms/core": patch
-"@studiocms/ui": patch
"studiocms": patch
---
@@ -112,8 +111,4 @@ Auth system overhaul:
## **`@studiocms/dashboard`**
-- Refactor to utilize new `@studiocms/auth` lib for user verification
-
-## **`@studiocms/ui`**
-
-- Update `` component's available types
\ No newline at end of file
+- Refactor to utilize new `@studiocms/auth` lib for user verification
\ No newline at end of file
diff --git a/.changeset/config.json b/.changeset/config.json
index 8fa03f0db..7d57c6726 100644
--- a/.changeset/config.json
+++ b/.changeset/config.json
@@ -14,13 +14,12 @@
"@studiocms/frontend",
"@studiocms/imagehandler",
"@studiocms/renderers",
- "@studiocms/robotstxt",
- "@studiocms/ui"
+ "@studiocms/robotstxt"
]
],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
- "ignore": ["docs", "node-playground", "ui-playground"]
+ "ignore": ["docs", "node-playground"]
}
diff --git a/.changeset/curvy-mirrors-play.md b/.changeset/curvy-mirrors-play.md
deleted file mode 100644
index 988a91c58..000000000
--- a/.changeset/curvy-mirrors-play.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-"@studiocms/ui": patch
----
-
-Applied various changes and fixes to different parts of the UI libary.
-
-- Fixed a CSS leak caused by importing css files instead of having scoped styles
-- Adjusted dropdown helper API for better DX
-- Adjusted modal helper API for better DX
-- Various CSS fixes for different components
diff --git a/.changeset/mean-apples-joke.md b/.changeset/mean-apples-joke.md
deleted file mode 100644
index fae72edb8..000000000
--- a/.changeset/mean-apples-joke.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@studiocms/ui": patch
----
-
-Added a new searchable select component and improved accessibility for normal selects
diff --git a/.changeset/pre.json b/.changeset/pre.json
index 83181a942..cdb8db215 100644
--- a/.changeset/pre.json
+++ b/.changeset/pre.json
@@ -13,9 +13,7 @@
"@studiocms/renderers": "0.1.0-beta.4",
"@studiocms/robotstxt": "0.1.0-beta.4",
"@studiocms/blog": "0.1.0-beta.1",
- "@studiocms/ui": "0.1.0-beta.7",
"node-playground": "0.0.1",
- "ui-playground": "0.0.1",
"docs": "0.0.1"
},
"changesets": [
diff --git a/.changeset/rotten-dancers-trade.md b/.changeset/rotten-dancers-trade.md
deleted file mode 100644
index 960cc7f00..000000000
--- a/.changeset/rotten-dancers-trade.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@studiocms/ui": patch
----
-
-Added a new UI library for the dashboard rework
diff --git a/.changeset/sharp-zoos-tickle.md b/.changeset/sharp-zoos-tickle.md
deleted file mode 100644
index 7f1811374..000000000
--- a/.changeset/sharp-zoos-tickle.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@studiocms/ui": patch
----
-
-Added a theme helper and theme toggle component
diff --git a/.changeset/spotty-beds-kiss.md b/.changeset/spotty-beds-kiss.md
index e2c4cbafd..3701720c4 100644
--- a/.changeset/spotty-beds-kiss.md
+++ b/.changeset/spotty-beds-kiss.md
@@ -10,7 +10,6 @@
"@studiocms/auth": patch
"@studiocms/blog": patch
"@studiocms/core": patch
-"@studiocms/ui": patch
"studiocms": patch
---
diff --git a/.changeset/thick-dryers-train.md b/.changeset/thick-dryers-train.md
deleted file mode 100644
index 2020539c6..000000000
--- a/.changeset/thick-dryers-train.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@studiocms/ui": patch
----
-
-Adjusted persistent toasts to include an outline for better visibility
diff --git a/.config/tsconfig.json b/.config/tsconfig.json
deleted file mode 100644
index 0967ef424..000000000
--- a/.config/tsconfig.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml
deleted file mode 100644
index 943a1e426..000000000
--- a/.github/actions/install/action.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: Install Tools & Dependencies
-description: Installs pnpm, Node.js & package dependencies
-
-runs:
- using: composite
- steps:
- - name: Setup pnpm (corepack enabled)
- uses: pnpm/action-setup@v3
-
- - name: Setup Node.js 20.x
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
- with:
- node-version-file: '.node-version'
- cache: 'pnpm'
-
- - name: Install Dependencies
- run: pnpm ci:install
- shell: bash
\ No newline at end of file
diff --git a/.github/workflows/ci-pr-i18n-changeset.yml b/.github/workflows/ci-pr-i18n-changeset.yml
index 2ae9e91d6..1bdfd15a6 100644
--- a/.github/workflows/ci-pr-i18n-changeset.yml
+++ b/.github/workflows/ci-pr-i18n-changeset.yml
@@ -19,10 +19,10 @@ jobs:
token: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }}
- name: Install Tools & Dependencies
- uses: ./.github/actions/install
+ uses: withstudiocms/automations/.github/actions/install@main
- name: Create Translation Changesets
- run: pnpm translations:changeset
+ run: pnpm ci:translations:changeset
env:
CI_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
diff --git a/.github/workflows/ci-pr-lunaria-overview.yml b/.github/workflows/ci-pr-lunaria-overview.yml
index dfbb09f53..77fa90b2b 100644
--- a/.github/workflows/ci-pr-lunaria-overview.yml
+++ b/.github/workflows/ci-pr-lunaria-overview.yml
@@ -21,7 +21,7 @@ jobs:
token: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }}
- name: Install Tools & Dependencies
- uses: ./.github/actions/install
+ uses: withstudiocms/automations/.github/actions/install@main
- name: Generate Lunaria Overview
uses: lunariajs/action@astro-docs
diff --git a/.github/workflows/ci-pr-snapshots.yml b/.github/workflows/ci-pr-snapshots.yml
index bd19cf47b..2313c4236 100644
--- a/.github/workflows/ci-pr-snapshots.yml
+++ b/.github/workflows/ci-pr-snapshots.yml
@@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install Tools & Dependencies
- uses: ./.github/actions/install
+ uses: withstudiocms/automations/.github/actions/install@main
- name: Publish packages
run: pnpm ci:snapshot
diff --git a/.github/workflows/ci-push-main.yml b/.github/workflows/ci-push-main.yml
index 1b8539a15..c26ba4d2c 100644
--- a/.github/workflows/ci-push-main.yml
+++ b/.github/workflows/ci-push-main.yml
@@ -36,7 +36,7 @@ jobs:
token: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }}
- name: Install Tools & Dependencies
- uses: ./.github/actions/install
+ uses: withstudiocms/automations/.github/actions/install@main
- name: Format code
run: pnpm run lint:fix
@@ -81,7 +81,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install Tools & Dependencies
- uses: ./.github/actions/install
+ uses: withstudiocms/automations/.github/actions/install@main
- name: Create Release Pull Request or Publish to npm
id: changesets
@@ -126,15 +126,15 @@ jobs:
# token: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }}
# - name: Install Tools & Dependencies
-# uses: ./.github/actions/install
+# uses: withstudiocms/automations/.github/actions/install@main
# - name: Build Lunaria Overview
-# run: pnpm lunaria:build
+# run: pnpm ci:lunaria:build
# - name: Upload Overview
# uses: actions/upload-pages-artifact@v3
# with:
-# path: "www/docs/dist/lunaria/"
+# path: "docs/dist/lunaria/"
# lunaria-deploy:
# name: Deploy Lunaria Overview
diff --git a/.github/workflows/ci-report-lunaria.yml b/.github/workflows/ci-report-lunaria.yml
index fc52710b4..78c9a0a20 100644
--- a/.github/workflows/ci-report-lunaria.yml
+++ b/.github/workflows/ci-report-lunaria.yml
@@ -17,11 +17,11 @@ jobs:
fetch-depth: 0
- name: Install Tools & Dependencies
- uses: ./.github/actions/install
+ uses: withstudiocms/automations/.github/actions/install@main
- id: message
name: Format Discord message
- run: pnpm tsm --require=./scripts/filter-warnings.cjs ./www/docs/scripts/lunaria-report-bot.ts
+ run: pnpm ci:lunaria:report
discord_message:
name: Send Discord Message
diff --git a/.github/workflows/lunaria-build.yml b/.github/workflows/lunaria-build.yml
index 65de2bbc5..66af5c587 100644
--- a/.github/workflows/lunaria-build.yml
+++ b/.github/workflows/lunaria-build.yml
@@ -19,15 +19,15 @@ jobs:
token: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }}
- name: Install Tools & Dependencies
- uses: ./.github/actions/install
+ uses: withstudiocms/automations/.github/actions/install@main
- name: Build Lunaria Overview
- run: pnpm lunaria:build
+ run: pnpm ci:lunaria:build
- name: Upload Overview
uses: actions/upload-pages-artifact@v3
with:
- path: "www/docs/dist/lunaria/"
+ path: "docs/dist/lunaria/"
deploy-overview:
runs-on: ubuntu-latest
diff --git a/.moon/tasks.yml b/.moon/tasks.yml
deleted file mode 100644
index ec353bf8d..000000000
--- a/.moon/tasks.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-tasks:
- changeset:
- command: changeset
- platform: node
- ci-publish:
- command: 'pnpm changeset publish'
- platform: node
- ci-version:
- command: 'pnpm changeset version'
- platform: node
- lint:
- command: 'biome check .'
- platform: node
- lint-fix:
- command: 'biome check --apply .'
- platform: node
- moon:
- command: moon
- platform: node
- dev:
- command: 'pnpm --filter node-playground dev'
- platform: node
- update:
- command: 'pnpm install'
- platform: node
\ No newline at end of file
diff --git a/.moon/toolchain.yml b/.moon/toolchain.yml
deleted file mode 100644
index 35a77ab1d..000000000
--- a/.moon/toolchain.yml
+++ /dev/null
@@ -1,103 +0,0 @@
-# Enables and configures Node.js.
-node:
-
- # Defines the explicit Node.js version specification to use. If this field is not defined, the global node binary will be used.
- # Version can also be defined with .prototools or with the MOON_NODE_VERSION environment variable.
- version: '20.14.0'
-
- # Defines which package manager to utilize. Supports npm (default), pnpm, yarn, or bun.
- packageManager: 'pnpm'
-
- # Optional fields for defining package manager specific configuration. The chosen setting is dependent on the value of node.packageManager. If these settings are not defined, the latest version of the active package manager will be used (when applicable).
- # pnpm:
-
- # The version setting defines the explicit package manager version specification to use. If this field is not defined, the global npm, pnpm, yarn, and bun binaries will be used.
- # Version can also be defined with .prototools or with the MOON_NPM_VERSION, MOON_PNPM_VERSION, MOON_YARN_VERSION, or MOON_BUN_VERSION environment variables.
- # version: ''
-
- # Customize the arguments that will be passed to the package manager's install command, when the InstallDeps action is triggered in the pipeline. These arguments are used both locally and in CI.
- # installArgs: ['--immutable']
-
- # Injects the currently configured Node.js version as an engines constraint to the root package.json field.
- addEnginesConstraint: true
-
- # Additional command line arguments to pass to the node binary when it's being executed by running a target. This will apply arguments to all Node.js based targets, and cannot be changed on a per target basis.
- # binExecArgs:
-
- # Will dedupe dependencies after they have been installed, added, removing, or changed in any way, in an effort to keep the workspace tree as clean and lean as possible.
- dedupeOnLockfileChange: true
-
-
- # When syncing project dependencies, customize the format that will be used for the dependency version range. The following formats are supported (but use the one most applicable to your chosen package manager):
-
- # - file (npm default) - Uses file:../relative/path and copies package contents.
- # - link - Uses link:../relative/path and symlinks package contents.
- # - star - Uses an explicit *.
- # - version - Uses the explicit version from the dependent project's package.json, e.g., "1.2.3".
- # - version-caret - Uses the version from the dependent project's package.json as a caret range, e.g., "^1.2.3".
- # - version-tilde - Uses the version from the dependent project's package.json as a tilde range, e.g., "~1.2.3".
- # - workspace (bun/pnpm/yarn default) - Uses workspace:*, which resolves to "1.2.3". Requires package workspaces.
- # - workspace-caret - Uses workspace:^, which resolves to "^1.2.3". Requires package workspaces.
- # - workspace-tilde - Uses workspace:~, which resolves to "~1.2.3". Requires package workspaces.
- #
- # This setting does not apply to peer dependencies, as they will always use a format of ^.0.0. Furthermore, if a package manager does not support a chosen format, it will fallback to another format!
- dependencyVersionFormat: workspace
-
-
- # Will infer and automatically create tasks from package.json scripts.
- #
- # This requires the project's language to be "javascript" or "typescript", a package.json to exist in the project, and will take the following into account:
- #
- # Script names will be converted to kebab-case, and will become the task ID.
- # Pre, post, and life cycle hooks are ignored.
- # Tasks defined in .moon/tasks.yml or moon.yml take precedence over scripts of the same name.
- # To verify inferred tasks, run moon project (pass --json to view raw config and options). Tasks that are inferred will run through the configured package manager.
- inferTasksFromScripts: true
-
- # Supports the "single version policy" or "one version rule" patterns by only allowing dependencies in the root package.json, and only installing dependencies in the workspace root, and not within individual projects. It also bypasses all workspaces checks to determine package locations.
- #
- # This setting does not verify that other package.jsons do not have dependencies, it merely runs "install dependency" commands in the root. It's up to you to ensure that other package.jsons do not have dependencies.
- rootPackageOnly: false
-
- # Will sync a project's dependencies as normal dependencies within the project's package.json. If a dependent project does not have a package.json, or if a dependency of the same name has an explicit version already defined, the sync will be skipped.
- syncProjectWorkspaceDependencies: true
-
- # Will sync the currently configured Node.js version to a 3rd-party version manager's config/rc file. Supports "nodenv" (syncs to .node-version), "nvm" (syncs to .nvmrc), or none (default).
- #
- # This is a special setting that ensure other Node.js processes outside of our toolchain are utilizing the same version, which is a very common practice when managing dependencies.
- syncVersionManagerConfig: nodenv
-
-# Dictates how moon interacts with and utilizes TypeScript within the workspace.
-typescript:
-
- # When syncing project references and a depended on project does not have a tsconfig.json, automatically create one.
- createMissingConfig: true
-
- # When enabled and syncing project references, will inject each project reference as an entry in the include field of the respective project's tsconfig.json. These includes are sometimes required by editors for auto-completion, intellisense, and automatic imports.
- includeProjectReferenceSources: true
-
- # When enabled, will automatically inject shared types (types/**/*) into the include field of each project's tsconfig.json. The shared types folder must be named types and must exist relative to the root setting.
- includeSharedTypes: true
-
- # Defines the file name of the tsconfig.json found in the project root. We utilize this setting when syncing project references between projects. Defaults to tsconfig.json.
- projectConfigFileName: 'tsconfig.json'
-
- # Defines the TypeScript root (relative from moon's workspace root), where project reference composition, common compiler options, and shared types will be located.
- root: '.'
-
- # Defines the file name of the tsconfig.json found in the root of all projects. We utilize this setting when syncing projects as references.
- rootConfigFileName: 'tsconfig.json'
-
- # Defines the file name of the config file found in the root that houses shared compiler options.
- rootOptionsConfigFileName: '.config/tsconfig.json'
-
- # Updates the outDir compiler option in each project's tsconfig.json to route to moon's cache folder. This is useful when using project references and wanting to keep all the compiled .d.ts files out of the project folder.
- routeOutDirToCache: true
-
- # Will sync a project's dependencies (when applicable) as project references within that project's tsconfig.json, and the root tsconfig.json.
- #
- # This setting assumes you're using the file organization as defined in our official TypeScript project references in-depth guide.
- syncProjectReferences: true
-
- # Will sync a project's tsconfig.json project references to the paths compiler option, using the referenced project's package.json name.
- syncProjectReferencesToPaths: true
\ No newline at end of file
diff --git a/.moon/workspace.yml b/.moon/workspace.yml
deleted file mode 100644
index 3c3d1cadd..000000000
--- a/.moon/workspace.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-# https://moonrepo.dev/docs/config/workspace
-$schema: 'https://moonrepo.dev/schemas/workspace.json'
-
-projects:
- root: '.'
- # Packages
- studiocms: 'packages/studiocms'
- studiocms_assets: 'packages/studiocms_assets'
- studiocms_auth: 'packages/studiocms_auth'
- studiocms_betaresources: 'packages/studiocms_betaresources'
- studiocms_blog: 'packages/studiocms_blog'
- studiocms_core: 'packages/studiocms_core'
- studiocms_dashboard: 'packages/studiocms_dashboard'
- studiocms_frontend: 'packages/studiocms_frontend'
- studiocms_imagehandler: 'packages/studiocms_imagehandler'
- studiocms_renderers: 'packages/studiocms_renderers'
- studiocms_robotstxt: 'packages/studiocms_robotstxt'
- studiocms_ui: 'packages/studiocms_ui'
-
- # Playgrounds
- playground: 'playgrounds/node'
- ui-playground: 'playgrounds/ui'
- # cloudflare-playground: 'playgrounds/cloudflare' - Removed for now till we start experimenting with Cloudflare again.
-
- # Web Sites & Docs
- web: 'www/web'
- docs: 'www/docs'
-
-# https://moonrepo.dev/docs/config/workspace#constraints
-constraints:
- # https://moonrepo.dev/docs/config/workspace#enforceprojecttyperelationships
- enforceProjectTypeRelationships: true
-
-# https://moonrepo.dev/docs/config/workspace#experiments
-experiments:
- strictProjectAliases: true
-
-# https://moonrepo.dev/docs/config/workspace#runner
-runner:
- cacheLifetime: "7 days"
- inheritColorsForPipedTasks: true
- logRunningCommand: true
-
-# https://moonrepo.dev/docs/config/workspace#telemetry
-telemetry: true
-
-# Configures the version control system to utilize within the workspace. A VCS
-# is required for determining touched (added, modified, etc) files, calculating file hashes,
-# computing affected files, and much more.
-vcs:
- # https://moonrepo.dev/docs/config/workspace#defaultbranch
- defaultBranch: 'main'
-
- # https://moonrepo.dev/docs/config/workspace#hooks
- # hooks:
-
- # https://moonrepo.dev/docs/config/workspace#synchooks
- # syncHooks:
-
- # https://moonrepo.dev/docs/config/workspace#manager
- manager: 'git'
-
- # https://moonrepo.dev/docs/config/workspace#provider
- provider: 'github'
-
- # https://moonrepo.dev/docs/config/workspace#remotecandidates
- remoteCandidates:
- - 'origin'
- - 'upstream'
\ No newline at end of file
diff --git a/.prototools b/.prototools
index 5b0a0f262..ff2083597 100644
--- a/.prototools
+++ b/.prototools
@@ -1,8 +1,6 @@
-biome = "1.9.2"
-moon = "1.28.3"
+biome = "1.9.4"
node = "20.14.0"
pnpm = "9.5.0"
[plugins]
biome = "source:https://raw.githubusercontent.com/Phault/proto-toml-plugins/main/biome/plugin.toml"
-moon = "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 44fcf1104..31abbe325 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -8,5 +8,22 @@
"[mdx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
- "editor.gotoLocation.multipleDefinitions": "goto"
+ "editor.gotoLocation.multipleDefinitions": "goto",
+ "cSpell.words": [
+ "astrojs",
+ "CMSSDK",
+ "Coolify",
+ "Libravatar",
+ "liverender",
+ "Markdoc",
+ "mdast",
+ "onest",
+ "oslojs",
+ "prototools",
+ "robotstxt",
+ "studiocms",
+ "twoslash",
+ "vite",
+ "withstudiocms"
+ ]
}
diff --git a/README.md b/README.md
index a2362fb40..662d0314e 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ To see how to get started, check out the [StudioCMS README](./packages/studiocms
## Sponsor
-
+
## StudioCMS Dashboard i18n Status
@@ -45,7 +45,7 @@ For an up-to-date list of our main tools check out our [`.prototools`](.prototoo
For more information about Proto checkout [Proto's Website](https://moonrepo.dev/proto)
-## This is a [`Moonrepo`](https://moonrepo.dev)
+## This is a [`Moon repository`](https://moonrepo.dev)
Follow install instructions listed on Moonrepo's docs, and you'll be all set to go! Its even a super easy single line command you put in your terminal!
@@ -65,16 +65,15 @@ Steps to get a running playground should be the following:
- clone repo
- run `pnpm i --frozen-lockfile`
-- change `dbStartPage` in the [node playground's](./playgrounds/node/studiocms.config.mjs) config to `true`
+- change `dbStartPage` in the [node playground's](./playground/studiocms.config.mts) config to `true`
- read the first time setup instructions listed in the [main package readme](./packages/studiocms/README.md#first-start-and-setup) then replace the astro db commands with the following:
Commands to run:
- - `pnpm playground:login` - Login your CLI to Astro Studio
- - `pnpm playground:push` - Creates the base tables on the remote database.
+ - `pnpm playground:push` - Push to your libSQL database assigned via environment variables
- `pnpm playground:dev` - Starts the Dev server connected to the linked database
-Once that process completes successfuly you are ready to navigate to http://localhost:4321/start and follow the instructions to get started.
+Once that process completes successfully you are ready to navigate to http://localhost:4321/start and follow the instructions to get started.
It will redirect and ask you to shutdown and change the above mentioned config option `dbStartPage` to `false` at which point that will enable full functionality of the CMS. you can now restart the dev server with `astro dev --remote` to continue viewing your new site!
diff --git a/www/assets/banner-readme.png b/assets/banner-readme.png
similarity index 100%
rename from www/assets/banner-readme.png
rename to assets/banner-readme.png
diff --git a/www/assets/discord-emoji-dark.png b/assets/discord-emoji-dark.png
similarity index 100%
rename from www/assets/discord-emoji-dark.png
rename to assets/discord-emoji-dark.png
diff --git a/www/assets/discord-emoji-light.png b/assets/discord-emoji-light.png
similarity index 100%
rename from www/assets/discord-emoji-light.png
rename to assets/discord-emoji-light.png
diff --git a/playgrounds/node/public/studiocms-auth/logo-adaptive.svg b/assets/logo-adaptive.svg
similarity index 100%
rename from playgrounds/node/public/studiocms-auth/logo-adaptive.svg
rename to assets/logo-adaptive.svg
diff --git a/www/assets/logo-dark.svg b/assets/logo-dark.svg
similarity index 100%
rename from www/assets/logo-dark.svg
rename to assets/logo-dark.svg
diff --git a/www/assets/logo-discord.png b/assets/logo-discord.png
similarity index 100%
rename from www/assets/logo-discord.png
rename to assets/logo-discord.png
diff --git a/www/assets/logo-discord.svg b/assets/logo-discord.svg
similarity index 100%
rename from www/assets/logo-discord.svg
rename to assets/logo-discord.svg
diff --git a/www/assets/logo-light.svg b/assets/logo-light.svg
similarity index 100%
rename from www/assets/logo-light.svg
rename to assets/logo-light.svg
diff --git a/www/assets/logo-outlined-adaptive.svg b/assets/logo-outlined-adaptive.svg
similarity index 100%
rename from www/assets/logo-outlined-adaptive.svg
rename to assets/logo-outlined-adaptive.svg
diff --git a/www/assets/logo-outlined-dark.svg b/assets/logo-outlined-dark.svg
similarity index 100%
rename from www/assets/logo-outlined-dark.svg
rename to assets/logo-outlined-dark.svg
diff --git a/www/assets/logo-outlined-light.svg b/assets/logo-outlined-light.svg
similarity index 100%
rename from www/assets/logo-outlined-light.svg
rename to assets/logo-outlined-light.svg
diff --git a/www/assets/old/banner-readme.png b/assets/old/banner-readme.png
similarity index 100%
rename from www/assets/old/banner-readme.png
rename to assets/old/banner-readme.png
diff --git a/www/assets/old/discord-emoji-dark.png b/assets/old/discord-emoji-dark.png
similarity index 100%
rename from www/assets/old/discord-emoji-dark.png
rename to assets/old/discord-emoji-dark.png
diff --git a/www/assets/old/discord-emoji-light.png b/assets/old/discord-emoji-light.png
similarity index 100%
rename from www/assets/old/discord-emoji-light.png
rename to assets/old/discord-emoji-light.png
diff --git a/www/assets/old/logo-dark.svg b/assets/old/logo-dark.svg
similarity index 100%
rename from www/assets/old/logo-dark.svg
rename to assets/old/logo-dark.svg
diff --git a/www/assets/old/logo-discord.png b/assets/old/logo-discord.png
similarity index 100%
rename from www/assets/old/logo-discord.png
rename to assets/old/logo-discord.png
diff --git a/www/assets/old/logo-discord.svg b/assets/old/logo-discord.svg
similarity index 100%
rename from www/assets/old/logo-discord.svg
rename to assets/old/logo-discord.svg
diff --git a/www/assets/old/logo-light.svg b/assets/old/logo-light.svg
similarity index 100%
rename from www/assets/old/logo-light.svg
rename to assets/old/logo-light.svg
diff --git a/www/assets/old/studioCMS-dark.png b/assets/old/studioCMS-dark.png
similarity index 100%
rename from www/assets/old/studioCMS-dark.png
rename to assets/old/studioCMS-dark.png
diff --git a/www/assets/old/studioCMS.png b/assets/old/studioCMS.png
similarity index 100%
rename from www/assets/old/studioCMS.png
rename to assets/old/studioCMS.png
diff --git a/www/assets/old/studiocms-new-logos.zip b/assets/old/studiocms-new-logos.zip
similarity index 100%
rename from www/assets/old/studiocms-new-logos.zip
rename to assets/old/studiocms-new-logos.zip
diff --git a/www/assets/studioCMS.png b/assets/studioCMS.png
similarity index 100%
rename from www/assets/studioCMS.png
rename to assets/studioCMS.png
diff --git a/www/assets/studiocms-dark.png b/assets/studiocms-dark.png
similarity index 100%
rename from www/assets/studiocms-dark.png
rename to assets/studiocms-dark.png
diff --git a/www/assets/studiocms-new-logos.zip b/assets/studiocms-new-logos.zip
similarity index 100%
rename from www/assets/studiocms-new-logos.zip
rename to assets/studiocms-new-logos.zip
diff --git a/www/docs/.gitignore b/docs/.gitignore
similarity index 100%
rename from www/docs/.gitignore
rename to docs/.gitignore
diff --git a/playgrounds/node/.vscode/extensions.json b/docs/.vscode/extensions.json
similarity index 100%
rename from playgrounds/node/.vscode/extensions.json
rename to docs/.vscode/extensions.json
diff --git a/playgrounds/node/.vscode/launch.json b/docs/.vscode/launch.json
similarity index 100%
rename from playgrounds/node/.vscode/launch.json
rename to docs/.vscode/launch.json
diff --git a/www/docs/README.md b/docs/README.md
similarity index 100%
rename from www/docs/README.md
rename to docs/README.md
diff --git a/www/docs/astro.config.mts b/docs/astro.config.mts
similarity index 88%
rename from www/docs/astro.config.mts
rename to docs/astro.config.mts
index 789aefe84..76b0f2672 100644
--- a/www/docs/astro.config.mts
+++ b/docs/astro.config.mts
@@ -2,9 +2,9 @@ import starlight from '@astrojs/starlight';
import starlightUtils from '@lorenzo_lewis/starlight-utils';
import { defineConfig } from 'astro/config';
import starlightImageZoom from 'starlight-image-zoom';
-import getCoolifyURL from './hostUtils';
-import rehypePluginKit from './src/plugins/rehypePluginKit';
-import { typeDocPlugins, typeDocSideBarEntry } from './typedoc.config';
+import getCoolifyURL from './hostUtils.ts';
+import rehypePluginKit from './src/plugins/rehypePluginKit.ts';
+import { typeDocPlugins, typeDocSideBarEntry } from './typedoc.config.ts';
// Define the Site URL
const site = getCoolifyURL(true) || 'https://docs.studiocms.dev/';
@@ -30,9 +30,6 @@ export const locales = {
export default defineConfig({
site,
- experimental: {
- directRenderScript: true,
- },
image: {
remotePatterns: [{ protocol: 'https' }],
},
@@ -73,7 +70,7 @@ export default defineConfig({
'./src/styles/starlight.css',
],
editLink: {
- baseUrl: 'https://github.com/withstudiocms/studiocms/tree/main/www/docs',
+ baseUrl: 'https://github.com/withstudiocms/studiocms/tree/main/docs',
},
head: [
// {
@@ -143,21 +140,6 @@ export default defineConfig({
autogenerate: { directory: 'customizing/studiocms-renderers' },
collapsed: true,
},
- {
- label: '@studiocms/ui',
- badge: { text: 'New', variant: 'success' },
- items: [
- { label: 'Getting Started', link: 'customizing/studiocms-ui/' },
- {
- label: 'Components',
- autogenerate: {
- directory: 'customizing/studiocms-ui/components',
- collapsed: true,
- },
- },
- ],
- collapsed: true,
- },
],
},
],
diff --git a/www/docs/ec.config.mjs b/docs/ec.config.mjs
similarity index 87%
rename from www/docs/ec.config.mjs
rename to docs/ec.config.mjs
index 74fc964ab..bb02c7ba3 100644
--- a/www/docs/ec.config.mjs
+++ b/docs/ec.config.mjs
@@ -24,7 +24,9 @@ export default defineEcConfig({
}),
],
styleOverrides: {
- // @ts-expect-error - This is not a Standard EC config option, but it's a valid one from a plugin
+ frames: {
+ editorActiveTabIndicatorBottomColor: 'var(--sl-color-accent)',
+ },
twoSlash: {
cursorColor: '#f8f8f2',
},
diff --git a/www/docs/hostUtils.ts b/docs/hostUtils.ts
similarity index 100%
rename from www/docs/hostUtils.ts
rename to docs/hostUtils.ts
diff --git a/www/docs/lunaria.config.ts b/docs/lunaria.config.ts
similarity index 100%
rename from www/docs/lunaria.config.ts
rename to docs/lunaria.config.ts
diff --git a/www/docs/lunaria/components.ts b/docs/lunaria/components.ts
similarity index 100%
rename from www/docs/lunaria/components.ts
rename to docs/lunaria/components.ts
diff --git a/www/docs/lunaria/styles.ts b/docs/lunaria/styles.ts
similarity index 100%
rename from www/docs/lunaria/styles.ts
rename to docs/lunaria/styles.ts
diff --git a/www/docs/package.json b/docs/package.json
similarity index 98%
rename from www/docs/package.json
rename to docs/package.json
index 8d46c63a3..b84128564 100644
--- a/www/docs/package.json
+++ b/docs/package.json
@@ -16,7 +16,7 @@
"@studiocms/renderers": "workspace:*",
"@studiocms/blog": "workspace:*",
"@studiocms/devapps": "workspace:*",
- "@studiocms/ui": "workspace:*",
+ "@studiocms/ui": "catalog:",
"astro": "catalog:",
"@astrojs/check": "catalog:",
diff --git a/www/docs/public/logo-light.svg b/docs/public/logo-light.svg
similarity index 100%
rename from www/docs/public/logo-light.svg
rename to docs/public/logo-light.svg
diff --git a/www/docs/public/og.jpg b/docs/public/og.jpg
similarity index 100%
rename from www/docs/public/og.jpg
rename to docs/public/og.jpg
diff --git a/www/docs/scripts/lunaria-report-bot.ts b/docs/scripts/lunaria-report-bot.ts
similarity index 100%
rename from www/docs/scripts/lunaria-report-bot.ts
rename to docs/scripts/lunaria-report-bot.ts
diff --git a/www/docs/scripts/lunaria.mts b/docs/scripts/lunaria.mts
similarity index 100%
rename from www/docs/scripts/lunaria.mts
rename to docs/scripts/lunaria.mts
diff --git a/www/docs/src/assets/avatar.png b/docs/src/assets/avatar.png
similarity index 100%
rename from www/docs/src/assets/avatar.png
rename to docs/src/assets/avatar.png
diff --git a/www/docs/src/assets/gallery/CreateNewPageDark-1.png b/docs/src/assets/gallery/CreateNewPageDark-1.png
similarity index 100%
rename from www/docs/src/assets/gallery/CreateNewPageDark-1.png
rename to docs/src/assets/gallery/CreateNewPageDark-1.png
diff --git a/www/docs/src/assets/gallery/CreateNewPageDark.png b/docs/src/assets/gallery/CreateNewPageDark.png
similarity index 100%
rename from www/docs/src/assets/gallery/CreateNewPageDark.png
rename to docs/src/assets/gallery/CreateNewPageDark.png
diff --git a/www/docs/src/assets/gallery/CreateNewPageLight-1.png b/docs/src/assets/gallery/CreateNewPageLight-1.png
similarity index 100%
rename from www/docs/src/assets/gallery/CreateNewPageLight-1.png
rename to docs/src/assets/gallery/CreateNewPageLight-1.png
diff --git a/www/docs/src/assets/gallery/CreateNewPageLight-2.png b/docs/src/assets/gallery/CreateNewPageLight-2.png
similarity index 100%
rename from www/docs/src/assets/gallery/CreateNewPageLight-2.png
rename to docs/src/assets/gallery/CreateNewPageLight-2.png
diff --git a/www/docs/src/assets/gallery/DashboardDark.png b/docs/src/assets/gallery/DashboardDark.png
similarity index 100%
rename from www/docs/src/assets/gallery/DashboardDark.png
rename to docs/src/assets/gallery/DashboardDark.png
diff --git a/www/docs/src/assets/gallery/DashboardLight.png b/docs/src/assets/gallery/DashboardLight.png
similarity index 100%
rename from www/docs/src/assets/gallery/DashboardLight.png
rename to docs/src/assets/gallery/DashboardLight.png
diff --git a/www/docs/src/assets/gallery/EditPageDark-1.png b/docs/src/assets/gallery/EditPageDark-1.png
similarity index 100%
rename from www/docs/src/assets/gallery/EditPageDark-1.png
rename to docs/src/assets/gallery/EditPageDark-1.png
diff --git a/www/docs/src/assets/gallery/EditPageDark-2.png b/docs/src/assets/gallery/EditPageDark-2.png
similarity index 100%
rename from www/docs/src/assets/gallery/EditPageDark-2.png
rename to docs/src/assets/gallery/EditPageDark-2.png
diff --git a/www/docs/src/assets/gallery/EditPageLight-1.png b/docs/src/assets/gallery/EditPageLight-1.png
similarity index 100%
rename from www/docs/src/assets/gallery/EditPageLight-1.png
rename to docs/src/assets/gallery/EditPageLight-1.png
diff --git a/www/docs/src/assets/gallery/EditPageLight-2.png b/docs/src/assets/gallery/EditPageLight-2.png
similarity index 100%
rename from www/docs/src/assets/gallery/EditPageLight-2.png
rename to docs/src/assets/gallery/EditPageLight-2.png
diff --git a/www/docs/src/assets/gallery/ExistingPageLight.png b/docs/src/assets/gallery/ExistingPageLight.png
similarity index 100%
rename from www/docs/src/assets/gallery/ExistingPageLight.png
rename to docs/src/assets/gallery/ExistingPageLight.png
diff --git a/www/docs/src/assets/gallery/ExistingPagesDark.png b/docs/src/assets/gallery/ExistingPagesDark.png
similarity index 100%
rename from www/docs/src/assets/gallery/ExistingPagesDark.png
rename to docs/src/assets/gallery/ExistingPagesDark.png
diff --git a/www/docs/src/assets/gallery/LoginPageDark.png b/docs/src/assets/gallery/LoginPageDark.png
similarity index 100%
rename from www/docs/src/assets/gallery/LoginPageDark.png
rename to docs/src/assets/gallery/LoginPageDark.png
diff --git a/www/docs/src/assets/gallery/LoginPageLight.png b/docs/src/assets/gallery/LoginPageLight.png
similarity index 100%
rename from www/docs/src/assets/gallery/LoginPageLight.png
rename to docs/src/assets/gallery/LoginPageLight.png
diff --git a/www/docs/src/assets/gallery/SiteAdminsDark.png b/docs/src/assets/gallery/SiteAdminsDark.png
similarity index 100%
rename from www/docs/src/assets/gallery/SiteAdminsDark.png
rename to docs/src/assets/gallery/SiteAdminsDark.png
diff --git a/www/docs/src/assets/gallery/SiteConfigDark.png b/docs/src/assets/gallery/SiteConfigDark.png
similarity index 100%
rename from www/docs/src/assets/gallery/SiteConfigDark.png
rename to docs/src/assets/gallery/SiteConfigDark.png
diff --git a/www/docs/src/assets/gallery/UserProfileDark.png b/docs/src/assets/gallery/UserProfileDark.png
similarity index 100%
rename from www/docs/src/assets/gallery/UserProfileDark.png
rename to docs/src/assets/gallery/UserProfileDark.png
diff --git a/www/docs/src/assets/gallery/UserProfileLight.png b/docs/src/assets/gallery/UserProfileLight.png
similarity index 100%
rename from www/docs/src/assets/gallery/UserProfileLight.png
rename to docs/src/assets/gallery/UserProfileLight.png
diff --git a/www/docs/src/assets/index.ts b/docs/src/assets/index.ts
similarity index 100%
rename from www/docs/src/assets/index.ts
rename to docs/src/assets/index.ts
diff --git a/www/docs/src/assets/web-vitals/cv-analytics-dark.png b/docs/src/assets/web-vitals/cv-analytics-dark.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/cv-analytics-dark.png
rename to docs/src/assets/web-vitals/cv-analytics-dark.png
diff --git a/www/docs/src/assets/web-vitals/cv-analytics-light.png b/docs/src/assets/web-vitals/cv-analytics-light.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/cv-analytics-light.png
rename to docs/src/assets/web-vitals/cv-analytics-light.png
diff --git a/www/docs/src/assets/web-vitals/cv-byroute-dark.png b/docs/src/assets/web-vitals/cv-byroute-dark.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/cv-byroute-dark.png
rename to docs/src/assets/web-vitals/cv-byroute-dark.png
diff --git a/www/docs/src/assets/web-vitals/cv-byroute-light.png b/docs/src/assets/web-vitals/cv-byroute-light.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/cv-byroute-light.png
rename to docs/src/assets/web-vitals/cv-byroute-light.png
diff --git a/www/docs/src/assets/web-vitals/cv-progressbars-dark.png b/docs/src/assets/web-vitals/cv-progressbars-dark.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/cv-progressbars-dark.png
rename to docs/src/assets/web-vitals/cv-progressbars-dark.png
diff --git a/www/docs/src/assets/web-vitals/cv-progressbars-light.png b/docs/src/assets/web-vitals/cv-progressbars-light.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/cv-progressbars-light.png
rename to docs/src/assets/web-vitals/cv-progressbars-light.png
diff --git a/www/docs/src/assets/web-vitals/pagespeed-dark.png b/docs/src/assets/web-vitals/pagespeed-dark.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/pagespeed-dark.png
rename to docs/src/assets/web-vitals/pagespeed-dark.png
diff --git a/www/docs/src/assets/web-vitals/pagespeed-light.png b/docs/src/assets/web-vitals/pagespeed-light.png
similarity index 100%
rename from www/docs/src/assets/web-vitals/pagespeed-light.png
rename to docs/src/assets/web-vitals/pagespeed-light.png
diff --git a/www/docs/src/components/ContributorList.astro b/docs/src/components/ContributorList.astro
similarity index 100%
rename from www/docs/src/components/ContributorList.astro
rename to docs/src/components/ContributorList.astro
diff --git a/www/docs/src/components/DropdownScript.astro b/docs/src/components/DropdownScript.astro
similarity index 100%
rename from www/docs/src/components/DropdownScript.astro
rename to docs/src/components/DropdownScript.astro
diff --git a/www/docs/src/components/FacePile.astro b/docs/src/components/FacePile.astro
similarity index 100%
rename from www/docs/src/components/FacePile.astro
rename to docs/src/components/FacePile.astro
diff --git a/www/docs/src/components/Gallery.astro b/docs/src/components/Gallery.astro
similarity index 100%
rename from www/docs/src/components/Gallery.astro
rename to docs/src/components/Gallery.astro
diff --git a/www/docs/src/components/Integration.astro b/docs/src/components/Integration.astro
similarity index 100%
rename from www/docs/src/components/Integration.astro
rename to docs/src/components/Integration.astro
diff --git a/www/docs/src/components/ModalScript.astro b/docs/src/components/ModalScript.astro
similarity index 100%
rename from www/docs/src/components/ModalScript.astro
rename to docs/src/components/ModalScript.astro
diff --git a/www/docs/src/components/PackageCatalog.astro b/docs/src/components/PackageCatalog.astro
similarity index 93%
rename from www/docs/src/components/PackageCatalog.astro
rename to docs/src/components/PackageCatalog.astro
index 6fa1f7543..28b325e68 100644
--- a/www/docs/src/components/PackageCatalog.astro
+++ b/docs/src/components/PackageCatalog.astro
@@ -42,7 +42,7 @@ const packages = (await getCollection('package-catalog'))
{description}
- {Astro.locals.t('package-catalog.readmore.start')} {Astro.locals.t('package-catalog.readmore.end')}
+ {Astro.locals.t('package-catalog.readmore.start')} {Astro.locals.t('package-catalog.readmore.end')}{(href.startsWith('https://') || href.startsWith('http://')) && ' ⤴'}
<>{ index < packages.length - 1 && }>
))
diff --git a/www/docs/src/components/PreviewCard.astro b/docs/src/components/PreviewCard.astro
similarity index 100%
rename from www/docs/src/components/PreviewCard.astro
rename to docs/src/components/PreviewCard.astro
diff --git a/www/docs/src/components/ReadMore.astro b/docs/src/components/ReadMore.astro
similarity index 100%
rename from www/docs/src/components/ReadMore.astro
rename to docs/src/components/ReadMore.astro
diff --git a/www/docs/src/components/Sponsors.astro b/docs/src/components/Sponsors.astro
similarity index 100%
rename from www/docs/src/components/Sponsors.astro
rename to docs/src/components/Sponsors.astro
diff --git a/www/docs/src/components/ThemeHelperScript.astro b/docs/src/components/ThemeHelperScript.astro
similarity index 100%
rename from www/docs/src/components/ThemeHelperScript.astro
rename to docs/src/components/ThemeHelperScript.astro
diff --git a/www/docs/src/components/ToasterScript.astro b/docs/src/components/ToasterScript.astro
similarity index 100%
rename from www/docs/src/components/ToasterScript.astro
rename to docs/src/components/ToasterScript.astro
diff --git a/www/docs/src/components/TursoCLI.astro b/docs/src/components/TursoCLI.astro
similarity index 100%
rename from www/docs/src/components/TursoCLI.astro
rename to docs/src/components/TursoCLI.astro
diff --git a/www/docs/src/components/Version.astro b/docs/src/components/Version.astro
similarity index 100%
rename from www/docs/src/components/Version.astro
rename to docs/src/components/Version.astro
diff --git a/www/docs/src/components/Youtube.astro b/docs/src/components/Youtube.astro
similarity index 100%
rename from www/docs/src/components/Youtube.astro
rename to docs/src/components/Youtube.astro
diff --git a/www/docs/src/components/landing/Card.astro b/docs/src/components/landing/Card.astro
similarity index 100%
rename from www/docs/src/components/landing/Card.astro
rename to docs/src/components/landing/Card.astro
diff --git a/www/docs/src/components/landing/ListCard.astro b/docs/src/components/landing/ListCard.astro
similarity index 100%
rename from www/docs/src/components/landing/ListCard.astro
rename to docs/src/components/landing/ListCard.astro
diff --git a/www/docs/src/components/landing/SplitCard.astro b/docs/src/components/landing/SplitCard.astro
similarity index 100%
rename from www/docs/src/components/landing/SplitCard.astro
rename to docs/src/components/landing/SplitCard.astro
diff --git a/docs/src/content.config.ts b/docs/src/content.config.ts
new file mode 100644
index 000000000..ea8715a5e
--- /dev/null
+++ b/docs/src/content.config.ts
@@ -0,0 +1,65 @@
+import { defineCollection, reference, z } from 'astro:content';
+import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders';
+import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
+import { glob } from 'astro/loaders';
+
+const packageCatalogSchema = z.object({
+ name: z.string(),
+ description: z.string(),
+ docsLink: z.string(),
+ githubURL: z.string(),
+ catalog: z
+ .union([z.literal('studiocms'), z.literal('community')])
+ .optional()
+ .default('studiocms'),
+ isPlugin: z.boolean().optional().default(false),
+ publiclyUsable: z.boolean().optional().default(false),
+ released: z.boolean().optional().default(true),
+});
+
+const baseSchema = z.object({
+ type: z.literal('base').optional().default('base'),
+ i18nReady: z.boolean().optional().default(false),
+});
+
+const integrationSchema = baseSchema.extend({
+ type: z.literal('integration'),
+ catalogEntry: reference('package-catalog'),
+});
+
+const redirectSchema = baseSchema.extend({
+ type: z.literal('redirect'),
+ redirect: z.string(),
+});
+
+export const collections = {
+ docs: defineCollection({
+ loader: docsLoader(),
+ schema: docsSchema({ extend: z.union([baseSchema, integrationSchema, redirectSchema]) }),
+ }),
+ i18n: defineCollection({
+ loader: i18nLoader(),
+ schema: i18nSchema({
+ extend: z.object({
+ 'site-title.labels.docs': z.string().optional(),
+ 'site-title.labels.main-site': z.string().optional(),
+ 'site-title.labels.live-demo': z.string().optional(),
+ 'sponsors.sponsoredby': z.string().optional(),
+ 'package-catalog.readmore.start': z.string().optional(),
+ 'package-catalog.readmore.end': z.string().optional(),
+ 'integration-labels.changelog': z.string().optional(),
+ 'contributors.core-packages': z.string().optional(),
+ 'contributors.ui-library': z.string().optional(),
+ 'contributors.devapps': z.string().optional(),
+ 'contributors.plugins': z.string().optional(),
+ 'contributors.documentation': z.string().optional(),
+ 'contributors.website': z.string().optional(),
+ 'contributors.bots': z.string().optional(),
+ }),
+ }),
+ }),
+ 'package-catalog': defineCollection({
+ loader: glob({ pattern: '*.json', base: 'src/content/package-catalog' }),
+ schema: packageCatalogSchema,
+ }),
+};
diff --git a/www/docs/src/content/docs/config-reference/dashboard.mdx b/docs/src/content/docs/config-reference/dashboard/index.mdx
similarity index 68%
rename from www/docs/src/content/docs/config-reference/dashboard.mdx
rename to docs/src/content/docs/config-reference/dashboard/index.mdx
index 13040ab26..944827c2d 100644
--- a/www/docs/src/content/docs/config-reference/dashboard.mdx
+++ b/docs/src/content/docs/config-reference/dashboard/index.mdx
@@ -79,59 +79,6 @@ export default defineStudioCMSConfig({
})
```
-### `UnoCSSConfigOverride`
-
-- **Type:** `unocssConfigSchema{} | undefined{}`
-
-Allows customization of the UnoCSS Configuration.
-
-#### `injectReset`
-
-- **Type:** `boolean | undefined`
-- **Default:** `false`
-
-Allows the user to enable or disable the UnoCSS Default Reset import.
-
-#### `injectEntry`
-
-- **Type:** `boolean | undefined`
-- **Default:** `false`
-
-Allows the user to enable or disable the UnoCSS Default Entry import.
-
-#### `presetsConfig`
-
-- **Type:** `unocssPresetsSchema{} | undefined{}`
-
-Allows the user to modify the included UnoCSS Presets.
-
-##### `presetDaisyUI`
-
-- **Type:** `unocssDaisyUISchema{} | undefined{}`
-
-Allows the user to enable or disable the UnoCSS DaisyUI Preset.
-
-###### `themes`
-
-- **Type:** `Array | undefined`
-- **Default:** `['dark', 'light']`
-
-Allows the user to use any of the available DaisyUI themes.
-
-###### `lightTheme`
-
-- **Type:** `string | undefined`
-- **Default:** `'light'`
-
-Allows the user to set the default light theme.
-
-###### `darkTheme`
-
-- **Type:** `string | undefined`
-- **Default:** `'dark'`
-
-Allows the user to set the default dark theme.
-
### `developerConfig`
- **Type:** `developerConfigSchema{} | undefined{}`
diff --git a/www/docs/src/content/docs/config-reference/default-frontend-config.mdx b/docs/src/content/docs/config-reference/default-frontend-config/index.mdx
similarity index 100%
rename from www/docs/src/content/docs/config-reference/default-frontend-config.mdx
rename to docs/src/content/docs/config-reference/default-frontend-config/index.mdx
diff --git a/www/docs/src/content/docs/config-reference/image-service.mdx b/docs/src/content/docs/config-reference/image-service/index.mdx
similarity index 100%
rename from www/docs/src/content/docs/config-reference/image-service.mdx
rename to docs/src/content/docs/config-reference/image-service/index.mdx
diff --git a/docs/src/content/docs/config-reference/included-integrations/index.mdx b/docs/src/content/docs/config-reference/included-integrations/index.mdx
new file mode 100644
index 000000000..ac1ac45c0
--- /dev/null
+++ b/docs/src/content/docs/config-reference/included-integrations/index.mdx
@@ -0,0 +1,28 @@
+---
+i18nReady: true
+title: includedIntegrations
+description: A reference page for includedIntegrations
+sidebar:
+ order: 6
+---
+
+`includedIntegrations` is an object that is used to determine which Astro Integrations should be included in the `studioCMS`. Currently there are three Integrations that can be included: `useAstroRobots`, `astroRobotsConfig`, and `useInoxSitemap`.
+
+## Usage
+
+```ts twoslash {2-6} title="studiocms.config.mjs"
+import { defineStudioCMSConfig } from 'studiocms';
+// ---cut---
+export default defineStudioCMSConfig({
+ includedIntegrations: {
+ robotsTXT: true,
+ },
+})
+```
+
+### `robotsTXT`
+
+- **Type:** `boolean` | `RobotsConfig{}` | `undefined`
+- **Default:** `true`
+
+Allows the user to enable/disable the use of the StudioCMS Custom `astro-robots-txt` Integration. For more information on this Integration please visit the [Astro Robots Integration](https://www.npmjs.com/package/astro-robots).
\ No newline at end of file
diff --git a/www/docs/src/content/docs/config-reference/options-schema.mdx b/docs/src/content/docs/config-reference/options-schema.mdx
similarity index 88%
rename from www/docs/src/content/docs/config-reference/options-schema.mdx
rename to docs/src/content/docs/config-reference/options-schema.mdx
index a1817c1e7..76e860dad 100644
--- a/www/docs/src/content/docs/config-reference/options-schema.mdx
+++ b/docs/src/content/docs/config-reference/options-schema.mdx
@@ -21,7 +21,9 @@ export default defineStudioCMSConfig({
defaultFrontEndConfig: {},
dashboardConfig: {},
includedIntegrations: {},
+ plugins: [],
dateLocale: 'en-us',
+ overrides: {},
verbose: false,
});
```
@@ -85,6 +87,25 @@ export default defineStudioCMSConfig({
[See `includedIntegrations` for full options](/config-reference/included-integrations)
+## `plugins`
+
+`plugins` is an array of plugins that can be used to extend the functionality of `studioCMS`.
+
+- **Type:** `Array`
+- **Default:** `[]`
+
+### Usage
+
+```ts twoslash {2} title="studiocms.config.mjs"
+import { defineStudioCMSConfig } from 'studiocms';
+// ---cut---
+export default defineStudioCMSConfig({
+ plugins: [
+ // Add your plugins here
+ ],
+})
+```
+
## `dateLocale`
Date locale used for formatting dates
diff --git a/www/docs/src/content/docs/config-reference/overrides.mdx b/docs/src/content/docs/config-reference/overrides/index.mdx
similarity index 100%
rename from www/docs/src/content/docs/config-reference/overrides.mdx
rename to docs/src/content/docs/config-reference/overrides/index.mdx
diff --git a/www/docs/src/content/docs/config-reference/renderer-config.mdx b/docs/src/content/docs/config-reference/renderer-config/index.mdx
similarity index 68%
rename from www/docs/src/content/docs/config-reference/renderer-config.mdx
rename to docs/src/content/docs/config-reference/renderer-config/index.mdx
index c28bec468..34e5d05f1 100644
--- a/www/docs/src/content/docs/config-reference/renderer-config.mdx
+++ b/docs/src/content/docs/config-reference/renderer-config/index.mdx
@@ -12,10 +12,10 @@ import ReadMore from '~/components/ReadMore.astro';
The Markdown Content Renderer to use for rendering pages within StudioCMS
-- **Type:** `'marked'` | `'markdoc'` | `'astro'` | `'mdx'` | `CustomRenderer`
-- **Default:** `'marked'`
+- **Type:** `'astro'` | `'markdoc'` | `'mdx'` | `CustomRenderer`
+- **Default:** `'astro'`
-`renderer` determines how Markdown content should be rendered in `studioCMS`. This is used to setup your content data. The default value is `marked` but you can also use `markdoc` or `astro` which uses Astro's built-in Remark processor.
+`renderer` determines how Markdown content should be rendered in `studioCMS`. This is used to setup your content data. The default value is `astro` which uses the Astro built-in markdown processor but you can also use `markdoc`, `mdx` or define a Custom Renderer.
### Usage
@@ -24,22 +24,13 @@ import { defineStudioCMSConfig } from 'studiocms';
// ---cut---
export default defineStudioCMSConfig({
rendererConfig: {
- renderer: 'marked',
- markedConfig: {},
+ renderer: 'astro',
markdocConfig: {},
mdxConfig: {},
},
})
```
-## `markedConfig`
-
-`markedConfig` is an object that is used to determine how content should be rendered in the `studioCMS`. This is used to setup your content data.
-
-### Usage
-
-[See `markedConfig` for full options](/config-reference/marked-config)
-
## `markdocConfig`
`markdocConfig` is an object that is used to determine how content should be rendered in `studiocms` while using the MarkDoc renderer.
diff --git a/www/docs/src/content/docs/config-reference/markdoc-config.mdx b/docs/src/content/docs/config-reference/renderer-config/markdoc-config.mdx
similarity index 95%
rename from www/docs/src/content/docs/config-reference/markdoc-config.mdx
rename to docs/src/content/docs/config-reference/renderer-config/markdoc-config.mdx
index 612c3231c..37d7c00b5 100644
--- a/www/docs/src/content/docs/config-reference/markdoc-config.mdx
+++ b/docs/src/content/docs/config-reference/renderer-config/markdoc-config.mdx
@@ -30,7 +30,7 @@ This property has the following options:
### `renderType`
-- **Type:** `'html' | 'react-static' | markdocRenderer`
+- **Type:** `'html' | 'react-static' | MarkdocRenderer`
The MarkDoc content renderer type to use for rendering pages and posts can be `html`, `react-static` or a custom markdocRenderer.
diff --git a/www/docs/src/content/docs/config-reference/mdx-config.mdx b/docs/src/content/docs/config-reference/renderer-config/mdx-config.mdx
similarity index 100%
rename from www/docs/src/content/docs/config-reference/mdx-config.mdx
rename to docs/src/content/docs/config-reference/renderer-config/mdx-config.mdx
diff --git a/www/docs/src/content/docs/contributing/code-contributions.mdx b/docs/src/content/docs/contributing/code-contributions.mdx
similarity index 97%
rename from www/docs/src/content/docs/contributing/code-contributions.mdx
rename to docs/src/content/docs/contributing/code-contributions.mdx
index 2d3144c20..4978cf68b 100644
--- a/www/docs/src/content/docs/contributing/code-contributions.mdx
+++ b/docs/src/content/docs/contributing/code-contributions.mdx
@@ -27,7 +27,7 @@ Scan through our [existing issues](https://github.com/withstudiocms/studiocms/is
- Using the command line:
- [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them.
-2. Install or update **Node.js** and **pnpm**, to the versions specified in [`.prototools`](https://github.com/astrolicious/studiocms/blob/main/.prototools).
+2. Install or update **Node.js** and **pnpm**, to the versions specified in [`.prototools`](https://github.com/withstudiocms/studiocms/blob/main/.prototools).
3. Create a working branch and start with your changes!
diff --git a/www/docs/src/content/docs/contributing/getting-started.mdx b/docs/src/content/docs/contributing/getting-started.mdx
similarity index 100%
rename from www/docs/src/content/docs/contributing/getting-started.mdx
rename to docs/src/content/docs/contributing/getting-started.mdx
diff --git a/www/docs/src/content/docs/contributing/translations.mdx b/docs/src/content/docs/contributing/translations.mdx
similarity index 100%
rename from www/docs/src/content/docs/contributing/translations.mdx
rename to docs/src/content/docs/contributing/translations.mdx
diff --git a/www/docs/src/content/docs/customizing/studiocms-renderers/index.mdx b/docs/src/content/docs/customizing/studiocms-renderers/index.mdx
similarity index 73%
rename from www/docs/src/content/docs/customizing/studiocms-renderers/index.mdx
rename to docs/src/content/docs/customizing/studiocms-renderers/index.mdx
index f7e5ddaf6..457732e55 100644
--- a/www/docs/src/content/docs/customizing/studiocms-renderers/index.mdx
+++ b/docs/src/content/docs/customizing/studiocms-renderers/index.mdx
@@ -13,17 +13,16 @@ import { defineStudioCMSConfig } from 'studiocms';
// ---cut---
export default defineStudioCMSConfig({
rendererConfig: {
- renderer: 'marked',
- markedConfig: {},
+ renderer: 'astro',
markdocConfig: {},
mdxConfig: {},
},
})
```
-## Marked Renderer
+## Astro Remark Renderer
-The default renderer for StudioCMS is the `marked` renderer. This renderer is used to render markdown content into HTML. This renderer is used by default when no other renderer is specified.
+The default renderer for StudioCMS is the `astro` renderer. This renderer is used to render markdown content into HTML. This renderer is used by default when no other renderer is specified and adapts the markdown configuration from your `astro.config.mjs` file.
### Usage
@@ -32,14 +31,14 @@ import { defineStudioCMSConfig } from 'studiocms';
// ---cut---
export default defineStudioCMSConfig({
rendererConfig: {
- renderer: 'marked'
+ renderer: 'astro'
},
})
```
### Configuration
-see [Marked Configuration](/config-reference/marked-config/) for more information on how to configure the Marked renderer.
+see [Marked Configuration](/config-reference/renderer-config/marked-config/) for more information on how to configure the Marked renderer.
## MDX Renderer
@@ -59,7 +58,7 @@ export default defineStudioCMSConfig({
### Configuration
-See [MDX Configuration](/config-reference/mdx-config/) for more information on how to configure the MDX renderer.
+See [MDX Configuration](/config-reference/renderer-config/mdx-config/) for more information on how to configure the MDX renderer.
## MarkDoc Renderer
@@ -79,7 +78,7 @@ export default defineStudioCMSConfig({
### Configuration
-see [MarkDoc Configuration](/config-reference/markdoc-config/) for more information on how to configure the MarkDoc renderer.
+see [MarkDoc Configuration](/config-reference/renderer-config/markdoc-config/) for more information on how to configure the MarkDoc renderer.
### Custom Renderers
@@ -87,22 +86,6 @@ StudioCMS's MarkDoc renderer allows you to define custom renderers for your cont
see [MarkDoc Renderers](/customizing/studiocms-renderers/markdoc/) for more information on how to define custom renderers for MarkDoc.
-## Astro Remark Renderer
-
-The default Astro renderer for their markdown content. This renderer adapts the markdown configuration from your `astro.config.mjs` file.
-
-### Usage
-
-```ts twoslash {3} title="studiocms.config.mjs"
-import { defineStudioCMSConfig } from 'studiocms';
-// ---cut---
-export default defineStudioCMSConfig({
- rendererConfig: {
- renderer: 'astro'
- },
-})
-```
-
### Configuration
See [Astro's Markdown Configuration](https://docs.astro.build/en/reference/configuration-reference/#markdown-options) for more information on how to configure the Astro Remark renderer.
diff --git a/www/docs/src/content/docs/customizing/studiocms-renderers/markdoc.mdx b/docs/src/content/docs/customizing/studiocms-renderers/markdoc.mdx
similarity index 96%
rename from www/docs/src/content/docs/customizing/studiocms-renderers/markdoc.mdx
rename to docs/src/content/docs/customizing/studiocms-renderers/markdoc.mdx
index 1ce9dc500..fd6f358b0 100644
--- a/www/docs/src/content/docs/customizing/studiocms-renderers/markdoc.mdx
+++ b/docs/src/content/docs/customizing/studiocms-renderers/markdoc.mdx
@@ -108,4 +108,4 @@ Normally, users will not need to install the `@studiocms/renderers` package dire
{/* */}
-For more information on how to configure the MarkDoc renderer, see the [MarkDoc Configuration](/config-reference/markdoc-config/) documentation.
+For more information on how to configure the MarkDoc renderer, see the [MarkDoc Configuration](/config-reference/renderer-config/markdoc-config/) documentation.
diff --git a/www/docs/src/content/docs/how-it-works/index.mdx b/docs/src/content/docs/how-it-works/index.mdx
similarity index 95%
rename from www/docs/src/content/docs/how-it-works/index.mdx
rename to docs/src/content/docs/how-it-works/index.mdx
index cd5125b57..1a2bfbe9f 100644
--- a/www/docs/src/content/docs/how-it-works/index.mdx
+++ b/docs/src/content/docs/how-it-works/index.mdx
@@ -85,15 +85,12 @@ The StudioCMS Auth integration provides authentication configuration options for
### StudioCMS: Dashboard
-The StudioCMS Dashboard is a web interface that allows you to manage your StudioCMS project. It provides a user-friendly interface for creating, editing, and deleting content for your project. The StudioCMS Dashboard is built with [Astro](https://astro.build) and [DaisyUI](https://daisyui.com/) with [UnoCSS](https://unocss.dev).
+The StudioCMS Dashboard is a web interface that allows you to manage your StudioCMS project. It provides a user-friendly interface for creating, editing, and deleting content for your project. The StudioCMS Dashboard is built with [Astro](https://astro.build) and our [`@studiocms/ui](/customizing/studiocms-ui/) library.
#### Tech Stack
- **Dashboard**: The StudioCMS Dashboard provides a user-friendly interface for managing your StudioCMS project.
-- **UnoCSS**: The StudioCMS Dashboard uses UnoCSS for styling and theming.
-- **DaisyUI**: The StudioCMS Dashboard uses DaisyUI for styling and theming.
- **AuthConfig**: The StudioCMS Dashboard provides authentication configuration options.
-- **Astrolace**: The StudioCMS Dashboard is built using [Astrolace](https://github.com/matthiesenxyz/astrolace) a [Shoelace.style](https://shoelace.style) Astro Integration.
- **DashboardRouteOverride**: The StudioCMS Dashboard provides a dashboard route override configuration option. Allowing you to change the default route for the StudioCMS Dashboard and API.
### StudioCMS: ImageHandler
diff --git a/www/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx
similarity index 99%
rename from www/docs/src/content/docs/index.mdx
rename to docs/src/content/docs/index.mdx
index d24f71530..47b78c449 100644
--- a/www/docs/src/content/docs/index.mdx
+++ b/docs/src/content/docs/index.mdx
@@ -51,7 +51,7 @@ import { Center } from '@studiocms/ui/components';
For a more in-depth guide, check out the [Getting Started](/start-here/getting-started) guide.
- Looking for a libSQL database? Check out [Turso](https://turso.tech).
+ Looking for a libSQL database? Check out [Turso](https://tur.so/studiocms).
diff --git a/www/docs/src/content/docs/package-catalog/community-integrations/web-vitals.mdx b/docs/src/content/docs/package-catalog/community-integrations/web-vitals.mdx
similarity index 100%
rename from www/docs/src/content/docs/package-catalog/community-integrations/web-vitals.mdx
rename to docs/src/content/docs/package-catalog/community-integrations/web-vitals.mdx
diff --git a/www/docs/src/content/docs/package-catalog/index.mdx b/docs/src/content/docs/package-catalog/index.mdx
similarity index 100%
rename from www/docs/src/content/docs/package-catalog/index.mdx
rename to docs/src/content/docs/package-catalog/index.mdx
diff --git a/www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-full-page-view.png b/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-full-page-view.png
similarity index 100%
rename from www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-full-page-view.png
rename to docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-full-page-view.png
diff --git a/www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-closed.png b/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-closed.png
similarity index 100%
rename from www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-closed.png
rename to docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-closed.png
diff --git a/www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-expanded.png b/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-expanded.png
similarity index 100%
rename from www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-expanded.png
rename to docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-1-toolbar-app-expanded.png
diff --git a/www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-2-importer.png b/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-2-importer.png
similarity index 100%
rename from www/docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-2-importer.png
rename to docs/src/content/docs/package-catalog/studiocms-integrations/assets/devapps-2-importer.png
diff --git a/www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-blog.mdx b/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-blog.mdx
similarity index 80%
rename from www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-blog.mdx
rename to docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-blog.mdx
index 6c2c2e85f..4ed6bb1cd 100644
--- a/www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-blog.mdx
+++ b/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-blog.mdx
@@ -39,7 +39,7 @@ This Astro integration enables the StudioCMS Blog feature in your Astro project.
2. Add `@studiocms/blog` to your astro config file:
- ```ts twoslash title="astro.config.mjs" ins={5, 14-19}
+ ```ts twoslash title="astro.config.mjs" ins={5, 14-21}
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import db from '@astrojs/db';
@@ -52,12 +52,15 @@ This Astro integration enables the StudioCMS Blog feature in your Astro project.
adapter: node({ mode: "standalone" }),
integrations: [
db(), // REQUIRED
- studioCMS(), // REQUIRED
- studioCMSBlog({
- config: {
- title: "My StudioCMS Blog",
- description: "A Simple Blog build with Astro, AstroDB, and StudioCMS.",
- },
+ studioCMS({
+ plugins: [
+ studioCMSBlog({
+ config: {
+ title: "My StudioCMS Blog",
+ description: "A Simple Blog build with Astro, AstroDB, and StudioCMS.",
+ },
+ }),
+ ],
}),
],
});
@@ -78,7 +81,7 @@ This integration will add the following new routes to your StudioCMS Controlled
### Example config
-```ts twoslash title="astro.config.mjs" {3-4, 13-14} ins={5, 15-20}
+```ts twoslash title="astro.config.mjs" {3-4, 13-14} ins={5, 15-22}
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import db from '@astrojs/db';
@@ -92,13 +95,16 @@ export default defineConfig({
adapter: node({ mode: "standalone" }),
integrations: [
db(), // REQUIRED
- studioCMS(), // REQUIRED
- studioCMSBlog({
- config: {
- title: "My StudioCMS Blog",
- description: "A Simple Blog build with Astro, Astrojs/DB, and StudioCMS.",
- },
- }),
+ studioCMS({
+ plugins: [
+ studioCMSBlog({
+ config: {
+ title: "My StudioCMS Blog",
+ description: "A Simple Blog build with Astro, AstroDB, and StudioCMS.",
+ },
+ }),
+ ],
+ }),
],
});
```
diff --git a/www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-devapps.mdx b/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-devapps.mdx
similarity index 100%
rename from www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-devapps.mdx
rename to docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-devapps.mdx
diff --git a/www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-ui.mdx b/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-ui.mdx
similarity index 77%
rename from www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-ui.mdx
rename to docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-ui.mdx
index 36bc106d5..ba39f6b6c 100644
--- a/www/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-ui.mdx
+++ b/docs/src/content/docs/package-catalog/studiocms-integrations/studiocms-ui.mdx
@@ -1,9 +1,10 @@
---
title: "@studiocms/ui"
type: "redirect"
-redirect: "/customizing/studiocms-ui/"
+redirect: "https://ui.studiocms.dev"
description: "The UI library for StudioCMS. Includes the layouts & components we use to build StudioCMS."
sidebar:
+ label: "@studiocms/ui ⤴"
badge:
text: 'Publicly Usable'
variant: 'caution'
diff --git a/www/docs/src/content/docs/start-here/configuration.mdx b/docs/src/content/docs/start-here/configuration.mdx
similarity index 100%
rename from www/docs/src/content/docs/start-here/configuration.mdx
rename to docs/src/content/docs/start-here/configuration.mdx
diff --git a/www/docs/src/content/docs/start-here/environment-variables.mdx b/docs/src/content/docs/start-here/environment-variables.mdx
similarity index 83%
rename from www/docs/src/content/docs/start-here/environment-variables.mdx
rename to docs/src/content/docs/start-here/environment-variables.mdx
index 38c8d48bf..c78b20061 100644
--- a/www/docs/src/content/docs/start-here/environment-variables.mdx
+++ b/docs/src/content/docs/start-here/environment-variables.mdx
@@ -17,12 +17,10 @@ You can create a `.env` file in the root directory of your project and add the r
For future reference on how to work with environment variables within Astro you can checkout [Environment Variables](https://docs.astro.build/guides/environment-variables) from the Astro documentation.
-
-
## Required Environment Variables
+In order to use StudioCMS, there are a few required environment variables that you must set up in your `.env` file.
+
### Database URL and Token for `@astrojs/db`
`ASTRO_DB_REMOTE_URL` - The connection URL to your libSQL server
@@ -50,13 +48,15 @@ openssl rand --base64 16
```
-## oAuth Authentication Environment Variables
+## Optional Environment Variables
+
+### oAuth Authentication Environment Variables
For more information about setting up oAuth authentication, see the [Configure oAuth Authentication](/start-here/getting-started/#optional-configure-oauth-authentication) documentation.
-### GitHub (Optional)
+#### GitHub (Optional)
To authenticate with GitHub, you need to add the following environment variables to your `.env` file:
@@ -71,7 +71,7 @@ CMS_GITHUB_REDIRECT_URI=
`CMS_GITHUB_REDIRECT_URI` is optional if you are using multiple redirect URIs with GitHub oAuth.
-### Discord (Optional)
+#### Discord (Optional)
```bash title=".env"
# credentials for Discord OAuth
@@ -80,7 +80,7 @@ CMS_DISCORD_CLIENT_SECRET=
CMS_DISCORD_REDIRECT_URI=
```
-### Google (Optional)
+#### Google (Optional)
```bash title=".env"
# credentials for Google OAuth
@@ -89,7 +89,7 @@ CMS_GOOGLE_CLIENT_SECRET=
CMS_GOOGLE_REDIRECT_URI=
```
-### Auth0 (Optional)
+#### Auth0 (Optional)
```bash title=".env"
# credentials for auth0 OAuth
@@ -99,9 +99,9 @@ CMS_AUTH0_DOMAIN=
CMS_AUTH0_REDIRECT_URI=
```
-## Image Handler Environment Variables
+### Image Handler Environment Variables
-### Cloudinary (Optional)
+#### Cloudinary (Optional)
If you choose to use the built-in Cloudinary plugin, you will need to define the following:
diff --git a/www/docs/src/content/docs/start-here/gallery.mdx b/docs/src/content/docs/start-here/gallery.mdx
similarity index 66%
rename from www/docs/src/content/docs/start-here/gallery.mdx
rename to docs/src/content/docs/start-here/gallery.mdx
index d75881bb0..aa423bba3 100644
--- a/www/docs/src/content/docs/start-here/gallery.mdx
+++ b/docs/src/content/docs/start-here/gallery.mdx
@@ -1,8 +1,11 @@
---
i18nReady: true
title: Gallery
-description: A small gallery of images to show off the StudioCMS
+description: A small gallery of images to show off StudioCMS
tableOfContents: false
+banner:
+ content: |
+ These images are for 0.1.0-beta.7 and below.
sidebar:
order: 5
---
diff --git a/www/docs/src/content/docs/start-here/getting-started.mdx b/docs/src/content/docs/start-here/getting-started.mdx
similarity index 100%
rename from www/docs/src/content/docs/start-here/getting-started.mdx
rename to docs/src/content/docs/start-here/getting-started.mdx
diff --git a/www/docs/src/content/docs/start-here/why-studioCMS.mdx b/docs/src/content/docs/start-here/why-studioCMS.mdx
similarity index 100%
rename from www/docs/src/content/docs/start-here/why-studioCMS.mdx
rename to docs/src/content/docs/start-here/why-studioCMS.mdx
diff --git a/www/docs/src/content/docs/studioCMS-dark.png b/docs/src/content/docs/studioCMS-dark.png
similarity index 100%
rename from www/docs/src/content/docs/studioCMS-dark.png
rename to docs/src/content/docs/studioCMS-dark.png
diff --git a/www/docs/src/content/docs/studioCMS.png b/docs/src/content/docs/studioCMS.png
similarity index 100%
rename from www/docs/src/content/docs/studioCMS.png
rename to docs/src/content/docs/studioCMS.png
diff --git a/www/docs/src/content/i18n/en.json b/docs/src/content/i18n/en.json
similarity index 100%
rename from www/docs/src/content/i18n/en.json
rename to docs/src/content/i18n/en.json
diff --git a/www/docs/src/content/package-catalog/astrojs-web-vitals.json b/docs/src/content/package-catalog/astrojs-web-vitals.json
similarity index 100%
rename from www/docs/src/content/package-catalog/astrojs-web-vitals.json
rename to docs/src/content/package-catalog/astrojs-web-vitals.json
diff --git a/www/docs/src/content/package-catalog/studiocms-blog.json b/docs/src/content/package-catalog/studiocms-blog.json
similarity index 100%
rename from www/docs/src/content/package-catalog/studiocms-blog.json
rename to docs/src/content/package-catalog/studiocms-blog.json
diff --git a/www/docs/src/content/package-catalog/studiocms-devapps.json b/docs/src/content/package-catalog/studiocms-devapps.json
similarity index 100%
rename from www/docs/src/content/package-catalog/studiocms-devapps.json
rename to docs/src/content/package-catalog/studiocms-devapps.json
diff --git a/www/docs/src/content/package-catalog/studiocms-ui.json b/docs/src/content/package-catalog/studiocms-ui.json
similarity index 84%
rename from www/docs/src/content/package-catalog/studiocms-ui.json
rename to docs/src/content/package-catalog/studiocms-ui.json
index 0914fe8ad..4eedb3481 100644
--- a/www/docs/src/content/package-catalog/studiocms-ui.json
+++ b/docs/src/content/package-catalog/studiocms-ui.json
@@ -2,9 +2,9 @@
"$schema": "../../../.astro/collections/package-catalog.schema.json",
"name": "@studiocms/ui",
"description": "The UI library for StudioCMS. Includes the layouts & components we use to build StudioCMS.",
- "docsLink": "/customizing/studiocms-ui/",
+ "docsLink": "https://ui.studiocms.dev",
"githubURL": "https://github.com/withstudiocms/studiocms/tree/main/packages/studiocms_ui/",
"catalog": "studiocms",
- "released": false,
+ "released": true,
"publiclyUsable": true
}
diff --git a/www/docs/src/content/package-catalog/studiocms.json b/docs/src/content/package-catalog/studiocms.json
similarity index 100%
rename from www/docs/src/content/package-catalog/studiocms.json
rename to docs/src/content/package-catalog/studiocms.json
diff --git a/www/docs/src/env.d.ts b/docs/src/env.d.ts
similarity index 100%
rename from www/docs/src/env.d.ts
rename to docs/src/env.d.ts
diff --git a/www/docs/src/plugins/rehype.types.ts b/docs/src/plugins/rehype.types.ts
similarity index 100%
rename from www/docs/src/plugins/rehype.types.ts
rename to docs/src/plugins/rehype.types.ts
diff --git a/www/docs/src/plugins/rehypeAutolink.ts b/docs/src/plugins/rehypeAutolink.ts
similarity index 96%
rename from www/docs/src/plugins/rehypeAutolink.ts
rename to docs/src/plugins/rehypeAutolink.ts
index 237af75c0..97f6dc2ae 100644
--- a/www/docs/src/plugins/rehypeAutolink.ts
+++ b/docs/src/plugins/rehypeAutolink.ts
@@ -3,7 +3,7 @@ import { h } from 'hastscript';
import { escape as esc } from 'html-escaper';
import rehypeAutoLink from 'rehype-autolink-headings';
import type { Options as rehypeAutolinkHeadingsOptions } from 'rehype-autolink-headings';
-import type { RehypePlugin } from './rehype.types';
+import type { RehypePlugin } from './rehype.types.ts';
const AnchorLinkIcon = h(
'span',
diff --git a/www/docs/src/plugins/rehypeExternalLinks.ts b/docs/src/plugins/rehypeExternalLinks.ts
similarity index 87%
rename from www/docs/src/plugins/rehypeExternalLinks.ts
rename to docs/src/plugins/rehypeExternalLinks.ts
index f1203c27c..9f519f119 100644
--- a/www/docs/src/plugins/rehypeExternalLinks.ts
+++ b/docs/src/plugins/rehypeExternalLinks.ts
@@ -1,5 +1,5 @@
import rehypeExternal from 'rehype-external-links';
-import type { RehypePlugin } from './rehype.types';
+import type { RehypePlugin } from './rehype.types.ts';
// biome-ignore lint/suspicious/noExplicitAny: any is used to match the generic type
export const rehypeExternalLinks: [RehypePlugin, any] = [
diff --git a/www/docs/src/plugins/rehypePluginKit.ts b/docs/src/plugins/rehypePluginKit.ts
similarity index 51%
rename from www/docs/src/plugins/rehypePluginKit.ts
rename to docs/src/plugins/rehypePluginKit.ts
index 4a74d0a0b..972516689 100644
--- a/www/docs/src/plugins/rehypePluginKit.ts
+++ b/docs/src/plugins/rehypePluginKit.ts
@@ -1,7 +1,7 @@
import rehypeSlug from 'rehype-slug';
-import type { RehypePlugins } from './rehype.types';
-import rehypeAutolinkHeadings from './rehypeAutolink';
-import rehypeExternalLinks from './rehypeExternalLinks';
+import type { RehypePlugins } from './rehype.types.ts';
+import rehypeAutolinkHeadings from './rehypeAutolink.ts';
+import rehypeExternalLinks from './rehypeExternalLinks.ts';
export const rehypePluginKit: RehypePlugins = [
rehypeSlug,
diff --git a/www/docs/src/share-link.ts b/docs/src/share-link.ts
similarity index 100%
rename from www/docs/src/share-link.ts
rename to docs/src/share-link.ts
diff --git a/www/docs/src/starlightOverrides/Head.astro b/docs/src/starlightOverrides/Head.astro
similarity index 100%
rename from www/docs/src/starlightOverrides/Head.astro
rename to docs/src/starlightOverrides/Head.astro
diff --git a/www/docs/src/starlightOverrides/PageTitle.astro b/docs/src/starlightOverrides/PageTitle.astro
similarity index 100%
rename from www/docs/src/starlightOverrides/PageTitle.astro
rename to docs/src/starlightOverrides/PageTitle.astro
diff --git a/www/docs/src/starlightOverrides/Sidebar.astro b/docs/src/starlightOverrides/Sidebar.astro
similarity index 100%
rename from www/docs/src/starlightOverrides/Sidebar.astro
rename to docs/src/starlightOverrides/Sidebar.astro
diff --git a/www/docs/src/starlightOverrides/SiteTitle.astro b/docs/src/starlightOverrides/SiteTitle.astro
similarity index 100%
rename from www/docs/src/starlightOverrides/SiteTitle.astro
rename to docs/src/starlightOverrides/SiteTitle.astro
diff --git a/www/docs/src/styles/sponsorcolors.css b/docs/src/styles/sponsorcolors.css
similarity index 100%
rename from www/docs/src/styles/sponsorcolors.css
rename to docs/src/styles/sponsorcolors.css
diff --git a/www/docs/src/styles/starlight.css b/docs/src/styles/starlight.css
similarity index 94%
rename from www/docs/src/styles/starlight.css
rename to docs/src/styles/starlight.css
index 2e424e718..919e3a3cb 100644
--- a/www/docs/src/styles/starlight.css
+++ b/docs/src/styles/starlight.css
@@ -77,9 +77,11 @@
border-radius: 8px;
}
-code,
+div.expressive-code,
starlight-file-tree {
- border-radius: 4px;
+ border-radius: 8px;
+ overflow: hidden;
+ border: 1px solid var(--ec-brdCol);
}
aside.starlight-aside {
@@ -195,3 +197,10 @@ button[aria-label="Menu"][aria-controls="starlight__sidebar"] {
a {
text-decoration: none;
}
+
+.expressive-code figcaption,
+.expressive-code figcaption::before,
+.expressive-code pre,
+.expressive-code span.title {
+ border: none !important;
+}
diff --git a/www/docs/src/typedocHelpers.ts b/docs/src/typedocHelpers.ts
similarity index 96%
rename from www/docs/src/typedocHelpers.ts
rename to docs/src/typedocHelpers.ts
index db522629b..b5700471e 100644
--- a/www/docs/src/typedocHelpers.ts
+++ b/docs/src/typedocHelpers.ts
@@ -2,7 +2,7 @@ import type { StarlightTypeDocOptions } from 'starlight-typedoc';
// Utility function to create TypeDoc related paths
export function getFilePathToPackage(name: string, path: string) {
- return `../../packages/${name}/${path}`;
+ return `../packages/${name}/${path}`;
}
// Utility function to create TypeDoc options for the StudioCMS packages so that each package documentation is the same when generated
diff --git a/www/docs/src/util-server.ts b/docs/src/util-server.ts
similarity index 100%
rename from www/docs/src/util-server.ts
rename to docs/src/util-server.ts
diff --git a/www/docs/src/util/SponsorLink.astro b/docs/src/util/SponsorLink.astro
similarity index 100%
rename from www/docs/src/util/SponsorLink.astro
rename to docs/src/util/SponsorLink.astro
diff --git a/www/docs/src/util/contributors.config.ts b/docs/src/util/contributors.config.ts
similarity index 94%
rename from www/docs/src/util/contributors.config.ts
rename to docs/src/util/contributors.config.ts
index a4d7b0450..0bb3d6702 100644
--- a/www/docs/src/util/contributors.config.ts
+++ b/docs/src/util/contributors.config.ts
@@ -23,9 +23,10 @@ export const contributorConfig = (Astro: AstroGlobal): ContributorConfig[] => [
paths: [
// OLD Paths
'packages/studioCMS/',
+ 'playgrounds/node/',
// NEW Paths
'README.md',
- 'playgrounds/node/',
+ 'playground/',
'packages/studiocms/',
'packages/studiocms_assets/',
'packages/studiocms_auth/',
@@ -48,6 +49,10 @@ export const contributorConfig = (Astro: AstroGlobal): ContributorConfig[] => [
type: 'byPath',
paths: ['packages/studiocms_ui/', 'playgrounds/ui/'],
},
+ {
+ repo: 'withstudiocms/ui',
+ type: 'all',
+ },
],
},
{
@@ -81,7 +86,7 @@ export const contributorConfig = (Astro: AstroGlobal): ContributorConfig[] => [
{
repo: 'withstudiocms/studiocms',
type: 'byPath',
- paths: ['www/docs/'],
+ paths: ['www/docs/', 'docs/'],
},
],
},
diff --git a/www/docs/src/util/getContributors.ts b/docs/src/util/getContributors.ts
similarity index 98%
rename from www/docs/src/util/getContributors.ts
rename to docs/src/util/getContributors.ts
index 79c8597ef..37eeaa396 100644
--- a/www/docs/src/util/getContributors.ts
+++ b/docs/src/util/getContributors.ts
@@ -1,6 +1,6 @@
import type { AstroGlobal } from 'astro';
-import { cachedFetch } from '../util-server';
-import { StudioCMSServiceAccounts, contributorConfig } from './contributors.config';
+import { cachedFetch } from '../util-server.ts';
+import { StudioCMSServiceAccounts, contributorConfig } from './contributors.config.ts';
export interface Contributor {
login: string;
diff --git a/www/docs/starlight-types.ts b/docs/starlight-types.ts
similarity index 100%
rename from www/docs/starlight-types.ts
rename to docs/starlight-types.ts
diff --git a/www/docs/starlight-virtual.d.ts b/docs/starlight-virtual.d.ts
similarity index 100%
rename from www/docs/starlight-virtual.d.ts
rename to docs/starlight-virtual.d.ts
diff --git a/www/docs/tsconfig.json b/docs/tsconfig.json
similarity index 65%
rename from www/docs/tsconfig.json
rename to docs/tsconfig.json
index 754f6f39c..462e11b6d 100644
--- a/www/docs/tsconfig.json
+++ b/docs/tsconfig.json
@@ -1,13 +1,12 @@
{
"extends": "astro/tsconfigs/strict",
+ "include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"],
"compilerOptions": {
"allowJs": true,
- "moduleResolution": "bundler",
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
- },
- "outDir": "../../.moon/cache/types/www/docs"
+ }
}
}
diff --git a/www/docs/typedoc.config.ts b/docs/typedoc.config.ts
similarity index 94%
rename from www/docs/typedoc.config.ts
rename to docs/typedoc.config.ts
index 6f4637a49..773bdd190 100644
--- a/www/docs/typedoc.config.ts
+++ b/docs/typedoc.config.ts
@@ -1,7 +1,7 @@
import type { StarlightPlugin } from '@astrojs/starlight/types';
import { createStarlightTypeDocPlugin } from 'starlight-typedoc';
-import { getFilePathToPackage, makeTypedocOpts } from './src/typedocHelpers';
-import type { SidebarGroup } from './starlight-types';
+import { getFilePathToPackage, makeTypedocOpts } from './src/typedocHelpers.ts';
+import type { SidebarGroup } from './starlight-types.ts';
// Create Starlight TypeDoc Plugins for different parts of the Astro StudioCMS Project
@@ -39,11 +39,7 @@ const TypeDocPlugins = (isProd: boolean, testingMode: boolean): StarlightPlugin[
name: 'studiocms',
output: 'studiocms',
dir: 'studiocms',
- entryPoints: [
- getFilePathToPackage('studiocms', 'src/index.ts'),
- getFilePathToPackage('studiocms', 'src/integration.ts'),
- getFilePathToPackage('studiocms', 'src/updateCheck.ts'),
- ],
+ entryPoints: [getFilePathToPackage('studiocms', 'src/index.ts')],
})
),
tdAuth(
@@ -95,9 +91,9 @@ const TypeDocPlugins = (isProd: boolean, testingMode: boolean): StarlightPlugin[
getFilePathToPackage('studiocms_core', 'src/schemas/config/index.ts'),
getFilePathToPackage('studiocms_core', 'src/schemas/config/integrations.ts'),
getFilePathToPackage('studiocms_core', 'src/schemas/config/markdoc.ts'),
- getFilePathToPackage('studiocms_core', 'src/schemas/config/marked.ts'),
getFilePathToPackage('studiocms_core', 'src/schemas/config/rendererConfig.ts'),
- getFilePathToPackage('studiocms_core', 'src/schemas/config/unocss.ts'),
+ getFilePathToPackage('studiocms_core', 'src/schemas/plugins/shared.ts'),
+ getFilePathToPackage('studiocms_core', 'src/schemas/plugins/index.ts'),
getFilePathToPackage('studiocms_core', 'src/lib/index.ts'),
getFilePathToPackage('studiocms_core', 'src/lib/configManager.ts'),
getFilePathToPackage('studiocms_core', 'src/lib/convertDashboardLinksType.ts'),
@@ -116,6 +112,7 @@ const TypeDocPlugins = (isProd: boolean, testingMode: boolean): StarlightPlugin[
getFilePathToPackage('studiocms_core', 'src/db/tables.ts'),
getFilePathToPackage('studiocms_core', 'src/db/tsTables.ts'),
getFilePathToPackage('studiocms_core', 'src/components/index.ts'),
+ getFilePathToPackage('studiocms_core', 'src/i18n/index.ts'),
],
})
),
@@ -145,6 +142,7 @@ const TypeDocPlugins = (isProd: boolean, testingMode: boolean): StarlightPlugin[
entryPoints: [
getFilePathToPackage('studiocms_frontend', 'src/index.ts'),
getFilePathToPackage('studiocms_frontend', 'src/integration.ts'),
+ getFilePathToPackage('studiocms_frontend', 'src/schema.ts'),
getFilePathToPackage('studiocms_frontend', 'src/components/index.ts'),
],
})
@@ -160,7 +158,7 @@ const TypeDocPlugins = (isProd: boolean, testingMode: boolean): StarlightPlugin[
getFilePathToPackage('studiocms_imagehandler', 'src/integration.ts'),
getFilePathToPackage('studiocms_imagehandler', 'src/components/index.ts'),
getFilePathToPackage('studiocms_imagehandler', 'src/components/props.ts'),
- getFilePathToPackage('studiocms_imagehandler', 'src/plugins/cloudinary.ts'),
+ getFilePathToPackage('studiocms_imagehandler', 'src/components/plugins/cloudinary.ts'),
],
})
),
@@ -183,7 +181,6 @@ const TypeDocPlugins = (isProd: boolean, testingMode: boolean): StarlightPlugin[
getFilePathToPackage('studiocms_renderers', 'src/lib/markdoc/index.ts'),
getFilePathToPackage('studiocms_renderers', 'src/lib/markdoc/markdocHTML.ts'),
getFilePathToPackage('studiocms_renderers', 'src/lib/markdoc/markdocReactStatic.ts'),
- getFilePathToPackage('studiocms_renderers', 'src/lib/marked/index.ts'),
getFilePathToPackage('studiocms_renderers', 'src/lib/mdx/index.ts'),
],
})
@@ -209,15 +206,16 @@ const TypeDocPlugins = (isProd: boolean, testingMode: boolean): StarlightPlugin[
entryPoints: [
getFilePathToPackage('studiocms_devapps', 'src/index.ts'),
getFilePathToPackage('studiocms_devapps', 'src/integration.ts'),
+ getFilePathToPackage('studiocms_devapps', 'src/apps/libsqlViewer.ts'),
+ getFilePathToPackage('studiocms_devapps', 'src/apps/wp-importer.ts'),
+ getFilePathToPackage('studiocms_devapps', 'src/apps/utils/index.ts'),
+ getFilePathToPackage('studiocms_devapps', 'src/schema/index.ts'),
+ getFilePathToPackage('studiocms_devapps', 'src/schema/appsConfig.ts'),
+ getFilePathToPackage('studiocms_devapps', 'src/schema/wp-api/index.ts'),
getFilePathToPackage('studiocms_devapps', 'src/utils/pathGenerator.ts'),
getFilePathToPackage('studiocms_devapps', 'src/utils/wp-api/utils.ts'),
getFilePathToPackage('studiocms_devapps', 'src/utils/wp-api/converters.ts'),
getFilePathToPackage('studiocms_devapps', 'src/utils/wp-api/index.ts'),
- getFilePathToPackage('studiocms_devapps', 'src/schema/index.ts'),
- getFilePathToPackage('studiocms_devapps', 'src/schema/appsConfig.ts'),
- getFilePathToPackage('studiocms_devapps', 'src/schema/wp-api/index.ts'),
- getFilePathToPackage('studiocms_devapps', 'src/apps/libsqlViewer.ts'),
- getFilePathToPackage('studiocms_devapps', 'src/apps/wp-importer.ts'),
],
})
),
diff --git a/package.json b/package.json
index 4168a3453..ab93ea9a8 100644
--- a/package.json
+++ b/package.json
@@ -6,26 +6,19 @@
"node": "20.14.0"
},
"scripts": {
- "moon": "moon",
- "changeset": "changeset",
+ "build": "pnpm --filter node-playground build",
+ "build:docs": "pnpm --filter docs build",
+ "docs:dev": "pnpm --filter docs dev",
"playground:dev": "pnpm --filter node-playground dev",
- "playground:login": "pnpm --filter node-playground db:login",
- "playground:link": "pnpm --filter node-playground db:link",
"playground:push": "pnpm --filter node-playground db:push",
- "ui:dev": "pnpm --filter ui-playground dev",
- "ui:build": "pnpm --filter ui-playground build",
- "ui:preview": "pnpm --filter ui-playground preview",
- "build": "pnpm --filter node-playground build",
+
+ "changeset": "changeset",
"lint": "biome check .",
"lint:fix": "biome check --write .",
- "build:web": "pnpm --filter web build",
- "build:docs": "pnpm --filter docs build",
- "update:web": "pnpm --filter web up --latest",
- "update:docs": "pnpm --filter docs up --latest",
- "web:dev": "pnpm --filter web dev",
- "docs:dev": "pnpm --filter docs dev",
- "lunaria:build": "pnpm --filter docs lunaria:build",
- "translations:changeset": "tsm --require=./scripts/filter-warnings.cjs ./scripts/translation-changeset.ts",
+
+ "ci:lunaria:build": "pnpm --filter docs lunaria:build",
+ "ci:lunaria:report": "pnpm tsm --require=./scripts/filter-warnings.cjs ./www/docs/scripts/lunaria-report-bot.ts",
+ "ci:translations:changeset": "tsm --require=./scripts/filter-warnings.cjs ./scripts/translation-changeset.ts",
"ci:lint": "biome ci --formatter-enabled=true --organize-imports-enabled=true --reporter=github",
"ci:install": "pnpm install --frozen-lockfile",
"ci:version": "pnpm changeset version",
@@ -35,7 +28,6 @@
"devDependencies": {
"@actions/core": "^1.11.1",
"@biomejs/biome": "1.9.4",
- "@moonrepo/cli": "1.28.3",
"@changesets/cli": "2.27.9",
"@changesets/config": "3.0.3",
"@changesets/changelog-github": "0.5.0",
diff --git a/packages/studiocms/LICENSE b/packages/studiocms/LICENSE
index a30d1fbe4..94787104c 100644
--- a/packages/studiocms/LICENSE
+++ b/packages/studiocms/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024 Astrolicious - StudioCMS - Adam Matthiesen, Jacob Jenkins, Paul Valladares
+Copyright (c) 2024 StudioCMS - Adam Matthiesen, Jacob Jenkins, Paul Valladares
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/packages/studiocms/README.md b/packages/studiocms/README.md
index 0cf5b48f6..16e85c435 100644
--- a/packages/studiocms/README.md
+++ b/packages/studiocms/README.md
@@ -2,9 +2,12 @@
As part of our efforts, we're excited to introduce StudioCMS - a dedicated content management system (CMS) built on top of Astro's latest feature, [Astro DB](https://docs.astro.build/en/guides/astro-db/). This project was developed by [Adam](https://github.com/Adammatthiesen), [Dreyfus](https://github.com/dreyfus92), and [Jumper](https://github.com/jdtjenkins), three passionate members of the Astro community.
+> [!IMPORTANT]
+> This project is still in early development and it is not yet ready for production use. If you encounter any issues or have ideas for new features, please let us know by [opening an issue](https://github.com/withstudiocms/studiocms/issues/new/choose) on our GitHub repository.
+
## Sponsor
-
+
## Why another CMS?
@@ -25,17 +28,17 @@ StudioCMS is built from the ground up to seamlessly integrate with Astro's robus
## Key Features
-**Astro Foundation:** StudioCMS leverages Astro's robust and efficient framework, providing a solid base for building and scaling applications.
+**Built on Astro:** StudioCMS leverages Astro's robust and efficient framework, providing a solid base for building and scaling applications.
-**Enhanced Markdown:** We've incorporated 'Marked' with support for extensions, enriching the markdown experience with greater flexibility and functionality.
+**Support for Markdown:** Incorporates Astro's Markdown processing, enriching the markdown experience with greater flexibility and functionality.
-**Shiki Syntax Highlighting:** StudioCMS offers Shiki-powered syntax highlighting, ensuring your code is both visually appealing and easy to read. This is especially useful in non-Cloudflare environments due to bundle size considerations.
+**Markdoc Integration:** Provides an alternative to Astro's Markdown with Markdoc, offering users a choice for their markdown processing needs.
-**Markdoc Integration:** In addition to 'Marked', StudioCMS provides an alternative with Markdoc, offering users a choice for their markdown processing needs.
+**Secure libSQL Database:** All data is securely housed within your libSQL database, ensuring accessibility to your data to only authorized users to your libSQL provider or Self-hosted server.
-**Built-in Authentication:** StudioCMS features built-in authentication with support for multiple platforms, including Local and Github, enhancing security and user management (currently in development).
+**Built-in Authentication:** Features built-in authentication with support for multiple platforms including Local and Github, enhancing security and user management.
-**Unpic Image Service:** StudioCMS includes a free and efficient image service, Unpic, which makes managing external URLs straightforward, with support for major CDNs.
+**Web Vitals:**Integration with '@astrojs/web-vitals' for monitoring and providing insights into web performance metrics, ensuring optimal user experiences.
## A Community-Driven Effort
diff --git a/packages/studiocms/dev.d.ts b/packages/studiocms/dev.d.ts
new file mode 100644
index 000000000..ea19848c7
--- /dev/null
+++ b/packages/studiocms/dev.d.ts
@@ -0,0 +1,2 @@
+///
+///
diff --git a/packages/studiocms/env.d.ts b/packages/studiocms/env.d.ts
deleted file mode 100644
index 86fd4d5bb..000000000
--- a/packages/studiocms/env.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-interface ImportMetaEnv {
- readonly PROD: boolean;
- readonly BASE_URL: string;
-}
-
-interface ImportMeta {
- readonly env: ImportMetaEnv;
-}
diff --git a/packages/studiocms/moon.yml b/packages/studiocms/moon.yml
deleted file mode 100644
index 8dce3a008..000000000
--- a/packages/studiocms/moon.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: 'typescript'
-tags: ['astro', 'typescript']
-
-project:
- name: 'studiocms'
- description: 'A CMS that bridges Astro with Astro DB & Studio'
- maintainers: ['Adammatthiesen','jdtjenkins','dreyfus92']
\ No newline at end of file
diff --git a/packages/studiocms/package.json b/packages/studiocms/package.json
index b8d010e99..cd4269db1 100644
--- a/packages/studiocms/package.json
+++ b/packages/studiocms/package.json
@@ -1,7 +1,7 @@
{
"name": "studiocms",
"version": "0.1.0-beta.7",
- "description": "A dedicated CMS for Astro DB. Built from the ground up by the Astro community.",
+ "description": "A dedicated CMS for Astro and Astro DB. Built from the ground up by the Astro community.",
"author": {
"name": "Adam Matthiesen | Jacob Jenkins | Paul Valladares",
"url": "https://studiocms.dev"
@@ -17,17 +17,17 @@
],
"license": "MIT",
"keywords": [
- "astro",
+ "cms",
"astrocms",
"astrodb",
- "astrolicious",
"astrostudio",
- "astro-integration",
+ "astrostudiocms",
+ "studiocms",
"astro-studio",
"astro-studiocms",
- "cms",
- "studiocms",
- "withastro"
+ "astro",
+ "withastro",
+ "astro-integration"
],
"homepage": "https://studiocms.dev",
"publishConfig": {
@@ -35,11 +35,13 @@
},
"sideEffects": false,
"files": [
- "src"
+ "src",
+ "CHANGELOG.md",
+ "LICENSE",
+ "README.md"
],
"exports": {
- ".": "./src/index.ts",
- "./blog": "./src/blog/index.ts"
+ ".": "./src/index.ts"
},
"type": "module",
"dependencies": {
@@ -53,62 +55,31 @@
"@studiocms/renderers": "workspace:*",
"@studiocms/robotstxt": "workspace:*",
+ "@studiocms/ui": "catalog:",
"astro-integration-kit": "catalog:",
"package-json": "catalog:studiocms",
"semver": "catalog:studiocms",
- "mrmime": "catalog:studiocms-core",
- "remark-rehype": "catalog:studiocms-core",
- "mdast-util-to-hast": "catalog:studiocms-core",
-
- "@oslojs/crypto": "catalog:studiocms-auth",
- "@oslojs/encoding": "catalog:studiocms-auth",
- "@oslojs/binary": "catalog:studiocms-auth",
- "@types/bcryptjs": "catalog:studiocms-auth",
- "bcryptjs": "catalog:studiocms-auth",
- "@types/three": "catalog:studiocms-auth",
- "arctic": "catalog:studiocms-auth",
- "three": "catalog:studiocms-auth",
-
- "@fontsource-variable/onest": "catalog:studiocms-shared",
"@inox-tools/runtime-logger": "catalog:studiocms-shared",
"@matthiesenxyz/astrodtsbuilder": "catalog:studiocms-shared",
"@matthiesenxyz/integration-utils": "catalog:studiocms-shared",
"rollup-plugin-copy": "catalog:studiocms-shared",
- "marked": "catalog:studiocms-renderer",
- "marked-alert": "catalog:studiocms-renderer",
- "marked-emoji": "catalog:studiocms-renderer",
- "marked-footnote": "catalog:studiocms-renderer",
- "marked-shiki": "catalog:studiocms-renderer",
- "marked-smartypants": "catalog:studiocms-renderer",
- "@markdoc/markdoc": "catalog:studiocms-renderer",
- "shiki": "catalog:studiocms-renderer",
- "@shikijs/transformers": "catalog:studiocms-renderer",
-
- "@cloudinary/url-gen": "catalog:studiocms-imagehandler",
-
- "@matthiesenxyz/astrolace": "catalog:studiocms-shared",
- "@matthiesenxyz/unocss-preset-daisyui": "catalog:studiocms-shared",
- "@unocss/astro": "catalog:studiocms-shared",
- "@unocss/reset": "catalog:studiocms-shared",
- "daisyui": "catalog:studiocms-shared",
- "unocss": "catalog:studiocms-shared"
+ "mdast": "catalog:studiocms-shared",
+ "mdast-util-from-markdown": "catalog:studiocms-shared",
+ "mdast-util-to-markdown": "catalog:studiocms-shared",
+ "mdast-util-to-string": "catalog:studiocms-shared",
+ "unist-util-visit": "catalog:studiocms-shared"
},
"peerDependencies": {
"@astrojs/db": "catalog:min",
"astro": "catalog:min",
- "@studiocms/blog": "workspace:*"
- },
- "peerDependenciesMeta": {
- "@studiocms/blog": {
- "optional": true
- }
+ "vite": "catalog:min"
},
"devDependencies": {
- "vite": "catalog:",
"typescript": "catalog:",
- "@types/semver": "catalog:studiocms"
+ "@types/semver": "catalog:studiocms",
+ "@types/mdast": "catalog:studiocms-shared"
}
}
diff --git a/packages/studiocms/src/blog/index.ts b/packages/studiocms/src/blog/index.ts
deleted file mode 100644
index c841f2a88..000000000
--- a/packages/studiocms/src/blog/index.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import studioCMSBlog from '@studiocms/blog';
-
-/**
- * # StudioCMS Blog Theme(Integration)
- * *Note: To use this export, you must have `@studiocms/blog` installed in your project dependencies.*
- * #### Powered by [`astro-theme-provider`](https://github.com/astrolicious/astro-theme-provider) by [Bryce Russell](https://github.com/BryceRussell)
- *
- * This theme provides a Blog Index Page and RSS Feed for your StudioCMS Site as well as route handling for Blog Posts.
- *
- * @example
- * import { defineConfig } from 'astro/config';
- * import db from '@astrojs/db';
- * import studioCMS from 'studiocms';
- * import studioCMSBlog from 'studiocms/blog';
- *
- * // https://astro.build/config
- * export default defineConfig({
- * site: "https://example.com",
- * output: "server",
- * adapter: ...
- * integrations: [
- * db(), // REQUIRED - `@astrojs/db` must be included in the integrations list
- * studioCMS(), // REQUIRED - StudioCMS must be included in the integrations list
- * studioCMSBlog({
- * config: {
- * title: "My StudioCMS Blog",
- * description: "A Simple Blog build with Astro, Astrojs/DB, and StudioCMS.".
- * },
- * }),
- * ],
- * });
- */
-const integration = studioCMSBlog;
-
-export default integration;
diff --git a/packages/studiocms/src/hooks/build-done.ts b/packages/studiocms/src/hooks/build-done.ts
new file mode 100644
index 000000000..3ea0476c4
--- /dev/null
+++ b/packages/studiocms/src/hooks/build-done.ts
@@ -0,0 +1,21 @@
+import { integrationLogger } from '@matthiesenxyz/integration-utils/astroUtils';
+import { defineUtility } from 'astro-integration-kit';
+import type { Messages } from '../types';
+
+export const buildDone = defineUtility('astro:build:done')(
+ ({ logger }, verbose: boolean, messages: Messages) => {
+ // Log messages at the end of the build
+ for (const { label, message, logLevel } of messages) {
+ integrationLogger(
+ {
+ logger: logger.fork(label),
+ logLevel,
+ verbose: logLevel === 'info' ? verbose : true,
+ },
+ message
+ );
+ }
+ }
+);
+
+export default buildDone;
diff --git a/packages/studiocms/src/hooks/config-done.ts b/packages/studiocms/src/hooks/config-done.ts
new file mode 100644
index 000000000..cad955435
--- /dev/null
+++ b/packages/studiocms/src/hooks/config-done.ts
@@ -0,0 +1,56 @@
+import astroDTSBuilder from '@matthiesenxyz/astrodtsbuilder';
+import { createResolver, defineUtility } from 'astro-integration-kit';
+import type { Messages } from '../types';
+
+const { resolve } = createResolver(import.meta.url);
+
+export const configDone = defineUtility('astro:config:done')(
+ ({ injectTypes }, messages: Messages) => {
+ // Make DTS file for StudioCMS Plugins Virtual Module
+ const dtsFile = astroDTSBuilder();
+
+ dtsFile.addSingleLineNote(
+ 'This file is auto-generated by StudioCMS and should not be modified.'
+ );
+
+ dtsFile.addModule('studiocms:plugins', {
+ defaultExport: {
+ typeDef: `import('${resolve('../index.ts')}').SafePluginListType`,
+ },
+ });
+
+ dtsFile.addModule('studiocms:changelog', {
+ defaultExport: {
+ typeDef: 'string',
+ },
+ });
+
+ dtsFile.addModule('studiocms:mode', {
+ defaultExport: {
+ typeDef: `{ output: 'static' | 'server', prerenderRoutes: boolean }`,
+ },
+ namedExports: [
+ {
+ name: 'output',
+ typeDef: `'static' | 'server'`,
+ },
+ {
+ name: 'prerenderRoutes',
+ typeDef: 'boolean',
+ },
+ ],
+ });
+
+ // Inject the DTS file
+ injectTypes(dtsFile.makeAstroInjectedType('plugins.d.ts'));
+
+ // Log Setup Complete
+ messages.push({
+ label: 'studiocms:setup',
+ logLevel: 'info',
+ message: 'Setup Complete. 🚀',
+ });
+ }
+);
+
+export default configDone;
diff --git a/packages/studiocms/src/hooks/config-setup.ts b/packages/studiocms/src/hooks/config-setup.ts
new file mode 100644
index 000000000..cfc9ed0a3
--- /dev/null
+++ b/packages/studiocms/src/hooks/config-setup.ts
@@ -0,0 +1,182 @@
+import { addIntegrationArray } from '@matthiesenxyz/integration-utils/aikUtils';
+import {
+ integrationLogger,
+ nodeNamespaceBuiltinsAstro as nodeNamespace,
+} from '@matthiesenxyz/integration-utils/astroUtils';
+import auth from '@studiocms/auth';
+import core from '@studiocms/core';
+import { StudioCMSError } from '@studiocms/core/errors';
+import type { SafePluginListType, StudioCMSConfig } from '@studiocms/core/schemas';
+import { checkAstroConfig, configResolver, watchStudioCMSConfig } from '@studiocms/core/utils';
+import dashboard from '@studiocms/dashboard';
+import frontend from '@studiocms/frontend';
+import imageHandler from '@studiocms/imagehandler';
+import renderers from '@studiocms/renderers';
+import robotsTXT from '@studiocms/robotstxt';
+import ui from '@studiocms/ui';
+import { addVirtualImports, defineUtility } from 'astro-integration-kit';
+import { compare as semCompare } from 'semver';
+import type { ConfigSetupOptions } from '../types';
+import { changelogHelper } from '../utils/changelog';
+
+export const configSetup = defineUtility('astro:config:setup')(
+ async (params, o: ConfigSetupOptions) => {
+ // Destructure the params
+ const {
+ logger,
+ config: { output },
+ } = params;
+
+ // Destructure the options
+ const { messages, opts, pkgName, pkgVersion } = o;
+
+ logger.info('Checking configuration...');
+
+ // Watch the StudioCMS Config File(s) for changes (including creation/deletion)
+ const configFileResponse = watchStudioCMSConfig(params);
+ if (configFileResponse) {
+ messages.push({
+ label: 'studiocms:config',
+ logLevel: 'error',
+ message: configFileResponse,
+ });
+ }
+
+ // Resolve Options
+ const options: StudioCMSConfig = await configResolver(params, opts);
+
+ const {
+ verbose,
+ rendererConfig,
+ defaultFrontEndConfig,
+ includedIntegrations,
+ plugins,
+ dashboardConfig: { prerender },
+ } = options;
+
+ // Check if the dashboard routes should be prerendered
+ const prerenderRoutes = output === 'static' || prerender;
+
+ // Setup Logger
+ integrationLogger({ logger, logLevel: 'info', verbose }, 'Setting up StudioCMS...');
+
+ // Check Astro Config for required settings
+ checkAstroConfig(params);
+
+ // Setup Logger
+ integrationLogger({ logger, logLevel: 'info', verbose }, 'Setting up StudioCMS internals...');
+
+ // Setup StudioCMS Integrations Array (Default Integrations)
+ const integrations = [
+ { integration: nodeNamespace() },
+ { integration: ui() },
+ { integration: core(options, prerenderRoutes) },
+ { integration: renderers(rendererConfig, verbose) },
+ { integration: imageHandler(options) },
+ { integration: auth(options, prerenderRoutes) },
+ { integration: dashboard(options, prerenderRoutes) },
+ ];
+
+ // Frontend Integration (Default)
+ if (defaultFrontEndConfig !== false) {
+ integrations.push({ integration: frontend(options) });
+ }
+
+ integrationLogger({ logger, logLevel: 'info', verbose }, 'Adding optional integrations...');
+
+ // Robots.txt Integration (Default)
+ if (includedIntegrations.robotsTXT === true) {
+ integrations.push({ integration: robotsTXT() });
+ } else if (typeof includedIntegrations.robotsTXT === 'object') {
+ integrations.push({ integration: robotsTXT(includedIntegrations.robotsTXT) });
+ }
+
+ // Initialize and Add the default StudioCMS Plugin to the Safe Plugin List
+ const safePluginList: SafePluginListType = [
+ {
+ name: 'StudioCMS (Default)',
+ identifier: 'studiocms',
+ },
+ ];
+
+ integrationLogger({ logger, logLevel: 'info', verbose }, 'Setting up StudioCMS plugins...');
+
+ // Resolve StudioCMS Plugins
+ for (const {
+ name,
+ identifier,
+ studiocmsMinimumVersion,
+ integration,
+ frontendNavigationLinks,
+ pageTypes,
+ settingsPage,
+ } of plugins || []) {
+ // Check if the identifier is reserved
+ if (identifier === 'studiocms') {
+ throw new StudioCMSError(
+ 'Plugin Identifier "studiocms" is reserved for the default StudioCMS package.',
+ `Plugin ${name} has the identifier "studiocms" which is reserved for the default StudioCMS package, please change the identifier to something else, if the plugin is from a third party, please contact the author to change the identifier.`
+ );
+ }
+
+ // Check if the plugin has a minimum version requirement
+ const comparison = semCompare(studiocmsMinimumVersion, pkgVersion);
+
+ if (comparison === 1) {
+ throw new StudioCMSError(
+ `Plugin ${name} requires StudioCMS version ${studiocmsMinimumVersion} or higher.`,
+ `Plugin ${name} requires StudioCMS version ${studiocmsMinimumVersion} or higher, please update StudioCMS to the required version, contact the plugin author to update the minimum version requirement or remove the plugin from the StudioCMS config.`
+ );
+ }
+
+ // Add the plugin Integration to the Astro config
+ if (integration && Array.isArray(integration)) {
+ integrations.push(...integration.map((integration) => ({ integration })));
+ } else if (integration) {
+ integrations.push({ integration });
+ }
+
+ safePluginList.push({
+ identifier,
+ name,
+ frontendNavigationLinks,
+ pageTypes,
+ settingsPage,
+ });
+ }
+
+ // Setup Integrations
+ addIntegrationArray(params, integrations);
+
+ // Generate the Virtual Imports for the plugins
+ addVirtualImports(params, {
+ name: pkgName,
+ imports: {
+ 'studiocms:plugins': `export default ${JSON.stringify(safePluginList)};`,
+ 'studiocms:mode': `
+ export const output = ${JSON.stringify(output)};
+ export const prerenderRoutes = ${prerenderRoutes};
+ export default { output, prerenderRoutes };
+ `,
+ },
+ });
+
+ let pluginListLength = 0;
+ let pluginListMessage = '';
+
+ pluginListLength = safePluginList.length;
+ pluginListMessage = safePluginList.map((p, i) => ` ${i + 1}. ${p.name}`).join('\n');
+
+ o.messages.push({
+ label: 'studiocms:plugins',
+ logLevel: 'info',
+ message: `Currently Installed StudioCMS Plugins: (${pluginListLength})\n${pluginListMessage}`,
+ });
+
+ changelogHelper(params);
+
+ return options as StudioCMSConfig;
+ }
+);
+
+export default configSetup;
diff --git a/packages/studiocms/src/hooks/db-setup.ts b/packages/studiocms/src/hooks/db-setup.ts
new file mode 100644
index 000000000..d06548d9e
--- /dev/null
+++ b/packages/studiocms/src/hooks/db-setup.ts
@@ -0,0 +1,7 @@
+import { defineUtility } from 'astro-integration-kit';
+
+export const dbSetup = defineUtility('astro:db:setup')(({ extendDb }) => {
+ extendDb({ configEntrypoint: '@studiocms/core/db/config' });
+});
+
+export default dbSetup;
diff --git a/packages/studiocms/src/hooks/server-start.ts b/packages/studiocms/src/hooks/server-start.ts
new file mode 100644
index 000000000..986e2d4fb
--- /dev/null
+++ b/packages/studiocms/src/hooks/server-start.ts
@@ -0,0 +1,52 @@
+import { integrationLogger } from '@matthiesenxyz/integration-utils/astroUtils';
+import { defineUtility } from 'astro-integration-kit';
+import packageJson from 'package-json';
+import { compare as semCompare } from 'semver';
+import type { ServerStartOptions } from '../types';
+
+export const serverStart = defineUtility('astro:server:start')(
+ async ({ logger: l }, { messages, pkgName, pkgVersion, verbose }: ServerStartOptions) => {
+ const logger = l.fork(`${pkgName}:update-check`);
+
+ try {
+ const { version: latestVersion } = await packageJson(pkgName.toLowerCase());
+
+ const comparison = semCompare(pkgVersion, latestVersion);
+
+ if (comparison === -1) {
+ logger.warn(
+ `A new version of '${pkgName}' is available. Please update to ${latestVersion} using your favorite package manager.`
+ );
+ } else if (comparison === 0) {
+ logger.info(`You are using the latest version of '${pkgName}' (${pkgVersion})`);
+ } else {
+ logger.info(
+ `You are using a newer version (${pkgVersion}) of '${pkgName}' than the latest release (${latestVersion})`
+ );
+ }
+ } catch (error) {
+ if (error instanceof Error) {
+ logger.error(`Error fetching latest version from npm registry: ${error.message}`);
+ } else {
+ // Handle the case where error is not an Error object
+ logger.error(
+ 'An unknown error occurred while fetching the latest version from the npm registry.'
+ );
+ }
+ }
+
+ // Log all messages
+ for (const { label, message, logLevel } of messages) {
+ integrationLogger(
+ {
+ logger: l.fork(label),
+ logLevel,
+ verbose: logLevel === 'info' ? verbose : true,
+ },
+ message
+ );
+ }
+ }
+);
+
+export default serverStart;
diff --git a/packages/studiocms/src/index.ts b/packages/studiocms/src/index.ts
index c5a1f7079..dd718f4c0 100644
--- a/packages/studiocms/src/index.ts
+++ b/packages/studiocms/src/index.ts
@@ -1,27 +1,67 @@
-import { defineStudioCMSConfig, defineStudioCMSPlugin } from '@studiocms/core/lib';
-import type { CustomRenderer, Renderer, StudioCMSOptions } from '@studiocms/core/schemas';
-import type { StudioCMSPluginOptions } from '@studiocms/core/types';
-import integration from './integration';
+import {
+ type CustomRenderer,
+ type Renderer,
+ type SafePluginListType,
+ type StudioCMSConfig,
+ type StudioCMSOptions,
+ type StudioCMSPlugin,
+ type StudioCMSPluginOptions,
+ definePlugin,
+} from '@studiocms/core/schemas';
+import { defineStudioCMSConfig } from '@studiocms/core/utils';
+import type { AstroIntegration } from 'astro';
+import { name as pkgName, version as pkgVersion } from '../package.json';
+import buildDone from './hooks/build-done';
+import configDone from './hooks/config-done';
+import configSetup from './hooks/config-setup';
+import dbSetup from './hooks/db-setup';
+import serverStart from './hooks/server-start';
+import type { Messages } from './types';
/**
* **StudioCMS Integration**
*
* A CMS built for Astro by the Astro Community for the Astro Community.
*
- * > **Note: Astro SSR adapters that are configured for Image Optimization will automatically take full control of the Image Optimization Service. Making the `imageService` option in this integration not have any effect.**
- *
- * @see [GitHub Repo: 'astrolicious/studiocms'](https://github.com/astrolicious/studiocms) for more information on how to contribute to StudioCMS.
- * @see [StudioCMS Docs](https://docs.studiocms.xyz) for more information on how to use StudioCMS.
+ * @see The [GitHub Repo: `withstudiocms/studiocms`](https://github.com/withstudiocms/studiocms) for more information on how to contribute to StudioCMS.
+ * @see The [StudioCMS Docs](https://docs.studiocms.dev) for more information on how to use StudioCMS.
*
*/
-export const studioCMS = integration;
-
-export default studioCMS;
+export function studioCMSIntegration(opts?: StudioCMSOptions): AstroIntegration {
+ // Resolved Options for StudioCMS
+ let options: StudioCMSConfig;
+ // Messages Array for Logging
+ const messages: Messages = [];
-// Config Utility
-export { defineStudioCMSConfig, type StudioCMSOptions };
+ return {
+ name: pkgName,
+ hooks: {
+ // DB Setup: Setup the Database Connection for AstroDB and StudioCMS
+ 'astro:db:setup': (params) => dbSetup(params),
+ // Config Setup: Main Setup for StudioCMS
+ 'astro:config:setup': async (params) => {
+ options = await configSetup(params, { pkgName, pkgVersion, opts, messages });
+ },
+ // Config Done: Make DTS file for StudioCMS Plugins Virtual Module
+ 'astro:config:done': (params) => configDone(params, messages),
+ // DEV SERVER: Check for updates on server start and log messages
+ 'astro:server:start': async (params) =>
+ await serverStart(params, { pkgName, pkgVersion, verbose: options.verbose, messages }),
+ // BUILD: Log messages at the end of the build
+ 'astro:build:done': (params) => buildDone(params, options.verbose, messages),
+ },
+ };
+}
-// Plugin System
-export { defineStudioCMSPlugin, type StudioCMSPluginOptions };
+export default studioCMSIntegration;
-export type { CustomRenderer, Renderer };
+export {
+ defineStudioCMSConfig,
+ definePlugin,
+ type StudioCMSPlugin,
+ type CustomRenderer,
+ type Renderer,
+ type StudioCMSOptions,
+ type StudioCMSPluginOptions,
+ type SafePluginListType,
+};
diff --git a/packages/studiocms/src/integration.ts b/packages/studiocms/src/integration.ts
deleted file mode 100644
index d612617e3..000000000
--- a/packages/studiocms/src/integration.ts
+++ /dev/null
@@ -1,130 +0,0 @@
-import { addIntegrationArray } from '@matthiesenxyz/integration-utils/aikUtils';
-import {
- integrationLogger,
- nodeNamespaceBuiltinsAstro,
-} from '@matthiesenxyz/integration-utils/astroUtils';
-import studioCMSAuth from '@studiocms/auth';
-import studioCMSCore from '@studiocms/core';
-import { getStudioConfigFileUrl, studioCMSPluginList } from '@studiocms/core/lib';
-import {
- type StudioCMSOptions,
- StudioCMSOptionsSchema as optionsSchema,
-} from '@studiocms/core/schemas';
-import { CoreStrings, robotsTXTPreset } from '@studiocms/core/strings';
-import {
- addIntegrationArrayWithCheck,
- checkAstroConfig,
- configResolver,
-} from '@studiocms/core/utils';
-import studioCMSDashboard from '@studiocms/dashboard';
-import studioCMSFrontend from '@studiocms/frontend';
-import studioCMSImageHandler from '@studiocms/imagehandler';
-import studioCMSRenderers from '@studiocms/renderers';
-import studioCMSRobotsTXT from '@studiocms/robotstxt';
-import { defineIntegration } from 'astro-integration-kit';
-import { name, version } from '../package.json';
-import { updateCheck } from './updateCheck';
-
-// Main Integration
-export default defineIntegration({
- name,
- optionsSchema,
- setup({ name, options }) {
- // Register StudioCMS into the StudioCMS Plugin List
- studioCMSPluginList.set(name, { name, label: 'StudioCMS' });
-
- // Resolve Options
- let resolvedOptions: StudioCMSOptions;
-
- return {
- hooks: {
- // Configure `@astrojs/db` integration to include the StudioCMS Database Tables
- 'astro:db:setup': ({ extendDb }) => {
- extendDb({ configEntrypoint: '@studiocms/core/db/config' });
- },
- 'astro:config:setup': async (params) => {
- // Destructure Params
- const { config: astroConfig, addWatchFile, logger } = params;
-
- // Watch the StudioCMS Config File for changes (including creation/deletion)
- addWatchFile(getStudioConfigFileUrl(astroConfig.root));
-
- // Resolve Options
- const ResolvedOptions = await configResolver(params, options);
-
- // Set Resolved Options
- resolvedOptions = ResolvedOptions;
-
- // Break out resolved options
- const {
- verbose,
- rendererConfig,
- dbStartPage,
- dashboardConfig,
- defaultFrontEndConfig,
- imageService,
- overrides,
- includedIntegrations,
- } = ResolvedOptions;
-
- // Setup Logger
- integrationLogger({ logger, logLevel: 'info', verbose }, CoreStrings.Start);
-
- // Check Astro Config for required settings
- checkAstroConfig(params);
-
- // Setup Integrations (Internal)
- addIntegrationArray(params, [
- { integration: nodeNamespaceBuiltinsAstro() },
- { integration: studioCMSCore(resolvedOptions) },
- { integration: studioCMSRenderers(rendererConfig) },
- {
- integration: studioCMSFrontend({
- verbose,
- dbStartPage,
- defaultFrontEndConfig,
- }),
- },
- {
- integration: studioCMSImageHandler({
- verbose,
- imageService,
- overrides,
- }),
- },
- {
- integration: studioCMSAuth({
- verbose,
- dbStartPage,
- dashboardConfig,
- }),
- },
- {
- integration: studioCMSDashboard({
- verbose,
- dbStartPage,
- dashboardConfig,
- }),
- },
- ]);
-
- // Setup Integrations (External / Optional)
- addIntegrationArrayWithCheck(params, [
- {
- enabled: includedIntegrations.useAstroRobots,
- knownSimilar: ['astro-robots', 'astro-robots-txt'],
- integration: studioCMSRobotsTXT({
- ...robotsTXTPreset,
- ...includedIntegrations.astroRobotsConfig,
- }),
- },
- ]);
- },
- 'astro:server:start': async (params) => {
- // Check for Updates on Development Server Start
- updateCheck(params, name, version);
- },
- },
- };
- },
-});
diff --git a/packages/studiocms/src/types.ts b/packages/studiocms/src/types.ts
new file mode 100644
index 000000000..46f51e035
--- /dev/null
+++ b/packages/studiocms/src/types.ts
@@ -0,0 +1,21 @@
+import type { StudioCMSOptions } from '@studiocms/core/schemas';
+
+export type Messages = {
+ label: string;
+ logLevel: 'info' | 'warn' | 'error' | 'debug';
+ message: string;
+}[];
+
+export type ServerStartOptions = {
+ pkgName: string;
+ pkgVersion: string;
+ verbose: boolean;
+ messages: Messages;
+};
+
+export type ConfigSetupOptions = {
+ pkgName: string;
+ pkgVersion: string;
+ opts: StudioCMSOptions;
+ messages: Messages;
+};
diff --git a/packages/studiocms/src/updateCheck.ts b/packages/studiocms/src/updateCheck.ts
deleted file mode 100644
index bb7f9df96..000000000
--- a/packages/studiocms/src/updateCheck.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { defineUtility } from 'astro-integration-kit';
-import packageJson from 'package-json';
-import * as semver from 'semver';
-
-/**
- * Fetches the latest version of a package from the npm registry.
- * @param packageName - The name of the package.
- * @returns A promise that resolves to the latest version of the package.
- */
-async function fetchlatestVersion(packageName: string): Promise {
- const { version } = await packageJson(packageName.toLowerCase());
- return version;
-}
-
-/**
- * Checks for updates of a specified package on npm registry.
- * @param {import("astro").HookParameters<"astro:config:setup">} params - The Astro parameters object.
- * @param currentVersion - The current version of the package.
- */
-export const updateCheck = defineUtility('astro:server:start')(
- async (params, name: string, currentVersion: string): Promise => {
- const logger = params.logger.fork(`${name}:update-check`);
-
- try {
- const latestVersion = await fetchlatestVersion(name);
-
- const comparison = semver.compare(currentVersion, latestVersion);
-
- if (comparison === -1) {
- logger.warn(
- `A new version of 'studiocms' is available. Please update to ${latestVersion} using your favorite package manager.`
- );
- } else if (comparison === 0) {
- logger.info(`You are using the latest version of '${name}' (${currentVersion})`);
- } else {
- logger.info(
- `You are using a newer version (${currentVersion}) of '${name}' than the latest release (${latestVersion})`
- );
- }
- } catch (error) {
- if (error instanceof Error) {
- logger.error(`Error fetching latest version from npm registry: ${error.message}`);
- } else {
- // Handle the case where error is not an Error object
- logger.error(
- 'An unknown error occurred while fetching the latest version from the npm registry.'
- );
- }
- }
- }
-);
diff --git a/packages/studiocms/src/utils/changelog.ts b/packages/studiocms/src/utils/changelog.ts
new file mode 100644
index 000000000..ea0e88888
--- /dev/null
+++ b/packages/studiocms/src/utils/changelog.ts
@@ -0,0 +1,67 @@
+import { addVirtualImports, createResolver, defineUtility } from 'astro-integration-kit';
+import type { List, Root } from 'mdast';
+import { toMarkdown } from 'mdast-util-to-markdown';
+import { loadChangelog, semverCategories } from './changelogLoader';
+
+const { resolve } = createResolver(import.meta.url);
+
+export const changelogHelper = defineUtility('astro:config:setup')(async (params) => {
+ const changelog = loadChangelog(resolve('../../CHANGELOG.md'));
+
+ // Generate markdown output
+ const output: string[] = ['# Release Notes'];
+
+ const ast: Root = {
+ type: 'root',
+ children: [],
+ };
+
+ // Get the latest version changelog
+ const latestVersion = changelog.versions[0];
+
+ // Get the latest version changes
+ const latestVersionChanges: List = { type: 'list', children: [] };
+
+ if (latestVersion) {
+ for (const semverCategory of semverCategories) {
+ for (const listItem of latestVersion.changes[semverCategory].children) {
+ latestVersionChanges.children.push(listItem);
+ }
+ }
+
+ if (latestVersion.includes.size) {
+ latestVersionChanges.children.push({
+ type: 'listItem',
+ children: [
+ {
+ type: 'paragraph',
+ children: [
+ { type: 'text', value: `Includes: ${[...latestVersion.includes].join(', ')} ` },
+ ],
+ },
+ ],
+ });
+ }
+
+ ast.children.push({
+ type: 'heading',
+ depth: 2,
+ children: [{ type: 'text', value: `${latestVersion.version}` }],
+ });
+ }
+
+ if (latestVersionChanges.children.length) {
+ ast.children.push(latestVersionChanges);
+ }
+
+ output.push(toMarkdown(ast, { bullet: '-' }));
+
+ const markdownString = output.join('\n');
+
+ addVirtualImports(params, {
+ name: 'studiocms/changelog',
+ imports: {
+ 'studiocms:changelog': `export default ${JSON.stringify(markdownString)};`,
+ },
+ });
+});
diff --git a/packages/studiocms/src/utils/changelogLoader.ts b/packages/studiocms/src/utils/changelogLoader.ts
new file mode 100644
index 000000000..4deafdee8
--- /dev/null
+++ b/packages/studiocms/src/utils/changelogLoader.ts
@@ -0,0 +1,140 @@
+import { readFileSync } from 'node:fs';
+import type { List } from 'mdast';
+import { fromMarkdown } from 'mdast-util-from-markdown';
+import { toString as ToString } from 'mdast-util-to-string';
+import { visit } from 'unist-util-visit';
+
+export type Changelog = {
+ packageName: string;
+ versions: Version[];
+};
+
+export type Version = {
+ version: string;
+ changes: { [key in SemverCategory]: List };
+ includes: Set;
+};
+
+export const semverCategories = ['major', 'minor', 'patch'] as const;
+export type SemverCategory = (typeof semverCategories)[number];
+
+export function loadChangelog(path: string): Changelog {
+ let markdown = readFileSync(path, 'utf8');
+
+ // Convert GitHub usernames in "Thanks ..." sentences to links
+ markdown = markdown.replace(
+ /(?<=Thank[^.!]*? )@([a-z0-9-]+)(?=[\s,.!])/gi,
+ '[@$1](https://github.com/$1)'
+ );
+
+ const ast = fromMarkdown(markdown);
+ // const lines = readFileSync(path, 'utf8')
+ // .split(/\r?\n/)
+ // .map((line) => line.trimEnd())
+ const changelog: Changelog = {
+ packageName: '',
+ versions: [],
+ };
+ type ParserState = 'packageName' | 'version' | 'semverCategory' | 'changes';
+ let state: ParserState = 'packageName';
+ let version: Version | undefined;
+ let semverCategory: SemverCategory | undefined;
+
+ function handleNode(node: ReturnType['children'][number]) {
+ if (node.type === 'heading') {
+ if (node.depth === 1) {
+ if (state !== 'packageName') throw new Error('Unexpected h1');
+ changelog.packageName = ToString(node);
+ state = 'version';
+ return;
+ }
+ if (node.depth === 2) {
+ if (state === 'packageName') throw new Error('Unexpected h2');
+ version = {
+ version: ToString(node),
+ changes: {
+ major: { type: 'list', children: [] },
+ minor: { type: 'list', children: [] },
+ patch: { type: 'list', children: [] },
+ },
+ includes: new Set(),
+ };
+ changelog.versions.push(version);
+ state = 'semverCategory';
+ return;
+ }
+ if (node.depth === 3) {
+ if (state === 'packageName' || state === 'version') throw new Error('Unexpected h3');
+ semverCategory = (ToString(node).split(' ')[0] || '').toLowerCase() as SemverCategory;
+ if (!semverCategories.includes(semverCategory))
+ throw new Error(`Unexpected semver category: ${semverCategory}`);
+ state = 'changes';
+ return;
+ }
+ }
+ if (node.type === 'list') {
+ if (state !== 'changes' || !version || !semverCategory) throw new Error('Unexpected list');
+ // Go through list items
+ for (let listItemIdx = 0; listItemIdx < node.children.length; listItemIdx++) {
+ const listItem = node.children[listItemIdx];
+ if (!listItem) continue;
+
+ // Check if the current list item ends with a nested sublist that consists
+ // of items matching the pattern `@`
+ const lastChild = listItem.children[listItem.children.length - 1];
+ if (lastChild?.type === 'list') {
+ const packageRefs: string[] = [];
+ // biome-ignore lint/complexity/noForEach:
+ lastChild.children.forEach((subListItem) => {
+ const text = ToString(subListItem);
+ if (parsePackageReference(text)) packageRefs.push(text);
+ });
+ if (packageRefs.length === lastChild.children.length) {
+ // If so, add the packages to `includes`
+ for (const packageRef of packageRefs) {
+ version.includes.add(packageRef);
+ }
+ // Remove the sub-list from the list item
+ listItem.children.pop();
+ }
+ }
+
+ const firstPara =
+ listItem.children[0]?.type === 'paragraph' ? listItem.children[0] : undefined;
+ if (firstPara) {
+ // Remove IDs like `bfed62a: ...` or `... [85dbab8]` from the first paragraph
+ visit(firstPara, 'text', (textNode) => {
+ textNode.value = textNode.value.replace(/(^[0-9a-f]{7,}: | \[[0-9a-f]{7,}\]$)/, '');
+ });
+ // Skip list items that only contain the text `Updated dependencies`
+ const firstParaText = ToString(firstPara);
+ if (firstParaText === 'Updated dependencies') continue;
+ // If the list item is a package reference, add it to `includes` instead
+ const packageRef = parsePackageReference(firstParaText);
+ if (packageRef) {
+ version.includes.add(firstParaText);
+ continue;
+ }
+ // Add the list item to the changes
+ version.changes[semverCategory].children.push(listItem);
+ }
+ }
+ return;
+ }
+ throw new Error(`Unexpected node: ${JSON.stringify(node)}`);
+ }
+
+ // biome-ignore lint/complexity/noForEach:
+ ast.children.forEach((node) => {
+ handleNode(node);
+ });
+
+ return changelog;
+}
+
+function parsePackageReference(str: string) {
+ const matches = str.match(/^([@/a-z0-9-]+)@([0-9.]+)$/);
+ if (!matches) return;
+ const [, packageName, version] = matches;
+ return { packageName, version };
+}
diff --git a/packages/studiocms/tsconfig.json b/packages/studiocms/tsconfig.json
index 73fb2bc44..e511a952b 100644
--- a/packages/studiocms/tsconfig.json
+++ b/packages/studiocms/tsconfig.json
@@ -1,86 +1,4 @@
{
"extends": "astro/tsconfigs/strictest",
- "files": [],
- "compilerOptions": {
- "outDir": "../../.moon/cache/types/packages/studiocms",
- "composite": true,
- "noEmit": false,
- "allowImportingTsExtensions": false,
- "emitDeclarationOnly": false,
- "paths": {
- "node-playground/*": ["../../playgrounds/node/src/*"],
- "@studiocms/assets": ["../studiocms_assets/src/index.ts"],
- "@studiocms/assets/*": ["../studiocms_assets/src/*"],
- "@studiocms/auth": ["../studiocms_auth/src/index.ts"],
- "@studiocms/auth/*": ["../studiocms_auth/src/*"],
- "@studiocms/betaresources": ["../studiocms_betaresources/src/index.ts"],
- "@studiocms/betaresources/*": ["../studiocms_betaresources/src/*"],
- "@studiocms/blog": ["../studiocms_blog/index.ts"],
- "@studiocms/blog/*": ["../studiocms_blog/src/*"],
- "@studiocms/core": ["../studiocms_core/src/index.ts"],
- "@studiocms/core/*": ["../studiocms_core/src/*"],
- "@studiocms/dashboard": ["../studiocms_dashboard/src/index.ts"],
- "@studiocms/dashboard/*": ["../studiocms_dashboard/src/*"],
- "@studiocms/frontend": ["../studiocms_frontend/src/index.ts"],
- "@studiocms/frontend/*": ["../studiocms_frontend/src/*"],
- "@studiocms/imagehandler": ["../studiocms_imagehandler/src/index.ts"],
- "@studiocms/imagehandler/*": ["../studiocms_imagehandler/src/*"],
- "@studiocms/renderers": ["../studiocms_renderers/src/index.ts"],
- "@studiocms/renderers/*": ["../studiocms_renderers/src/*"],
- "@studiocms/robotstxt": ["../studiocms_robotstxt/src/index.ts"],
- "@studiocms/robotstxt/*": ["../studiocms_robotstxt/src/*"]
- }
- },
- "references": [
- {
- "path": "../../playgrounds/node"
- },
- {
- "path": "../studiocms_assets"
- },
- {
- "path": "../studiocms_auth"
- },
- {
- "path": "../studiocms_betaresources"
- },
- {
- "path": "../studiocms_blog"
- },
- {
- "path": "../studiocms_core"
- },
- {
- "path": "../studiocms_dashboard"
- },
- {
- "path": "../studiocms_frontend"
- },
- {
- "path": "../studiocms_imagehandler"
- },
- {
- "path": "../studiocms_renderers"
- },
- {
- "path": "../studiocms_robotstxt"
- }
- ],
- "include": [
- "./package.json",
- "../../playgrounds/node/**/*",
- "../../playgrounds/node/.astro/**/*",
- "../studiocms_assets/**/*",
- "../studiocms_auth/**/*",
- "../studiocms_betaresources/**/*",
- "../studiocms_blog/**/*",
- "../studiocms_core/**/*",
- "../studiocms_dashboard/**/*",
- "../studiocms_frontend/**/*",
- "../studiocms_imagehandler/**/*",
- "../studiocms_renderers/**/*",
- "../studiocms_robotstxt/**/*",
- "./**/*",
- "./src/**/*.json"
- ]
+ "include": ["./package.json", "./**/*", "./src/**/*.json"]
}
diff --git a/packages/studiocms_assets/LICENSE b/packages/studiocms_assets/LICENSE
index a30d1fbe4..94787104c 100644
--- a/packages/studiocms_assets/LICENSE
+++ b/packages/studiocms_assets/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024 Astrolicious - StudioCMS - Adam Matthiesen, Jacob Jenkins, Paul Valladares
+Copyright (c) 2024 StudioCMS - Adam Matthiesen, Jacob Jenkins, Paul Valladares
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/packages/studiocms_assets/moon.yml b/packages/studiocms_assets/moon.yml
deleted file mode 100644
index aa80fbb0b..000000000
--- a/packages/studiocms_assets/moon.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: 'typescript'
-tags: ['astro', 'typescript']
-
-project:
- name: '@studiocms/assets'
- description: 'A CMS that bridges Astro with Astro DB & Studio'
- maintainers: ['Adammatthiesen','jdtjenkins','dreyfus92']
\ No newline at end of file
diff --git a/packages/studiocms_assets/package.json b/packages/studiocms_assets/package.json
index 5dd2cfc23..9b6bd99f7 100644
--- a/packages/studiocms_assets/package.json
+++ b/packages/studiocms_assets/package.json
@@ -40,7 +40,6 @@
"astro": "catalog:min"
},
"devDependencies": {
- "vite": "catalog:",
"typescript": "catalog:"
}
}
diff --git a/packages/studiocms_assets/src/svgs/discord.svg b/packages/studiocms_assets/src/svgs/discord.svg
index d8d7fee4b..dfe3f56d1 100644
--- a/packages/studiocms_assets/src/svgs/discord.svg
+++ b/packages/studiocms_assets/src/svgs/discord.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/packages/studiocms_assets/tsconfig.json b/packages/studiocms_assets/tsconfig.json
index c2c3dc4d8..d175d082a 100644
--- a/packages/studiocms_assets/tsconfig.json
+++ b/packages/studiocms_assets/tsconfig.json
@@ -2,25 +2,10 @@
"extends": "astro/tsconfigs/strictest",
"files": [],
"compilerOptions": {
- "outDir": "../../.moon/cache/types/packages/studiocms_assets",
"composite": true,
"noEmit": false,
"allowImportingTsExtensions": false,
- "emitDeclarationOnly": false,
- "paths": {
- "node-playground/*": ["../../playgrounds/node/src/*"]
- }
+ "emitDeclarationOnly": false
},
- "references": [
- {
- "path": "../../playgrounds/node"
- }
- ],
- "include": [
- "./package.json",
- "../../playgrounds/node/**/*",
- "../../playgrounds/node/.astro/**/*",
- "./**/*",
- "./src/**/*.json"
- ]
+ "include": ["./package.json", "./**/*", "./src/**/*.json"]
}
diff --git a/packages/studiocms_auth/LICENSE b/packages/studiocms_auth/LICENSE
index a30d1fbe4..94787104c 100644
--- a/packages/studiocms_auth/LICENSE
+++ b/packages/studiocms_auth/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024 Astrolicious - StudioCMS - Adam Matthiesen, Jacob Jenkins, Paul Valladares
+Copyright (c) 2024 StudioCMS - Adam Matthiesen, Jacob Jenkins, Paul Valladares
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/packages/studiocms_auth/env.d.ts b/packages/studiocms_auth/env.d.ts
index 86fd4d5bb..b14f5fc22 100644
--- a/packages/studiocms_auth/env.d.ts
+++ b/packages/studiocms_auth/env.d.ts
@@ -1,3 +1,5 @@
+///
+
interface ImportMetaEnv {
readonly PROD: boolean;
readonly BASE_URL: string;
diff --git a/packages/studiocms_auth/moon.yml b/packages/studiocms_auth/moon.yml
deleted file mode 100644
index d0fed609c..000000000
--- a/packages/studiocms_auth/moon.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: 'typescript'
-tags: ['astro', 'typescript']
-
-project:
- name: '@studiocms/auth'
- description: 'A CMS that bridges Astro with Astro DB & Studio'
- maintainers: ['Adammatthiesen','jdtjenkins','dreyfus92']
\ No newline at end of file
diff --git a/packages/studiocms_auth/package.json b/packages/studiocms_auth/package.json
index cd8e150d7..247564bef 100644
--- a/packages/studiocms_auth/package.json
+++ b/packages/studiocms_auth/package.json
@@ -35,7 +35,7 @@
"type": "module",
"dependencies": {
"@studiocms/core": "workspace:*",
- "@studiocms/ui": "workspace:*",
+ "@studiocms/ui": "catalog:",
"astro-integration-kit": "catalog:",
"@fontsource-variable/onest": "catalog:studiocms-shared",
"@inox-tools/runtime-logger": "catalog:studiocms-shared",
@@ -47,16 +47,14 @@
"@oslojs/encoding": "catalog:studiocms-auth",
"@types/three": "catalog:studiocms-auth",
"arctic": "catalog:studiocms-auth",
- "three": "catalog:studiocms-auth",
- "@types/bcryptjs": "catalog:studiocms-auth",
- "bcryptjs": "catalog:studiocms-auth"
+ "three": "catalog:studiocms-auth"
},
"peerDependencies": {
"@astrojs/db": "catalog:min",
- "astro": "catalog:min"
+ "astro": "catalog:min",
+ "vite": "catalog:min"
},
"devDependencies": {
- "vite": "catalog:",
"typescript": "catalog:"
}
}
diff --git a/packages/studiocms_auth/src/astroenv/env.ts b/packages/studiocms_auth/src/astroenv/env.ts
deleted file mode 100644
index e72998b95..000000000
--- a/packages/studiocms_auth/src/astroenv/env.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import type { AstroConfig } from 'astro';
-import { envField } from 'astro/config';
-
-export const astroENV: AstroConfig['experimental']['env'] = {
- validateSecrets: true,
- schema: {
- // Auth Encryption Key
- CMS_ENCRYPTION_KEY: envField.string({
- context: 'server',
- access: 'secret',
- optional: false,
- }),
- // GitHub Auth Provider Environment Variables
- CMS_GITHUB_CLIENT_ID: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_GITHUB_CLIENT_SECRET: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_GITHUB_REDIRECT_URI: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- // Discord Auth Provider Environment Variables
- CMS_DISCORD_CLIENT_ID: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_DISCORD_CLIENT_SECRET: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_DISCORD_REDIRECT_URI: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- // Google Auth Provider Environment Variables
- CMS_GOOGLE_CLIENT_ID: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_GOOGLE_CLIENT_SECRET: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_GOOGLE_REDIRECT_URI: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- // Auth0 Auth Provider Environment Variables
- CMS_AUTH0_CLIENT_ID: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_AUTH0_CLIENT_SECRET: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_AUTH0_DOMAIN: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- CMS_AUTH0_REDIRECT_URI: envField.string({
- context: 'server',
- access: 'secret',
- optional: true,
- }),
- },
-};
diff --git a/packages/studiocms_auth/src/components/OAuthButtonStack.astro b/packages/studiocms_auth/src/components/OAuthButtonStack.astro
index bae54cdfc..113fac6c3 100644
--- a/packages/studiocms_auth/src/components/OAuthButtonStack.astro
+++ b/packages/studiocms_auth/src/components/OAuthButtonStack.astro
@@ -1,10 +1,10 @@
---
-import { getLangFromUrl, useTranslations } from 'studiocms:i18n';
+import { useTranslations } from 'studiocms:i18n';
import { Divider } from '@studiocms/ui/components';
import OAuthButton from './OAuthButton.astro';
import { providerData, showOAuth } from './oAuthButtonProviders';
-const lang = getLangFromUrl(Astro.url);
+const lang = 'en-us';
const t = useTranslations(lang, '@studiocms/auth:oauth-stack');
const shouldShowOAuth = showOAuth && providerData.some(({ enabled }) => enabled);
diff --git a/packages/studiocms_auth/src/components/StaticAuthCheck.astro b/packages/studiocms_auth/src/components/StaticAuthCheck.astro
index 8452ea897..672601501 100644
--- a/packages/studiocms_auth/src/components/StaticAuthCheck.astro
+++ b/packages/studiocms_auth/src/components/StaticAuthCheck.astro
@@ -1,33 +1,20 @@
---
import { getUserData } from 'studiocms:auth/lib/user';
-import { StudioCMSRoutes } from 'studiocms:helpers/routemap';
-import { getLangFromUrl, useTranslatedPath } from 'studiocms:i18n';
+import { StudioCMSRoutes } from 'studiocms:lib';
const { isLoggedIn } = await getUserData(Astro);
-// Get the language and translations
-const referer = Astro.request.headers.get('referer');
-
-if (!referer) {
- throw new Error('No referer found');
-}
-
-const lang = getLangFromUrl(new URL(referer));
-const translatePath = useTranslatedPath(lang);
-const {
- mainLinks: { dashboardIndex },
-} = StudioCMSRoutes;
---
\ No newline at end of file
diff --git a/packages/studiocms_auth/src/components/oAuthButtonProviders.ts b/packages/studiocms_auth/src/components/oAuthButtonProviders.ts
index ca56993a9..19985b365 100644
--- a/packages/studiocms_auth/src/components/oAuthButtonProviders.ts
+++ b/packages/studiocms_auth/src/components/oAuthButtonProviders.ts
@@ -1,28 +1,12 @@
import { authEnvCheck } from 'studiocms:auth/utils/authEnvCheck';
-import { StudioCMSRoutes } from 'studiocms:helpers/routemap';
-import Config from 'virtual:studiocms/config';
+import { AuthConfig } from 'studiocms:config';
+import { StudioCMSRoutes } from 'studiocms:lib';
-const {
- dashboardConfig: {
- AuthConfig: { providers },
- },
-} = Config;
-
-const {
- authLinks: { googleIndex, auth0Index, discordIndex, githubIndex },
-} = StudioCMSRoutes;
-
-const {
- DISCORD: { ENABLED: discordEnabled },
- GITHUB: { ENABLED: githubEnabled },
- GOOGLE: { ENABLED: googleEnabled },
- AUTH0: { ENABLED: auth0Enabled },
- SHOW_OAUTH,
-} = await authEnvCheck(providers);
+const authEnv = await authEnvCheck(AuthConfig.providers);
-export const showOAuth = SHOW_OAUTH;
+export const showOAuth = authEnv.SHOW_OAUTH;
-type ProviderData = {
+export type ProviderData = {
enabled: boolean;
href: string;
label: string;
@@ -31,27 +15,27 @@ type ProviderData = {
export const providerData: ProviderData[] = [
{
- enabled: githubEnabled,
- href: githubIndex,
+ enabled: authEnv.GITHUB.ENABLED,
+ href: StudioCMSRoutes.authLinks.githubIndex,
label: 'GitHub',
- image: ``,
+ image: ``,
},
{
- enabled: discordEnabled,
- href: discordIndex,
+ enabled: authEnv.DISCORD.ENABLED,
+ href: StudioCMSRoutes.authLinks.discordIndex,
label: 'Discord',
- image: ``,
+ image: ``,
},
{
- enabled: googleEnabled,
- href: googleIndex,
+ enabled: authEnv.GOOGLE.ENABLED,
+ href: StudioCMSRoutes.authLinks.googleIndex,
label: 'Google',
- image: ``,
+ image: ``,
},
{
- enabled: auth0Enabled,
- href: auth0Index,
+ enabled: authEnv.AUTH0.ENABLED,
+ href: StudioCMSRoutes.authLinks.auth0Index,
label: 'Auth0',
- image: ``,
+ image: ``,
},
];
diff --git a/packages/studiocms_auth/src/hooks/config-done.ts b/packages/studiocms_auth/src/hooks/config-done.ts
new file mode 100644
index 000000000..9c01286ca
--- /dev/null
+++ b/packages/studiocms_auth/src/hooks/config-done.ts
@@ -0,0 +1,13 @@
+import { defineUtility } from 'astro-integration-kit';
+import authLibDTS from '../stubs/auth-lib';
+import authScriptsDTS from '../stubs/auth-scripts';
+import authUtilsDTS from '../stubs/auth-utils';
+
+export const configDone = defineUtility('astro:config:done')(({ injectTypes }) => {
+ // Inject Types
+ injectTypes(authLibDTS);
+ injectTypes(authUtilsDTS);
+ injectTypes(authScriptsDTS);
+});
+
+export default configDone;
diff --git a/packages/studiocms_auth/src/hooks/config-setup.ts b/packages/studiocms_auth/src/hooks/config-setup.ts
new file mode 100644
index 000000000..f57e0756f
--- /dev/null
+++ b/packages/studiocms_auth/src/hooks/config-setup.ts
@@ -0,0 +1,259 @@
+import { runtimeLogger } from '@inox-tools/runtime-logger';
+import { integrationLogger } from '@matthiesenxyz/integration-utils/astroUtils';
+import { makePublicRoute } from '@studiocms/core/lib';
+import { addAstroEnvConfig } from '@studiocms/core/utils';
+import { addVirtualImports, createResolver, defineUtility } from 'astro-integration-kit';
+import { envField } from 'astro/config';
+import copy from 'rollup-plugin-copy';
+import type { StudioCMSAuthOptions } from '../schema';
+import { checkEnvKeys } from '../utils/checkENV';
+import { injectAuthAPIRoutes, injectAuthPageRoutes } from '../utils/routeBuilder';
+
+export const configSetup = defineUtility('astro:config:setup')(
+ (params, name: string, options: StudioCMSAuthOptions, prerenderRoutes: boolean) => {
+ // Destructure Params
+ const { logger, updateConfig } = params;
+
+ // Destructure Options
+ const {
+ verbose,
+ dashboardConfig: {
+ dashboardEnabled,
+ AuthConfig: {
+ providers: {
+ github: githubAPI,
+ discord: discordAPI,
+ google: googleAPI,
+ auth0: auth0API,
+ usernameAndPassword: usernameAndPasswordAPI,
+ usernameAndPasswordConfig: { allowUserRegistration },
+ },
+ },
+ },
+ } = options;
+
+ // Create resolver relative to this file
+ const { resolve } = createResolver(import.meta.url);
+
+ // Log that Setup is Starting
+ integrationLogger({ logger, logLevel: 'info', verbose }, 'Setting up StudioCMS Auth...');
+
+ // Inject `@it-astro:logger:{name}` Logger for runtime logging
+ runtimeLogger(params, { name: 'studiocms-auth' });
+
+ // Check for Authentication Environment Variables
+ checkEnvKeys(logger, options);
+
+ // Update Astro Config with Environment Variables (`astro:env`)
+ addAstroEnvConfig(params, {
+ validateSecrets: true,
+ schema: {
+ // Auth Encryption Key
+ CMS_ENCRYPTION_KEY: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: false,
+ }),
+ // GitHub Auth Provider Environment Variables
+ CMS_GITHUB_CLIENT_ID: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_GITHUB_CLIENT_SECRET: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_GITHUB_REDIRECT_URI: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ // Discord Auth Provider Environment Variables
+ CMS_DISCORD_CLIENT_ID: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_DISCORD_CLIENT_SECRET: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_DISCORD_REDIRECT_URI: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ // Google Auth Provider Environment Variables
+ CMS_GOOGLE_CLIENT_ID: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_GOOGLE_CLIENT_SECRET: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_GOOGLE_REDIRECT_URI: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ // Auth0 Auth Provider Environment Variables
+ CMS_AUTH0_CLIENT_ID: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_AUTH0_CLIENT_SECRET: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_AUTH0_DOMAIN: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ CMS_AUTH0_REDIRECT_URI: envField.string({
+ context: 'server',
+ access: 'secret',
+ optional: true,
+ }),
+ },
+ });
+
+ // injectAuthHelper
+ addVirtualImports(params, {
+ name,
+ imports: {
+ 'studiocms:auth/lib/encryption': `export * from '${resolve('../lib/encryption.ts')}'`,
+ 'studiocms:auth/lib/password': `export * from '${resolve('../lib/password.ts')}'`,
+ 'studiocms:auth/lib/rate-limit': `export * from '${resolve('../lib/rate-limit.ts')}'`,
+ 'studiocms:auth/lib/session': `export * from '${resolve('../lib/session.ts')}'`,
+ 'studiocms:auth/lib/types': `export * from '${resolve('../lib/types.ts')}'`,
+ 'studiocms:auth/lib/user': `export * from '${resolve('../lib/user.ts')}'`,
+ 'studiocms:auth/utils/authEnvCheck': `export * from '${resolve('../utils/authEnvCheck.ts')}'`,
+ 'studiocms:auth/utils/validImages': `export * from '${resolve('../utils/validImages.ts')}'`,
+ 'studiocms:auth/utils/getLabelForPermissionLevel': `export * from '${resolve('../utils/getLabelForPermissionLevel.ts')}'`,
+ 'studiocms:auth/scripts/three': `import ${JSON.stringify(resolve('../scripts/three.ts'))}`,
+ 'studiocms:auth/scripts/formListener': `export * from '${resolve('../scripts/formListener.ts')}'`,
+ },
+ });
+
+ integrationLogger({ logger, logLevel: 'info', verbose }, 'Updating user Astro config...');
+
+ // Update Astro Config
+ updateConfig({
+ vite: {
+ optimizeDeps: {
+ exclude: ['three'],
+ },
+ plugins: [
+ copy({
+ copyOnce: true,
+ hook: 'buildStart',
+ targets: [
+ {
+ src: resolve('../public/*'),
+ dest: makePublicRoute('auth'),
+ },
+ ],
+ }),
+ ],
+ },
+ });
+
+ // Inject API Routes
+ injectAuthAPIRoutes(params, {
+ options,
+ routes: [
+ {
+ pattern: 'login',
+ entrypoint: resolve('../routes/api/login.ts'),
+ enabled: usernameAndPasswordAPI,
+ },
+ {
+ pattern: 'logout',
+ entrypoint: resolve('../routes/api/logout.ts'),
+ enabled: dashboardEnabled && !options.dbStartPage,
+ },
+ {
+ pattern: 'register',
+ entrypoint: resolve('../routes/api/register.ts'),
+ enabled: usernameAndPasswordAPI && allowUserRegistration,
+ },
+ {
+ pattern: 'github',
+ entrypoint: resolve('../routes/api/github/index.ts'),
+ enabled: githubAPI,
+ },
+ {
+ pattern: 'github/callback',
+ entrypoint: resolve('../routes/api/github/callback.ts'),
+ enabled: githubAPI,
+ },
+ {
+ pattern: 'discord',
+ entrypoint: resolve('../routes/api/discord/index.ts'),
+ enabled: discordAPI,
+ },
+ {
+ pattern: 'discord/callback',
+ entrypoint: resolve('../routes/api/discord/callback.ts'),
+ enabled: discordAPI,
+ },
+ {
+ pattern: 'google',
+ entrypoint: resolve('../routes/api/google/index.ts'),
+ enabled: googleAPI,
+ },
+ {
+ pattern: 'google/callback',
+ entrypoint: resolve('../routes/api/google/callback.ts'),
+ enabled: googleAPI,
+ },
+ {
+ pattern: 'auth0',
+ entrypoint: resolve('../routes/api/auth0/index.ts'),
+ enabled: auth0API,
+ },
+ {
+ pattern: 'auth0/callback',
+ entrypoint: resolve('../routes/api/auth0/callback.ts'),
+ enabled: auth0API,
+ },
+ ],
+ });
+
+ injectAuthPageRoutes(
+ params,
+ {
+ options,
+ routes: [
+ {
+ pattern: 'login/',
+ entrypoint: resolve('../routes/login.astro'),
+ enabled: dashboardEnabled && !options.dbStartPage,
+ },
+ {
+ pattern: 'logout/',
+ entrypoint: resolve('../routes/logout.astro'),
+ enabled: dashboardEnabled && !options.dbStartPage,
+ },
+ {
+ pattern: 'signup/',
+ entrypoint: resolve('../routes/signup.astro'),
+ enabled: usernameAndPasswordAPI && allowUserRegistration,
+ },
+ ],
+ },
+ prerenderRoutes
+ );
+ }
+);
+
+export default configSetup;
diff --git a/packages/studiocms_auth/src/index.ts b/packages/studiocms_auth/src/index.ts
index 38ebcc424..0fea21e2d 100644
--- a/packages/studiocms_auth/src/index.ts
+++ b/packages/studiocms_auth/src/index.ts
@@ -1,8 +1,20 @@
-import integration from './integration';
+import type { AstroIntegration } from 'astro';
+import { name } from '../package.json';
+import configDone from './hooks/config-done';
+import configSetup from './hooks/config-setup';
+import type { StudioCMSAuthOptions } from './schema';
/**
* StudioCMS Auth Integration
*/
-const studioCMSAuth = integration;
+function studioCMSAuth(options: StudioCMSAuthOptions, prerenderRoutes: boolean): AstroIntegration {
+ return {
+ name,
+ hooks: {
+ 'astro:config:setup': (params) => configSetup(params, name, options, prerenderRoutes),
+ 'astro:config:done': (params) => configDone(params),
+ },
+ };
+}
export default studioCMSAuth;
diff --git a/packages/studiocms_auth/src/integration.ts b/packages/studiocms_auth/src/integration.ts
deleted file mode 100644
index a47d20298..000000000
--- a/packages/studiocms_auth/src/integration.ts
+++ /dev/null
@@ -1,199 +0,0 @@
-import { runtimeLogger } from '@inox-tools/runtime-logger';
-import { integrationLogger } from '@matthiesenxyz/integration-utils/astroUtils';
-import { DashboardStrings } from '@studiocms/core/strings';
-import { addAstroEnvConfig } from '@studiocms/core/utils';
-import { addVirtualImports, createResolver, defineIntegration } from 'astro-integration-kit';
-import copy from 'rollup-plugin-copy';
-import { name } from '../package.json';
-import { astroENV } from './astroenv/env';
-import { StudioCMSAuthOptionsSchema } from './schema';
-import authLibDTS from './stubs/auth-lib';
-import authScriptsDTS from './stubs/auth-scripts';
-import authUtilsDTS from './stubs/auth-utils';
-import { checkEnvKeys } from './utils/checkENV';
-import { injectAuthAPIRoutes, injectAuthPageRoutes } from './utils/routeBuilder';
-
-export default defineIntegration({
- name,
- optionsSchema: StudioCMSAuthOptionsSchema,
- setup({
- name,
- options,
- options: {
- dashboardConfig: {
- dashboardEnabled,
- AuthConfig: {
- providers: {
- github: githubAPI,
- discord: discordAPI,
- google: googleAPI,
- auth0: auth0API,
- usernameAndPassword: usernameAndPasswordAPI,
- usernameAndPasswordConfig: { allowUserRegistration },
- },
- },
- },
- },
- }) {
- // Create resolver relative to this file
- const { resolve } = createResolver(import.meta.url);
-
- return {
- hooks: {
- 'astro:config:setup': async (params) => {
- // Destructure Params
- const { logger, updateConfig } = params;
-
- // Log that Setup is Starting
- integrationLogger(
- { logger, logLevel: 'info', verbose: options.verbose },
- DashboardStrings.Setup
- );
-
- // Inject `@it-astro:logger:{name}` Logger for runtime logging
- runtimeLogger(params, { name: 'studiocms-auth' });
-
- // Check for Authentication Environment Variables
- checkEnvKeys(logger, options);
-
- // Update Astro Config with Environment Variables (`astro:env`)
- addAstroEnvConfig(params, astroENV);
-
- // injectAuthHelper
- addVirtualImports(params, {
- name,
- imports: {
- 'studiocms:auth/lib/encryption': `export * from '${resolve('./lib/encryption.ts')}'`,
- 'studiocms:auth/lib/password': `export * from '${resolve('./lib/password.ts')}'`,
- 'studiocms:auth/lib/rate-limit': `export * from '${resolve('./lib/rate-limit.ts')}'`,
- 'studiocms:auth/lib/session': `export * from '${resolve('./lib/session.ts')}'`,
- 'studiocms:auth/lib/types': `export * from '${resolve('./lib/types.ts')}'`,
- 'studiocms:auth/lib/user': `export * from '${resolve('./lib/user.ts')}'`,
- 'studiocms:auth/utils/authEnvCheck': `export * from '${resolve('./utils/authEnvCheck.ts')}'`,
- 'studiocms:auth/utils/validImages': `export * from '${resolve('./utils/validImages.ts')}'`,
- 'studiocms:auth/scripts/three': `import ${JSON.stringify(resolve('./scripts/three.ts'))}`,
- 'studiocms:auth/scripts/formListener': `export * from '${resolve('./scripts/formListener.ts')}'`,
- },
- });
-
- // Update Astro Config
- updateConfig({
- security: {
- checkOrigin: true,
- },
- experimental: {
- directRenderScript: true,
- serverIslands: true,
- },
- vite: {
- optimizeDeps: {
- exclude: ['astro:db', 'three'],
- },
- plugins: [
- copy({
- copyOnce: true,
- hook: 'buildStart',
- targets: [
- {
- src: resolve('./resources/*'),
- dest: 'public/studiocms-auth/',
- },
- ],
- }),
- ],
- },
- });
-
- // Inject API Routes
- injectAuthAPIRoutes(params, {
- options,
- routes: [
- {
- pattern: 'login',
- entrypoint: resolve('./routes/api/login.ts'),
- enabled: usernameAndPasswordAPI,
- },
- {
- pattern: 'logout',
- entrypoint: resolve('./routes/api/logout.ts'),
- enabled: dashboardEnabled && !options.dbStartPage,
- },
- {
- pattern: 'register',
- entrypoint: resolve('./routes/api/register.ts'),
- enabled: usernameAndPasswordAPI && allowUserRegistration,
- },
- {
- pattern: 'github',
- entrypoint: resolve('./routes/api/github/index.ts'),
- enabled: githubAPI,
- },
- {
- pattern: 'github/callback',
- entrypoint: resolve('./routes/api/github/callback.ts'),
- enabled: githubAPI,
- },
- {
- pattern: 'discord',
- entrypoint: resolve('./routes/api/discord/index.ts'),
- enabled: discordAPI,
- },
- {
- pattern: 'discord/callback',
- entrypoint: resolve('./routes/api/discord/callback.ts'),
- enabled: discordAPI,
- },
- {
- pattern: 'google',
- entrypoint: resolve('./routes/api/google/index.ts'),
- enabled: googleAPI,
- },
- {
- pattern: 'google/callback',
- entrypoint: resolve('./routes/api/google/callback.ts'),
- enabled: googleAPI,
- },
- {
- pattern: 'auth0',
- entrypoint: resolve('./routes/api/auth0/index.ts'),
- enabled: auth0API,
- },
- {
- pattern: 'auth0/callback',
- entrypoint: resolve('./routes/api/auth0/callback.ts'),
- enabled: auth0API,
- },
- ],
- });
-
- injectAuthPageRoutes(params, {
- options,
- routes: [
- {
- pattern: 'login/',
- entrypoint: resolve('./routes/login.astro'),
- enabled: dashboardEnabled && !options.dbStartPage,
- },
- {
- pattern: 'logout/',
- entrypoint: resolve('./routes/logout.astro'),
- enabled: dashboardEnabled && !options.dbStartPage,
- },
- {
- pattern: 'signup/',
- entrypoint: resolve('./routes/signup.astro'),
- enabled: usernameAndPasswordAPI && allowUserRegistration,
- },
- ],
- });
- },
- 'astro:config:done': async ({ injectTypes }) => {
- // Inject Types
- injectTypes(authLibDTS);
- injectTypes(authUtilsDTS);
- injectTypes(authScriptsDTS);
- },
- },
- };
- },
-});
diff --git a/packages/studiocms_auth/src/layouts/AuthLayout.astro b/packages/studiocms_auth/src/layouts/AuthLayout.astro
index 8d79a6927..582ec3b18 100644
--- a/packages/studiocms_auth/src/layouts/AuthLayout.astro
+++ b/packages/studiocms_auth/src/layouts/AuthLayout.astro
@@ -2,86 +2,53 @@
import '@fontsource-variable/onest/index.css';
import '@studiocms/ui/css/global.css';
import './authlayout.css';
-import { Image } from 'astro:assets';
-import { db, eq } from 'astro:db';
-import { validImages } from 'studiocms:auth/utils/validImages';
-import Config from 'virtual:studiocms/config';
-import version from 'virtual:studiocms/version';
+import { Generator } from 'studiocms:components';
import onestWoff2 from '@fontsource-variable/onest/files/onest-latin-wght-normal.woff2?url';
-import { CMSSiteConfigId } from '@studiocms/core/consts';
-import { tsSiteConfig } from '@studiocms/core/db/tsTables';
import { Toaster } from '@studiocms/ui/components';
import OAuthButtonStack from '../components/OAuthButtonStack.astro';
-import StudioCMSLogoSVG from '../components/StudioCMSLogoSVG.astro';
-
-const {
- dashboardConfig: { faviconURL },
-} = Config;
+import StaticAuthCheck from '../components/StaticAuthCheck.astro';
+import FallbackCanvas from './FallbackCanvas.astro';
+import ThreeCanvasLoader from './ThreeCanvasLoader.astro';
interface Props {
title: string;
description: string;
lang: string;
disableScreen?: boolean;
+ checkLogin?: boolean;
+ pagePreRendered?: boolean;
}
-const { title, description, lang, disableScreen } = Astro.props;
-
-// Get the site config
-const siteConfig = await db
- .select()
- .from(tsSiteConfig)
- .where(eq(tsSiteConfig.id, CMSSiteConfigId))
- .get();
-
-// Get the login page background and custom image from the site config
-const loginPageBackground = siteConfig?.loginPageBackground;
-const loginPageCustomImage = siteConfig?.loginPageCustomImage;
-
-const fallbackImageSrc =
- loginPageBackground === 'custom'
- ? loginPageCustomImage
- : validImages.find((x) => x.name !== 'custom' && x.name === loginPageBackground)?.dark; // TODO: Adapt to theme
+const { title, description, lang, disableScreen, checkLogin, pagePreRendered = true } = Astro.props;
---
+ {/* Global Metadata */}
-
-
-
-
+
+
+ {/* Favicon */}
+
+
+
+
+ {/* Primary Meta Tags */}
{title}
+
+ {/* Fonts */}
+