Skip to content

Commit

Permalink
Remove incorrectly committed full-in-package-dist distFilenameStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Jul 28, 2022
1 parent eaa2fcc commit 0c79455
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 2 additions & 6 deletions packages/cli/src/package.ts
Expand Up @@ -309,15 +309,11 @@ export class Package extends Item<{
get distFilenameStrategy(): DistFilenameStrategy {
if ("distFilenameStrategy" in this.project.json.preconstruct) {
const written = this.project.json.preconstruct.distFilenameStrategy;
if (
written !== "full" &&
written !== "unscoped-package-name" &&
written !== "full-in-package-dist"
) {
if (written !== "full" && written !== "unscoped-package-name") {
throw new FatalError(
`distFilenameStrategy is defined in your Preconstruct config as ${JSON.stringify(
written
)} but the only accepted values are "full", "full-in-package-dist" and "unscoped-package-name"`,
)} but the only accepted values are "full" and "unscoped-package-name"`,
this.project.name
);
}
Expand Down
7 changes: 2 additions & 5 deletions packages/cli/src/utils.ts
Expand Up @@ -60,10 +60,7 @@ export function getEntrypointName(pkg: Package, entrypointDir: string) {
);
}

export type DistFilenameStrategy =
| "full"
| "full-in-package-dist"
| "unscoped-package-name";
export type DistFilenameStrategy = "full" | "unscoped-package-name";

export type MinimalEntrypoint = {
package: Package;
Expand All @@ -73,7 +70,7 @@ export type MinimalEntrypoint = {

export function getBaseDistName(entrypoint: MinimalEntrypoint) {
const strategy = entrypoint.package.distFilenameStrategy;
if (strategy === "full" || strategy === "full-in-package-dist") {
if (strategy === "full") {
return entrypoint.name.replace("@", "").replace(/\//g, "-");
}
return entrypoint.package.name.replace(/.*\//, "");
Expand Down

0 comments on commit 0c79455

Please sign in to comment.