Skip to content

Commit edab7a6

Browse files
authored
chore(deps): remove lodash from create-tauri-app (#1532)
1 parent 098b729 commit edab7a6

3 files changed

Lines changed: 10 additions & 19 deletions

File tree

.changes/cta-remove-lodash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-tauri-app": patch
3+
---
4+
5+
Remove `lodash` dependency and replace with es6 builtins

tooling/create-tauri-app/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"dependencies": {
3030
"execa": "^5.0.0",
3131
"inquirer": "^8.0.0",
32-
"lodash": "4.17.21",
3332
"minimist": "^1.2.5",
3433
"scaffe": "1.0.0"
3534
},
@@ -39,7 +38,6 @@
3938
"@rollup/plugin-typescript": "^8.2.1",
4039
"@types/cross-spawn": "6.0.2",
4140
"@types/inquirer": "7.3.1",
42-
"@types/lodash": "4.14.168",
4341
"@types/semver": "7.3.4",
4442
"prettier": "^2.2.1",
4543
"rollup": "^2.45.1",

tooling/create-tauri-app/src/index.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// SPDX-License-Identifier: MIT
44

5-
import { map, find } from "lodash";
65
import { TauriBuildConfig } from "./types/config";
76
import { reactjs, reactts } from "./recipes/react";
87
import { vuecli } from "./recipes/vue-cli";
@@ -47,23 +46,12 @@ export interface Recipe {
4746

4847
export const allRecipes: Recipe[] = [vanillajs, reactjs, reactts, vite, vuecli];
4948

50-
export const recipeNames: Array<[string, string]> = map(
51-
allRecipes,
52-
(r: Recipe) => [r.shortName, r.descriptiveName]
53-
);
49+
export const recipeNames: Array<[string, string]> = allRecipes.map(r => [r.shortName, r.descriptiveName]);
5450

55-
export const recipeByShortName = (name: string): Recipe | undefined =>
56-
find(allRecipes, (r: Recipe) => r.shortName === name);
51+
export const recipeByShortName = (name: string) => allRecipes.find(r => r.shortName === name);
5752

58-
export const recipeByDescriptiveName = (name: string): Recipe | undefined =>
59-
find(allRecipes, (r: Recipe) => r.descriptiveName === name);
53+
export const recipeByDescriptiveName = (name: string) => allRecipes.find(r => r.descriptiveName === name);
6054

61-
export const recipeShortNames: string[] = map(
62-
allRecipes,
63-
(r: Recipe) => r.shortName
64-
);
55+
export const recipeShortNames = allRecipes.map(r => r.shortName);
6556

66-
export const recipeDescriptiveNames: string[] = map(
67-
allRecipes,
68-
(r: Recipe) => r.descriptiveName
69-
);
57+
export const recipeDescriptiveNames = allRecipes.map(r => r.descriptiveName);

0 commit comments

Comments
 (0)