From 1b9b3dd73f4924643792a844ef37199c1d5b14c9 Mon Sep 17 00:00:00 2001 From: Guido X Jansen Date: Fri, 29 Nov 2024 22:07:42 +0100 Subject: [PATCH] Rollback to 2aca897 --- astro.config.mjs | 21 ++-- keystatic.config.ts | 158 +++++++++++++------------ netlify.toml | 34 ------ package-lock.json | 73 ++++++------ package.json | 10 +- public/_redirects | 10 +- src/pages/api/keystatic/[...params].ts | 8 -- src/pages/keystatic/index.astro | 26 +++- 8 files changed, 160 insertions(+), 180 deletions(-) delete mode 100644 netlify.toml delete mode 100644 src/pages/api/keystatic/[...params].ts diff --git a/astro.config.mjs b/astro.config.mjs index 404c146..c1e294b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -7,13 +7,15 @@ import { fileURLToPath } from 'node:url'; import mdx from '@astrojs/mdx'; import netlify from "@astrojs/netlify"; import icon from "astro-icon"; + import react from "@astrojs/react"; import markdoc from "@astrojs/markdoc"; import keystatic from '@keystatic/astro' // https://astro.build/config export default defineConfig({ - site: "https://commercequest.space", + // https://docs.astro.build/en/guides/images/#authorizing-remote-images + site: "https://commercequest.space/", image: { service: { entrypoint: 'astro/assets/services/sharp' @@ -23,7 +25,7 @@ export default defineConfig({ integrations: [ icon({ include: { - mdi: ["linkedin", "github"], + mdi: ["linkedin", "github"], // Add any other icon names you need }, }), tailwind(), @@ -45,6 +47,7 @@ export default defineConfig({ } }, lastUpdated: true, + // https://starlight.astro.build/guides/sidebar/ sidebar: [{ label: "Community Guides", autogenerate: { @@ -70,7 +73,11 @@ export default defineConfig({ autogenerate: { directory: "other" } - }], + } + /* { + label: "[Templates]]", + autogenerate: { directory: "templates" }, + }, */], social: { github: "https://github.com/spryker-community" }, @@ -86,13 +93,13 @@ export default defineConfig({ tag: "meta", attrs: { property: "og:image", - content: "https://commercequest.space/social.webp" + content: "https://commercequest.space/" + "/social.webp" } }, { tag: "meta", attrs: { property: "twitter:image", - content: "https://commercequest.space/social.webp" + content: "https://commercequest.space/" + "/social.webp" } }] }), @@ -125,7 +132,5 @@ export default defineConfig({ }] } }, - adapter: netlify({ - functionPerRoute: true - }) + adapter: netlify() }); diff --git a/keystatic.config.ts b/keystatic.config.ts index 971264f..4ef6ae8 100644 --- a/keystatic.config.ts +++ b/keystatic.config.ts @@ -1,132 +1,136 @@ +import type { Config } from '@keystatic/core'; import { config, fields, collection } from '@keystatic/core'; -export default config({ +const keystaticConfig: Config = { storage: { - kind: 'github', - repo: { - owner: 'spryker-community', - name: 'commercequest-website' - } + kind: 'cloud', + }, + cloud: { + project: 'commercequest/cq-astro', }, ui: { brand: { name: 'CommerceQuest Admin', }, - navigation: { - Content: ['freelancers'] - } }, collections: { freelancers: collection({ label: 'Freelancers', path: 'src/content/freelancers/*', - slugField: 'firstName', - format: 'yaml', + slugField: 'slug', schema: { - firstName: fields.text({ + firstName: fields.text({ label: "First Name", validation: { length: { min: 1 } } }), - lastName: fields.text({ + lastName: fields.text({ label: "Last Name", validation: { length: { min: 1 } } }), - photo: fields.text({ - label: "Photo", + slug: fields.text({ + label: "Slug", validation: { length: { min: 1 } } }), - headline: fields.text({ - label: "Headline" + photo: fields.image({ + label: "Photo", + directory: "src/images/freelancers", + publicPath: "/src/images/freelancers", + validation: { isRequired: true } + }), + headline: fields.text({ + label: "Headline", }), - availability: fields.text({ + availability: fields.text({ label: "Availability", - validation: { length: { min: 1 } } + validation: { isRequired: true } }), - location: fields.text({ + location: fields.text({ label: "Location", - validation: { length: { min: 1 } } + validation: { isRequired: true, length: { min: 1 } } }), - countryCode: fields.text({ + countryCode: fields.text({ label: "Country Code", validation: { length: { min: 2, max: 2 } } }), - language: fields.text({ + language: fields.text({ label: "Languages", - validation: { length: { min: 1 } } + validation: { isRequired: true } }), - shortPitch: fields.text({ + shortPitch: fields.text({ label: "Short Pitch", - multiline: true + multiline: true, + }), + linkedIn: fields.url({ + label: "LinkedIn URL", }), - linkedIn: fields.url({ - label: "LinkedIn URL" + github: fields.url({ + label: "GitHub URL", }), - github: fields.url({ - label: "GitHub URL" + certifications: fields.multiselect({ + label: "Certifications", + options: [ + { label: "Backend Developer Certified", value: "Backend Developer" }, + { label: "Solution Architect Certified", value: "Solution Architect" } + ], }), - sprykerCertifications: fields.text({ + sprykerCertifications: fields.text({ label: "Spryker Certifications", - multiline: true - }), - skills: fields.array( - fields.select({ - label: "Skill", - options: [ - { label: "Frontend", value: "Frontend" }, - { label: "Back End", value: "Back End" }, - { label: "Architecture", value: "Architecture" }, - { label: "Project Management", value: "Project Management" }, - { label: "Fullstack", value: "Fullstack" }, - { label: "Team Lead", value: "Team Lead" }, - { label: "Tech Lead", value: "Tech Lead" } - ], - defaultValue: "Back End" - }), - { - label: "Skills", - itemLabel: props => props.value - } - ), - timezoneRange: fields.text({ - label: "Timezone Range" - }), - yearStartedWebDev: fields.integer({ + multiline: true, + }), + skills: fields.multiselect({ + label: "Skills", + options: [ + { label: "Frontend", value: "Frontend" }, + { label: "Back End", value: "Back End" }, + { label: "Architecture", value: "Architecture" }, + { label: "Project Management", value: "Project Management" }, + { label: "Fullstack", value: "Fullstack" }, + { label: "Team Lead", value: "Team Lead" }, + { label: "Tech Lead", value: "Tech Lead" } + ] + }), + timezoneRange: fields.text({ + label: "Timezone Range", + }), + yearStartedWebDev: fields.integer({ label: "Year Started Web Development", validation: { min: 1980, max: 2050 } }), - yearStartedSpryker: fields.integer({ + yearStartedSpryker: fields.integer({ label: "Year Started with Spryker", validation: { min: 1980, max: 2050 } }), - references: fields.text({ + references: fields.text({ label: "References", - multiline: true + multiline: true, }), - idealCustomer: fields.text({ + idealCustomer: fields.text({ label: "Ideal Customer", - multiline: true + multiline: true, }), - locationFlexibility: fields.text({ - label: "Location Flexibility" + locationFlexibility: fields.text({ + label: "Location Flexibility", }), - otherCertifications: fields.text({ - label: "Other Certifications" + otherCertifications: fields.text({ + label: "Other Certifications", }), - employmentType: fields.text({ - label: "Employment Type" + employmentType: fields.text({ + label: "Employment Type", }), - contact: fields.text({ + contact: fields.text({ label: "Contact Email", validation: { length: { min: 1 } } }), - forumProfile: fields.url({ - label: "Forum Profile URL" + forumProfile: fields.url({ + label: "Forum Profile URL", }), - isVisible: fields.checkbox({ + isVisible: fields.checkbox({ label: "Is Visible", - defaultValue: true - }) - } - }) - } -}); + defaultValue: true, + }), + }, + }), + }, +}; + +export default keystaticConfig; diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 9165eb0..0000000 --- a/netlify.toml +++ /dev/null @@ -1,34 +0,0 @@ -[build] - command = "npm run build" - publish = "dist" - -[[redirects]] - from = "/keystatic" - to = "/.netlify/functions/entry" - status = 200 - force = true - -[[redirects]] - from = "/keystatic/*" - to = "/.netlify/functions/entry" - status = 200 - force = true - -[[redirects]] - from = "/api/keystatic/*" - to = "/.netlify/functions/entry" - status = 200 - force = true - -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 - force = false - -[functions] - directory = ".netlify/functions/" - node_bundler = "esbuild" - -[build.environment] - ASTRO_ADAPTER = "netlify" diff --git a/package-lock.json b/package-lock.json index c7af4ce..b655a4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "": { "version": "0.0.1", "dependencies": { - "@astro-community/astro-embed-youtube": "^0.5.6", + "@astro-community/astro-embed-youtube": "^0.5.3", "@astrojs/check": "^0.9.4", "@astrojs/markdoc": "^0.11.5", "@astrojs/mdx": "^3.1.9", @@ -26,9 +26,9 @@ "@preline/tabs": "^2.4.1", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", - "astro": "^4.16.15", + "astro": "^4.16.14", "astro-compressor": "^0.4.1", - "astro-icon": "^1.1.4", + "astro-icon": "^1.1.1", "clipboard": "^2.0.11", "flag-icons": "^7.2.3", "globby": "^14.0.2", @@ -40,7 +40,7 @@ "react-dom": "^18.3.1", "sharp": "^0.33.5", "sharp-ico": "^0.1.5", - "tailwindcss": "^3.4.15" + "tailwindcss": "^3.4.14" }, "devDependencies": { "@iconify-json/mdi": "^1.2.1", @@ -50,7 +50,7 @@ "prettier": "^3.3.2", "prettier-plugin-astro": "^0.14.1", "prettier-plugin-tailwindcss": "^0.6.9", - "typescript": "^5.7.2" + "typescript": "^5.5.4" } }, "node_modules/@0no-co/graphql.web": { @@ -115,9 +115,10 @@ } }, "node_modules/@astro-community/astro-embed-youtube": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@astro-community/astro-embed-youtube/-/astro-embed-youtube-0.5.6.tgz", - "integrity": "sha512-/mRfCl/eTBUz0kmjD1psOy0qoDDBorVp0QumUacjFcIkBullYtbeFQ2ZGZ+3N/tA6cR/OIyzr2QA4dQXlY6USg==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@astro-community/astro-embed-youtube/-/astro-embed-youtube-0.5.5.tgz", + "integrity": "sha512-pG9uYjyZB1kpW8Ljy/H1Klof2txVXLwQmyoG4XWblZyt9eqFlaa65MdzL7UKzzqdoOsn64TN+Q+zPbx0HJhP4Q==", + "license": "MIT", "dependencies": { "lite-youtube-embed": "^0.3.3" }, @@ -5088,10 +5089,9 @@ } }, "node_modules/astro": { - "version": "4.16.15", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.16.15.tgz", - "integrity": "sha512-usybZ7nEUiwYKT7r47l4VbkqjKfaE+BgWV/ed4PT3mE3vFRTBWFsXLnkzrN7awfN6+/ekZTAcE+MAkdA551Umw==", - "license": "MIT", + "version": "4.16.14", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.16.14.tgz", + "integrity": "sha512-2IuLkIp4idyspugq+F52rHZyNqHHi2AdQzuKp3SGytg/YAm50dNeWhP/7l+enjgWZLloLq5xsH5gVQpoDFoyFg==", "dependencies": { "@astrojs/compiler": "^2.10.3", "@astrojs/internal-helpers": "0.4.1", @@ -5186,9 +5186,10 @@ } }, "node_modules/astro-icon": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/astro-icon/-/astro-icon-1.1.4.tgz", - "integrity": "sha512-sMLkQaevIQLv38WBzb/RDbsmxhg5+X+KcNmpTi9cE6MLurNWU1MPnlO87d9Vwg4HxTenKpDlYp81A3syXFW/gw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/astro-icon/-/astro-icon-1.1.1.tgz", + "integrity": "sha512-HKBesWk2Faw/0+klLX+epQVqdTfSzZz/9+5vxXUjTJaN/HnpDf608gRPgHh7ZtwBPNJMEFoU5GLegxoDcT56OQ==", + "license": "MIT", "dependencies": { "@iconify/tools": "^4.0.5", "@iconify/types": "^2.0.0", @@ -10366,9 +10367,10 @@ "license": "MIT" }, "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", @@ -12180,32 +12182,32 @@ "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" }, "node_modules/tailwindcss": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.15.tgz", - "integrity": "sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.14.tgz", + "integrity": "sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", - "chokidar": "^3.6.0", + "chokidar": "^3.5.3", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.3.2", + "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.21.6", + "jiti": "^1.21.0", "lilconfig": "^2.1.0", - "micromatch": "^4.0.8", + "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", - "picocolors": "^1.1.1", - "postcss": "^8.4.47", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.2", - "postcss-nested": "^6.2.0", - "postcss-selector-parser": "^6.1.2", - "resolve": "^1.22.8", - "sucrase": "^3.35.0" + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" }, "bin": { "tailwind": "lib/cli.js", @@ -12477,9 +12479,10 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", - "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index dfecf0d..be636fd 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "@astro-community/astro-embed-youtube": "^0.5.6", + "@astro-community/astro-embed-youtube": "^0.5.3", "@astrojs/check": "^0.9.4", "@astrojs/markdoc": "^0.11.5", "@astrojs/mdx": "^3.1.9", @@ -29,9 +29,9 @@ "@preline/tabs": "^2.4.1", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", - "astro": "^4.16.15", + "astro": "^4.16.14", "astro-compressor": "^0.4.1", - "astro-icon": "^1.1.4", + "astro-icon": "^1.1.1", "clipboard": "^2.0.11", "flag-icons": "^7.2.3", "globby": "^14.0.2", @@ -43,7 +43,7 @@ "react-dom": "^18.3.1", "sharp": "^0.33.5", "sharp-ico": "^0.1.5", - "tailwindcss": "^3.4.15" + "tailwindcss": "^3.4.14" }, "devDependencies": { "@iconify-json/mdi": "^1.2.1", @@ -53,6 +53,6 @@ "prettier": "^3.3.2", "prettier-plugin-astro": "^0.14.1", "prettier-plugin-tailwindcss": "^0.6.9", - "typescript": "^5.7.2" + "typescript": "^5.5.4" } } diff --git a/public/_redirects b/public/_redirects index 6b07886..2dc9c04 100644 --- a/public/_redirects +++ b/public/_redirects @@ -4,12 +4,4 @@ /events/* https://forum.commercequest.space/events/:splat 301 /events/ https://forum.commercequest.space/events/ 301 /discussions/ https://forum.commercequest.space/discussions/ 301 -/profile/* https://forum.commercequest.space/profile/:splat 301 - -# Keystatic routes -/keystatic/* /.netlify/functions/entry 200 -/keystatic /.netlify/functions/entry 200 -/api/keystatic/* /.netlify/functions/entry 200 -/admin /keystatic 301 - -/* /index.html 200 +/profile/* https://forum.commercequest.space/profile/:splat 301 \ No newline at end of file diff --git a/src/pages/api/keystatic/[...params].ts b/src/pages/api/keystatic/[...params].ts deleted file mode 100644 index 671532d..0000000 --- a/src/pages/api/keystatic/[...params].ts +++ /dev/null @@ -1,8 +0,0 @@ -import { makeHandler } from '@keystatic/astro/api'; -import keystaticConfig from '../../../../keystatic.config'; - -export const prerender = false; - -export const all = makeHandler({ - config: keystaticConfig, -}); diff --git a/src/pages/keystatic/index.astro b/src/pages/keystatic/index.astro index 92ffda9..8a31a24 100644 --- a/src/pages/keystatic/index.astro +++ b/src/pages/keystatic/index.astro @@ -1,7 +1,25 @@ --- -import keystatic from '@keystatic/astro'; - -export const prerender = false; +import { Keystatic } from '@keystatic/core/ui'; +import keystaticConfig from '../../../keystatic.config'; --- - + + + + + + Admin | CommerceQuest + + + +
+ +
+ +