Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed May 8, 2024
2 parents 2816fb3 + 4cc3dc6 commit a0fa37d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 28 deletions.
2 changes: 0 additions & 2 deletions packages/create-nx-workspace/src/create-empty-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
getPackageManagerVersion,
PackageManager,
} from './utils/package-manager';
import { getFileName } from './utils/string-utils';
import { unparse } from './utils/unparse';

/**
Expand All @@ -32,7 +31,6 @@ export async function createEmptyWorkspace<T extends CreateWorkspaceOptions>(
options.packageManager = packageManager;
}

options.name = getFileName(name);
const directory = options.name;

const args = unparse({
Expand Down
11 changes: 0 additions & 11 deletions packages/create-nx-workspace/src/utils/string-utils.spec.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/create-nx-workspace/src/utils/string-utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
export function stringifyCollection(items: string[]): string {
return items.map((item) => `"${item}"`).join(', ');
}

export function getFileName(name: string) {
return name
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
.toLowerCase()
.replace(/[ _]/g, '-');
}
2 changes: 0 additions & 2 deletions packages/workspace/src/generators/new/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
getPackageManagerCommand,
installPackagesTask,
joinPathFragments,
names,
PackageManager,
Tree,
} from '@nx/devkit';
Expand Down Expand Up @@ -131,7 +130,6 @@ function normalizeOptions(options: Schema): NormalizedSchema {
...options,
};

normalized.name = names(options.name).fileName;
if (!options.directory) {
normalized.directory = normalized.name;
}
Expand Down
6 changes: 0 additions & 6 deletions packages/workspace/src/generators/preset/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Preset } from '../utils/presets';
import { join } from 'path';

export async function presetGenerator(tree: Tree, options: Schema) {
options = normalizeOptions(options);
const presetTask = await createPreset(tree, options);
return async () => {
installPackagesTask(tree);
Expand Down Expand Up @@ -314,8 +313,3 @@ async function createPreset(tree: Tree, options: Schema) {
throw new Error(`Invalid preset ${options.preset}`);
}
}

function normalizeOptions(options: Schema): Schema {
options.name = names(options.name).fileName;
return options;
}

0 comments on commit a0fa37d

Please sign in to comment.