Much simpler project structure

This commit is contained in:
Jake Archibald
2020-11-09 10:54:35 +00:00
parent 4da1887826
commit 5a027c7727
44 changed files with 47 additions and 331 deletions

View File

@@ -59,23 +59,7 @@ export default function () {
.flat(Infinity)
.join('\n');
const workerTsConfig = {
extends: '../../generic-tsconfig.json',
compilerOptions: {
lib: ['webworker', 'esnext'],
},
references: featuresWorkerTsNames.map(([tsImport]) => ({
path: path.dirname(tsImport),
})),
};
await Promise.all([
fsp.writeFile(
path.join(workerBasePath, 'tsconfig.json'),
autoGenComment + JSON.stringify(workerTsConfig, null, ' '),
),
fsp.writeFile(path.join(workerBasePath, 'index.ts'), workerFile),
]);
await fsp.writeFile(path.join(workerBasePath, 'index.ts'), workerFile);
}
/**
@@ -171,7 +155,6 @@ export default function () {
'lazy-app',
'feature-meta',
);
const clientBasePath = path.join(process.cwd(), 'src', 'client');
const joinedMetas = metas.flat().join();
@@ -194,13 +177,6 @@ export default function () {
const preprocessorMetaTsNames = preprocessorMetas.map((tsImport) =>
getTsName(tsImport),
);
const tsConfigEncoderPaths = encoderMetas.flatMap((tsImport) => [
path.relative(clientBasePath, tsImport.replace(/\/meta$/, '')),
path.relative(
clientBasePath,
tsImport.replace(/shared\/meta$/, 'client'),
),
]);
const featureMeta = [
autoGenComment,
@@ -267,29 +243,10 @@ export default function () {
.flat(Infinity)
.join('\n');
const lazyTsConfig = {
extends: '../../generic-tsconfig.json',
compilerOptions: {
lib: ['esnext', 'dom', 'dom.iterable'],
types: [],
},
references: [
{ path: '../features-worker' },
{ path: '../shared' },
{ path: '../features/processors/resize/client' },
...tsConfigEncoderPaths.map((projectPath) => ({
path: projectPath,
})),
],
};
await Promise.all([
fsp.writeFile(
path.join(process.cwd(), 'src', 'client', 'tsconfig.json'),
autoGenComment + JSON.stringify(lazyTsConfig, null, ' '),
),
fsp.writeFile(path.join(featureMetaBasePath, 'index.ts'), featureMeta),
]);
await fsp.writeFile(
path.join(featureMetaBasePath, 'index.ts'),
featureMeta,
);
}
return {