精简后的项目:仅保留 api/ui 源码、文档、构建依赖

This commit is contained in:
gallery
2026-09-11 16:11:09 +08:00
commit 490e85634e
457 changed files with 86862 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
// apollo.config.js
const { readdirSync, readFileSync, writeFileSync, mkdirSync } = require('node:fs');
const path = require('node:path');
const schemasFolder = path.join(__dirname, '..', 'api', 'graphql', 'resolvers');
let completeSchema;
try {
completeSchema = readdirSync(schemasFolder)
.filter(x => x.endsWith('.graphql'))
.map(x => {
const filePath = path.join(schemasFolder, x);
return readFileSync(filePath, 'utf-8');
})
.join('\n\n');
} catch (error) {
console.error('Failed to generate schema:', error);
process.exit(1);
}
const outputPath = path.join(__dirname, '.cache', 'schema.graphql');
try {
mkdirSync(path.dirname(outputPath), { recursive: true });
writeFileSync(outputPath, completeSchema, { mode: 0o644 });
} catch (error) {
console.error('Failed to write schema file:', error);
process.exit(1);
}
module.exports = {
client: {
service: {
name: 'photoview',
localSchemaFile: outputPath,
},
},
}