diff --git a/apps/sample-website/eslint.config.mjs b/apps/sample-website/eslint.config.mjs deleted file mode 100644 index 7dd5436..0000000 --- a/apps/sample-website/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import { nextConfig } from "@mintel/eslint-config/next"; - -export default nextConfig; diff --git a/apps/sample-website/package.json b/apps/sample-website/package.json index 08a4e99..96fd295 100644 --- a/apps/sample-website/package.json +++ b/apps/sample-website/package.json @@ -8,7 +8,7 @@ "dev:local": "mintel dev --local", "build": "next build", "start": "next start", - "lint": "next lint .", + "lint": "eslint src/", "typecheck": "tsc --noEmit", "test": "vitest run --passWithNoTests", "cms:pull:prod": "mintel directus sync pull production", diff --git a/packages/cms-infra/database/RELOAD_TEST b/packages/cms-infra/database/RELOAD_TEST new file mode 100644 index 0000000..e69de29 diff --git a/packages/cms-infra/schema/snapshot.yaml b/packages/cms-infra/schema/snapshot.yaml new file mode 100644 index 0000000..bd4fb8f --- /dev/null +++ b/packages/cms-infra/schema/snapshot.yaml @@ -0,0 +1,1203 @@ +version: 1 +directus: 11.14.1 +vendor: sqlite +collections: + - collection: client_users + meta: + accountability: all + archive_app_filter: true + archive_field: null + archive_value: null + collapse: open + collection: client_users + color: null + display_template: '{{first_name}} {{last_name}} ({{email}})' + group: null + hidden: true + icon: people_outline + item_duplication_fields: null + note: null + preview_url: null + singleton: false + sort: null + sort_field: null + translations: null + unarchive_value: null + versioning: false + schema: + name: client_users + - collection: companies + meta: + accountability: all + archive_app_filter: true + archive_field: null + archive_value: null + collapse: open + collection: companies + color: null + display_template: '{{name}}' + group: null + hidden: true + icon: business + item_duplication_fields: null + note: null + preview_url: null + singleton: false + sort: 1 + sort_field: null + translations: null + unarchive_value: null + versioning: false + schema: + name: companies + - collection: visual_feedback + meta: + accountability: all + archive_app_filter: true + archive_field: null + archive_value: null + collapse: open + collection: visual_feedback + color: '#663399' + display_template: '{{user_name}}: {{text}}' + group: null + hidden: true + icon: view_kanban + item_duplication_fields: null + note: null + preview_url: null + singleton: false + sort: null + sort_field: null + translations: null + unarchive_value: null + versioning: false + schema: + name: visual_feedback + - collection: visual_feedback_comments + meta: + accountability: all + archive_app_filter: true + archive_field: null + archive_value: null + collapse: open + collection: visual_feedback_comments + color: '#2196F3' + display_template: null + group: null + hidden: true + icon: comment + item_duplication_fields: null + note: null + preview_url: null + singleton: false + sort: null + sort_field: null + translations: null + unarchive_value: null + versioning: false + schema: + name: visual_feedback_comments +fields: + - collection: client_users + field: id + type: uuid + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: id + group: null + hidden: true + interface: null + note: null + options: null + readonly: false + required: false + searchable: true + sort: 1 + special: + - uuid + translations: null + validation: null + validation_message: null + width: full + schema: + name: id + table: client_users + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: false + is_unique: true + is_indexed: false + is_primary_key: true + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: client_users + field: email + type: string + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: email + group: null + hidden: false + interface: input + note: null + options: null + readonly: false + required: true + searchable: true + sort: 2 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: email + table: client_users + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: true + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: client_users + field: password + type: string + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: password + group: null + hidden: false + interface: input-password + note: null + options: + generate: true + masked: true + readonly: false + required: false + searchable: true + sort: 3 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: password + table: client_users + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: client_users + field: first_name + type: string + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: first_name + group: null + hidden: false + interface: input + note: null + options: null + readonly: false + required: false + searchable: true + sort: 4 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: first_name + table: client_users + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: client_users + field: last_name + type: string + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: last_name + group: null + hidden: false + interface: input + note: null + options: null + readonly: false + required: false + searchable: true + sort: 5 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: last_name + table: client_users + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: client_users + field: company + type: string + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: company + group: null + hidden: false + interface: select-dropdown-m2o + note: null + options: null + readonly: false + required: false + searchable: true + sort: 6 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: company + table: client_users + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: companies + foreign_key_column: id + - collection: client_users + field: last_invited + type: timestamp + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: last_invited + group: null + hidden: false + interface: datetime + note: Wann wurden die Zugangsdaten zuletzt gesendet? + options: null + readonly: true + required: false + searchable: true + sort: 7 + special: + - cast-timestamp + translations: null + validation: null + validation_message: null + width: half + schema: + name: last_invited + table: client_users + data_type: datetime + default_value: null + max_length: null + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: client_users + field: temporary_password + type: string + meta: + collection: client_users + conditions: null + display: null + display_options: null + field: temporary_password + group: null + hidden: false + interface: input + note: Wird automatisch beim Einladen generiert. + options: null + readonly: true + required: false + searchable: true + sort: 8 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: temporary_password + table: client_users + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: companies + field: id + type: uuid + meta: + collection: companies + conditions: null + display: null + display_options: null + field: id + group: null + hidden: true + interface: input + note: null + options: null + readonly: false + required: false + searchable: true + sort: 1 + special: + - uuid + translations: null + validation: null + validation_message: null + width: full + schema: + name: id + table: companies + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: false + is_unique: true + is_indexed: false + is_primary_key: true + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: companies + field: name + type: string + meta: + collection: companies + conditions: null + display: null + display_options: null + field: name + group: null + hidden: false + interface: input + note: null + options: null + readonly: false + required: false + searchable: true + sort: 2 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: name + table: companies + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: companies + field: domain + type: string + meta: + collection: companies + conditions: null + display: null + display_options: null + field: domain + group: null + hidden: false + interface: input + note: null + options: null + readonly: false + required: false + searchable: true + sort: 3 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: domain + table: companies + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: companies + field: notes + type: text + meta: + collection: companies + conditions: null + display: null + display_options: null + field: notes + group: null + hidden: false + interface: input-multiline + note: null + options: null + readonly: false + required: false + searchable: true + sort: 4 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: notes + table: companies + data_type: text + default_value: null + max_length: null + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: companies + field: employees + type: alias + meta: + collection: companies + conditions: null + display: related-values + display_options: + template: '{{first_name}} {{last_name}} ({{email}})' + field: employees + group: null + hidden: false + interface: list-o2m + note: Kunden-Mitarbeiter (KEINE CMS Nutzer) + options: + enableCreate: true + enableSelect: true + fields: + - first_name + - last_name + - email + readonly: false + required: false + searchable: true + sort: 5 + special: + - o2m + translations: null + validation: null + validation_message: null + width: full + - collection: directus_users + field: company + type: string + meta: + collection: directus_users + conditions: null + display: null + display_options: null + field: company + group: null + hidden: false + interface: select-dropdown-m2o + note: Zugehörige Kunden-Firma + options: null + readonly: false + required: false + searchable: true + sort: 1 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: company + table: directus_users + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: id + type: integer + meta: + collection: visual_feedback + conditions: null + display: null + display_options: null + field: id + group: null + hidden: true + interface: numeric + note: null + options: null + readonly: true + required: false + searchable: true + sort: 1 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: id + table: visual_feedback + data_type: integer + default_value: null + max_length: null + numeric_precision: null + numeric_scale: null + is_nullable: false + is_unique: false + is_indexed: false + is_primary_key: true + is_generated: false + generation_expression: null + has_auto_increment: true + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: status + type: string + meta: + collection: visual_feedback + conditions: null + display: labels + display_options: null + field: status + group: null + hidden: false + interface: select-dropdown + note: null + options: + choices: + - text: Open + value: open + - text: In Progress + value: in_progress + - text: Resolved + value: resolved + readonly: false + required: false + searchable: true + sort: 2 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: status + table: visual_feedback + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: text + type: text + meta: + collection: visual_feedback + conditions: null + display: null + display_options: null + field: text + group: null + hidden: false + interface: input-multiline + note: null + options: null + readonly: false + required: false + searchable: true + sort: 3 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: text + table: visual_feedback + data_type: text + default_value: null + max_length: null + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: url + type: string + meta: + collection: visual_feedback + conditions: null + display: link + display_options: + icon: open_in_new + label: Open & Highlight 🎯 + template: '{{url}}?fb_id={{id}}' + field: url + group: null + hidden: false + interface: input + note: null + options: null + readonly: true + required: false + searchable: true + sort: null + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: url + table: visual_feedback + data_type: varchar + default_value: null + max_length: 255 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: date_created + type: timestamp + meta: + collection: visual_feedback + conditions: null + display: null + display_options: null + field: date_created + group: null + hidden: true + interface: datetime + note: null + options: null + readonly: true + required: false + searchable: true + sort: 4 + special: + - date-created + - cast-timestamp + translations: null + validation: null + validation_message: null + width: half + schema: + name: date_created + table: visual_feedback + data_type: datetime + default_value: null + max_length: null + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: user_created + type: string + meta: + collection: visual_feedback + conditions: null + display: null + display_options: null + field: user_created + group: null + hidden: true + interface: select-dropdown-m2o + note: null + options: null + readonly: true + required: false + searchable: true + sort: 5 + special: + - user-created + translations: null + validation: null + validation_message: null + width: half + schema: + name: user_created + table: visual_feedback + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: screenshot + type: string + meta: + collection: visual_feedback + conditions: null + display: null + display_options: null + field: screenshot + group: null + hidden: false + interface: file + note: Captured visual evidence of the feedback marking + options: null + readonly: false + required: false + searchable: true + sort: 6 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: screenshot + table: visual_feedback + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback + field: company + type: string + meta: + collection: visual_feedback + conditions: null + display: null + display_options: null + field: company + group: null + hidden: false + interface: select-dropdown-m2o + note: Company workspace this feedback belongs to + options: null + readonly: false + required: false + searchable: true + sort: 7 + special: null + translations: null + validation: null + validation_message: null + width: half + schema: + name: company + table: visual_feedback + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: companies + foreign_key_column: id + - collection: visual_feedback_comments + field: id + type: integer + meta: + collection: visual_feedback_comments + conditions: null + display: null + display_options: null + field: id + group: null + hidden: true + interface: numeric + note: null + options: null + readonly: true + required: false + searchable: true + sort: 1 + special: null + translations: null + validation: null + validation_message: null + width: full + schema: + name: id + table: visual_feedback_comments + data_type: integer + default_value: null + max_length: null + numeric_precision: null + numeric_scale: null + is_nullable: false + is_unique: false + is_indexed: false + is_primary_key: true + is_generated: false + generation_expression: null + has_auto_increment: true + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback_comments + field: date_created + type: timestamp + meta: + collection: visual_feedback_comments + conditions: null + display: null + display_options: null + field: date_created + group: null + hidden: true + interface: datetime + note: null + options: null + readonly: true + required: false + searchable: true + sort: 2 + special: + - date-created + - cast-timestamp + translations: null + validation: null + validation_message: null + width: half + schema: + name: date_created + table: visual_feedback_comments + data_type: datetime + default_value: null + max_length: null + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null + - collection: visual_feedback_comments + field: user_created + type: string + meta: + collection: visual_feedback_comments + conditions: null + display: null + display_options: null + field: user_created + group: null + hidden: true + interface: select-dropdown-m2o + note: null + options: null + readonly: true + required: false + searchable: true + sort: 3 + special: + - user-created + translations: null + validation: null + validation_message: null + width: half + schema: + name: user_created + table: visual_feedback_comments + data_type: char + default_value: null + max_length: 36 + numeric_precision: null + numeric_scale: null + is_nullable: true + is_unique: false + is_indexed: false + is_primary_key: false + is_generated: false + generation_expression: null + has_auto_increment: false + foreign_key_table: null + foreign_key_column: null +systemFields: + - collection: directus_activity + field: timestamp + schema: + is_indexed: true + - collection: directus_revisions + field: activity + schema: + is_indexed: true + - collection: directus_revisions + field: parent + schema: + is_indexed: true +relations: + - collection: client_users + field: company + related_collection: companies + meta: + junction_field: null + many_collection: client_users + many_field: company + one_allowed_collections: null + one_collection: companies + one_collection_field: null + one_deselect_action: nullify + one_field: employees + sort_field: null + schema: + table: client_users + column: company + foreign_key_table: companies + foreign_key_column: id + constraint_name: null + on_update: NO ACTION + on_delete: SET NULL + - collection: directus_users + field: company + related_collection: companies + meta: + junction_field: null + many_collection: directus_users + many_field: company + one_allowed_collections: null + one_collection: companies + one_collection_field: null + one_deselect_action: nullify + one_field: null + sort_field: null + - collection: visual_feedback + field: company + related_collection: companies + meta: + junction_field: null + many_collection: visual_feedback + many_field: company + one_allowed_collections: null + one_collection: companies + one_collection_field: null + one_deselect_action: nullify + one_field: null + sort_field: null + schema: + table: visual_feedback + column: company + foreign_key_table: companies + foreign_key_column: id + constraint_name: null + on_update: NO ACTION + on_delete: SET NULL + - collection: visual_feedback_comments + field: feedback_id + related_collection: visual_feedback + meta: + junction_field: null + many_collection: visual_feedback_comments + many_field: feedback_id + one_allowed_collections: null + one_collection: visual_feedback + one_collection_field: null + one_deselect_action: nullify + one_field: comments + sort_field: null + schema: + table: visual_feedback_comments + column: feedback_id + foreign_key_table: visual_feedback + foreign_key_column: id + constraint_name: null + on_update: NO ACTION + on_delete: NO ACTION diff --git a/scripts/cms-snapshot.sh b/scripts/cms-snapshot.sh index e3d45ad..89acd5d 100755 --- a/scripts/cms-snapshot.sh +++ b/scripts/cms-snapshot.sh @@ -1,15 +1,28 @@ #!/bin/bash +# Configuration +PROJECT="directus" +SCHEMA_PATH="./directus/schema/snapshot.yaml" +CMD_PREFIX="" + +if [ "$1" == "infra" ]; then + PROJECT="infra-cms" + SCHEMA_PATH="./packages/cms-infra/schema/snapshot.yaml" + CMD_PREFIX="docker-compose -f packages/cms-infra/docker-compose.yml" +else + CMD_PREFIX="docker compose" +fi + # Detect local container -LOCAL_CONTAINER=$(docker compose ps -q directus) +LOCAL_CONTAINER=$($CMD_PREFIX ps -q $PROJECT) if [ -z "$LOCAL_CONTAINER" ]; then - echo "❌ Local directus container not found. Is it running?" + echo "❌ Local $PROJECT container not found. Is it running?" exit 1 fi -echo "📸 Creating schema snapshot..." +echo "📸 Creating schema snapshot for $PROJECT..." # Note: we save it to the mounted volume path inside the container -docker exec "$LOCAL_CONTAINER" npx directus schema snapshot /directus/schema/snapshot.yaml +docker exec "$LOCAL_CONTAINER" npx directus schema snapshot -y /directus/schema/snapshot.yaml -echo "✅ Snapshot saved to ./directus/schema/snapshot.yaml" +echo "✅ Snapshot saved to $SCHEMA_PATH"