From 0f4ae15ceeff006318bba79cde7cc0b9baea56fb Mon Sep 17 00:00:00 2001 From: Wilson Pinto Date: Mon, 5 Jun 2023 23:52:43 +0200 Subject: [PATCH] fix(kit): temporarily inline `lodash.template` from `lodash-es` (#20892) --- packages/kit/build.config.ts | 3 +- packages/kit/package.json | 4 +-- packages/kit/src/internal/template.ts | 3 +- packages/schema/src/config/build.ts | 2 +- pnpm-lock.yaml | 42 ++++++--------------------- 5 files changed, 16 insertions(+), 38 deletions(-) diff --git a/packages/kit/build.config.ts b/packages/kit/build.config.ts index 700d94cd5b..a2f84767f8 100644 --- a/packages/kit/build.config.ts +++ b/packages/kit/build.config.ts @@ -11,5 +11,6 @@ export default defineBuildConfig({ 'webpack', 'vite', 'h3' - ] + ], + failOnWarn: false }) diff --git a/packages/kit/package.json b/packages/kit/package.json index 102b055cff..5ba7834812 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -29,7 +29,6 @@ "ignore": "^5.2.4", "jiti": "^1.18.2", "knitwork": "^1.0.0", - "lodash.template": "^4.5.0", "mlly": "^1.3.0", "pathe": "^1.1.1", "pkg-types": "^1.0.3", @@ -41,8 +40,9 @@ }, "devDependencies": { "@types/hash-sum": "1.0.0", - "@types/lodash.template": "4.5.1", + "@types/lodash-es": "^4.17.7", "@types/semver": "7.5.0", + "lodash-es": "^4.17.21", "nitropack": "2.4.1", "unbuild": "latest", "vite": "4.3.9", diff --git a/packages/kit/src/internal/template.ts b/packages/kit/src/internal/template.ts index af0a3506f8..00feb2bdae 100644 --- a/packages/kit/src/internal/template.ts +++ b/packages/kit/src/internal/template.ts @@ -1,5 +1,6 @@ import { promises as fsp } from 'node:fs' -import lodashTemplate from 'lodash.template' +// TODO: swap out when https://github.com/lodash/lodash/pull/5649 is merged +import { template as lodashTemplate } from 'lodash-es' import { genDynamicImport, genImport, genSafeVariableName } from 'knitwork' import type { NuxtTemplate } from '@nuxt/schema' diff --git a/packages/schema/src/config/build.ts b/packages/schema/src/config/build.ts index 219d58a9de..61ea83ce29 100644 --- a/packages/schema/src/config/build.ts +++ b/packages/schema/src/config/build.ts @@ -81,7 +81,7 @@ export default defineUntypedSchema({ * You can provide your own templates which will be rendered based * on Nuxt configuration. This feature is specially useful for using with modules. * - * Templates are rendered using [`lodash.template`](https://lodash.com/docs/4.17.15#template). + * Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template). * * @example * ```js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71391a3751..df5ce94986 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,9 +164,6 @@ importers: knitwork: specifier: ^1.0.0 version: 1.0.0 - lodash.template: - specifier: ^4.5.0 - version: 4.5.0 mlly: specifier: ^1.3.0 version: 1.3.0 @@ -195,12 +192,15 @@ importers: '@types/hash-sum': specifier: 1.0.0 version: 1.0.0 - '@types/lodash.template': - specifier: 4.5.1 - version: 4.5.1 + '@types/lodash-es': + specifier: ^4.17.7 + version: 4.17.7 '@types/semver': specifier: 7.5.0 version: 7.5.0 + lodash-es: + specifier: ^4.17.21 + version: 4.17.21 nitropack: specifier: 2.4.1 version: 2.4.1 @@ -2163,17 +2163,11 @@ packages: /@types/lodash-es@4.17.7: resolution: {integrity: sha512-z0ptr6UI10VlU6l5MYhGwS4mC8DZyYer2mCoyysZtSF7p26zOX8UpbrV0YpNYLGS8K4PUFIyEr62IMFFjveSiQ==} dependencies: - '@types/lodash': 4.14.191 + '@types/lodash': 4.14.194 dev: true - /@types/lodash.template@4.5.1: - resolution: {integrity: sha512-0y71S2dGgmwdkSsyW95JBp8HSZchgKCsjr6F0lsT3eSMtaT3Nn9rcMHU1U4UKu6XjQT3YC6/PNwgFI7k9f+ltw==} - dependencies: - '@types/lodash': 4.14.191 - dev: true - - /@types/lodash@4.14.191: - resolution: {integrity: sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==} + /@types/lodash@4.14.194: + resolution: {integrity: sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==} dev: true /@types/mri@1.1.1: @@ -5796,11 +5790,6 @@ packages: /lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} - dev: false - - /lodash._reinterpolate@3.0.0: - resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==} - dev: false /lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} @@ -5832,19 +5821,6 @@ packages: resolution: {integrity: sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==} dev: false - /lodash.template@4.5.0: - resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==} - dependencies: - lodash._reinterpolate: 3.0.0 - lodash.templatesettings: 4.2.0 - dev: false - - /lodash.templatesettings@4.2.0: - resolution: {integrity: sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==} - dependencies: - lodash._reinterpolate: 3.0.0 - dev: false - /lodash.union@4.6.0: resolution: {integrity: sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==}