Scenario generator for vore roleplay and story ideas.
https://scenario-generator.deliciousreya.net/responses
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.5 KiB
31 lines
1.5 KiB
import { DEFAULT_IN_PATH, DEFAULT_OUT_PATH, getBundle, writeBundle } from './bundler';
|
|
import { getSourceMapFileName, SourceMapExtension, SourceMaps } from '../server/web/bundles/sourcemaps';
|
|
import deepEqual from 'fast-deep-equal';
|
|
|
|
async function main(inPath: string = DEFAULT_IN_PATH, outPath: string = DEFAULT_OUT_PATH) {
|
|
const bundle = await getBundle(inPath)
|
|
const errors: string[] = []
|
|
for (const [name, {hash, sourceMap}] of bundle.css) {
|
|
const filename = getSourceMapFileName(name, hash, SourceMapExtension.CSS)
|
|
const existingMap = SourceMaps.get(filename)
|
|
if (!existingMap) {
|
|
errors.push(`source map for ${filename} is missing; add this line to server/web/bundles/sourcemaps.ts:\n\t\t${JSON.stringify([filename, sourceMap])},\n\n`)
|
|
} else if (!deepEqual(sourceMap, existingMap)) {
|
|
errors.push(`source map for ${filename} is incorrect; replace this line in server/web/bundles/sourcemaps.ts:\n\t\t${JSON.stringify([filename, existingMap])},\n\nwith this line:\n\t\t${JSON.stringify([filename, sourceMap])},\n\n`)
|
|
}
|
|
}
|
|
if (errors.length > 0) {
|
|
throw Error(errors.join('\n'))
|
|
}
|
|
await writeBundle(bundle, outPath, false)
|
|
}
|
|
|
|
main(...process.argv.slice(2)).then(() => {
|
|
console.info('generated client helpers and confirmed sourcemaps are present');
|
|
}).catch((err) => {
|
|
console.error('could not generate client helpers or confirm sourcemaps are present');
|
|
console.error(err && 'stack' in err ? err.stack : err);
|
|
throw err;
|
|
}).catch(() => {
|
|
process.exit(1);
|
|
});
|
|
|