mirror of
https://github.com/LukeHagar/sveltesociety.dev.git
synced 2025-12-06 12:47:44 +00:00
feat: Submitted data restructure (#533)
* Merge tools into components and resources * Rename components to packages * Format * Redirect with code 302 * Fix text on submitting page * Validate misc.json, format * Permanent redirects * Implement feedback for resources * Fix lint * Improve updateNpm.js types * Fix repo links
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { componentsSchema, templatesSchema, toolsSchema } from '../src/lib/schemas.js';
|
||||
import components from '../src/routes/components/components.json' assert { type: 'json' };
|
||||
import { packagesSchema, templatesSchema } from '../src/lib/schemas.js';
|
||||
import packages from '../src/routes/packages/packages.json' assert { type: 'json' };
|
||||
import templates from '../src/routes/templates/templates.json' assert { type: 'json' };
|
||||
import tools from '../src/routes/tools/tools.json' assert { type: 'json' };
|
||||
import { chunk } from './chunk.js';
|
||||
|
||||
const gitlabGraphQlUrl = 'https://gitlab.com/api/graphql';
|
||||
@@ -32,9 +31,8 @@ async function doGraphQlQuery(url, query) {
|
||||
|
||||
function getAllGitlabRepos() {
|
||||
const repos = [
|
||||
...componentsSchema.parse(components).map((component) => component.repository),
|
||||
...templatesSchema.parse(templates).map((template) => template.repository),
|
||||
...toolsSchema.parse(tools).map((tool) => tool.repository)
|
||||
...packagesSchema.parse(packages).map((i) => i.repository),
|
||||
...templatesSchema.parse(templates).map((i) => i.repository)
|
||||
];
|
||||
return repos.filter((url) => url && gitlabNameRegExp.test(url));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user