/** * The features this template ships that a copied project may delete: the * reference sample (README "Files you can delete after copying") and the * example screens (docs/architecture/starter-experience.md, CHANGELOG "먼저 * 할 일" 6). Each owns its folder under `src/features/` and `tests/features/` * and the context it is the only feature of. The reference sample also owns * files outside them, which `scripts/test-sample-removal.ts` deletes with it. * * This is the one list. The removal drill reads the reference sample's paths * and scripts from it, and the documentation check reads the whole of it: a * feature counts as deleted once its `feature-module.ts` is gone. */ export type RemovableTemplateFeature = Readonly<{ /** Its FEATURE_MODULE_ID, also its folder under src/features and tests/features. */ featureId: string; /** The bounded context it is the only feature of; it goes with the feature. */ contextDirectory: string; /** Files outside those folders that only this feature uses. */ extraPaths: readonly string[]; /** Package scripts that only this feature uses. */ scripts: readonly string[]; }>; export const REMOVABLE_TEMPLATE_FEATURES: readonly RemovableTemplateFeature[] = Object.freeze([ Object.freeze({ featureId: "reference-feature", contextDirectory: "src/contexts/reference-context", // 0929/10-02. The HTTP scenario catalog (tests/mocks) and the negative // type fixtures of the feature APIs run on the test contracts, so they // are platform checks and stay (commonTestPaths in the drill). extraPaths: Object.freeze([ "tests/component/product-feature-switch.test.tsx", "tests/e2e/reference-form.spec.ts", "tests/e2e/reference-route.spec.ts", "tests/e2e/reference-save.spec.ts", // 11-04: the growth measurement copies this sample feature. "tests/unit/feature-shape-growth.test.ts", "scripts/scale/measure-feature-shape-growth.ts", "config/scale/feature-shape-growth.json", "config/scale/feature-shape-ceilings.json", ]), scripts: Object.freeze(["test:reference-feature"]), }), // 1103/09-04. The example screens /examples/ui, /examples/states and // /examples/auth. The platform overview (/examples/platform) is a platform // route and is not part of it. Object.freeze({ featureId: "platform-examples-feature", contextDirectory: "src/contexts/platform-examples-context", extraPaths: Object.freeze([]), scripts: Object.freeze([]), }), ]); /** Every path removing `feature` deletes: its folders, its context and its extra files. */ export function removableTemplateFeaturePaths(feature: RemovableTemplateFeature): readonly string[] { return Object.freeze([ `src/features/${feature.featureId}`, `tests/features/${feature.featureId}`, feature.contextDirectory, ...feature.extraPaths, ]); }