Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): migrate users/teams to Astro new content layer API #1169

Conversation

carlosallexandre
Copy link
Contributor

Changes Introduced

  1. Move eventcatalog/src/content/config.ts to eventcatalog/src/content.config.ts.
  2. Add glob loader to teams/users collections.
  3. Remove teams/users from the custom hydrate phase ( src/catalog-to-astro-content-directory.js)

Copy link

changeset-bot bot commented Feb 18, 2025

🦋 Changeset detected

Latest commit: f0e2ef1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eventcatalog/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@carlosallexandre carlosallexandre marked this pull request as draft February 18, 2025 13:07
@carlosallexandre carlosallexandre force-pushed the refactor/migrate-users-and-teams-to-new-astro-content-layer branch from 95541f1 to 44b816d Compare February 18, 2025 16:14
@carlosallexandre carlosallexandre marked this pull request as ready for review February 18, 2025 16:18
@carlosallexandre carlosallexandre marked this pull request as draft March 2, 2025 21:54
@carlosallexandre carlosallexandre marked this pull request as ready for review March 3, 2025 12:42
@boyney123
Copy link
Collaborator

Thanks @carlosallexandre let's give it ago!

I did notice this, when I run verify-build:catalog locally

09:39:13 [WARN] [glob-loader] No files found matching "users/*.md" in directory ""
09:39:13 [WARN] [glob-loader] No files found matching "teams/*.md" in directory ""

I'm wondering if its due to how this project is setup or not, going to merge and test on a proper catalog.

But maybe that is something we should look at too, if its effecting end users, as it may cause some confusion

@boyney123 boyney123 merged commit b5404ef into event-catalog:main Mar 4, 2025
4 checks passed
@boyney123
Copy link
Collaborator

Yeah seems like a local only issue, just tested lastest build and it was fine.

@carlosallexandre
Copy link
Contributor Author

It seems something that happens between the @astro/check for types...
I will investigate either and bring the root cause of that.

@carlosallexandre
Copy link
Contributor Author

@boyney123

As I suspected, adding the PROJECT_DIR env to the type check command remove the warning.

// scripts/build-ci.js

#!/usr/bin/env node

// This is used for CI on vercel. Must copy files before building.
import { join } from 'node:path';
import { execSync } from 'node:child_process';
const __dirname = import.meta.dirname;

const args = process.argv.slice(2);
const catalog = args[0] || 'default';

const catalogDir = join(__dirname, '../eventcatalog/');
const projectDIR = join(__dirname, `../examples/${catalog}`);

// Build cli
execSync('pnpm run build:bin', { stdio: 'inherit' });

// Run the generator
execSync(`cross-env NODE_ENV=CI PROJECT_DIR=${projectDIR} CATALOG_DIR=${catalogDir} npx . generate`, {
  stdio: 'inherit',
});

// Build catalog
execSync(`cross-env NODE_ENV=CI PROJECT_DIR=${projectDIR} CATALOG_DIR=${catalogDir} npx . build`, {
  stdio: 'inherit',
});

// Type check
execSync(`pnpm exec astro check --minimumSeverity error --root ${catalogDir}`, {
  stdio: 'inherit',
  env: {
    ...process.env,
    PROJECT_DIR: projectDIR,
    CATALOG_DIR: catalogDir,
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants