Files
nicktrn a9f756b260 chore: move reference projects to their own repo (#3812)
The reference/example projects (`references/`) now live in their own
repo, https://github.com/triggerdotdev/references, so their heavy,
frequently-changing dependencies are no longer part of this repo's
lockfile and tooling. This removes them here and repoints everything
that referenced them.

- Deletes `references/`; updates the pnpm workspace + lockfile.
- Clears the references-only CI rules and `.vscode` configs.
- Repoints the docs (contributor/agent + one public page) to the new
repo.
- `seed.mts` keeps the local-dev projects (hello-world, d3-chat,
realtime-streams).
2026-06-02 22:19:28 +01:00

103 lines
2.3 KiB
TypeScript

import { setDB } from "./utils";
const setup = async () => {
await setDB(async (prisma) => {
// Create test user
const user = await prisma.user.create({
data: {
email: "test-user@test.com",
name: "Test User",
authenticationMethod: "MAGIC_LINK",
confirmedBasicDetails: true,
},
});
// Create test organization
const organization = await prisma.organization.create({
data: {
title: "Test Organization",
slug: "test-org",
members: {
create: {
userId: user.id,
role: "ADMIN",
},
},
},
include: {
members: true,
},
});
// Create test project
const project = await prisma.project.create({
data: {
name: "Test Project",
slug: "test-project",
organization: {
connect: {
slug: organization.slug,
},
},
externalRef: "test-project-123",
},
include: {
organization: {
include: {
members: true,
},
},
},
});
// Create test environment
await prisma.runtimeEnvironment.create({
data: {
slug: "dev",
// Fixed e2e test API key
apiKey: "tr_dev_test-api-key",
pkApiKey: "tr_dev_pk_test-api-key",
autoEnableInternalSources: false,
organization: {
connect: {
id: organization.id,
},
},
project: {
connect: {
id: project.id,
},
},
orgMember: { connect: { id: project.organization.members[0].id } },
type: "DEVELOPMENT",
shortcode: "octopus-tentacles",
},
});
await prisma.runtimeEnvironment.create({
data: {
slug: "prod",
// Fixed e2e test API key
apiKey: "tr_prod_test-api-key",
pkApiKey: "tr_prod_pk_test-api-key",
autoEnableInternalSources: false,
organization: {
connect: {
id: organization.id,
},
},
project: {
connect: {
id: project.id,
},
},
orgMember: { connect: { id: project.organization.members[0].id } },
type: "PRODUCTION",
shortcode: "stripey-zebra",
},
});
});
};
export default setup;