From 5055aa8bdb333c8b2521fb806de6deb29834fc17 Mon Sep 17 00:00:00 2001 From: Karol Rzotki Date: Sun, 17 Nov 2024 16:13:20 +0100 Subject: [PATCH] fix(lint): Readd npmScope to import paths --- .../gene-tools/src/generators/library-generator/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/gene-tools/src/generators/library-generator/index.ts b/packages/gene-tools/src/generators/library-generator/index.ts index baf3a56..08a6b45 100644 --- a/packages/gene-tools/src/generators/library-generator/index.ts +++ b/packages/gene-tools/src/generators/library-generator/index.ts @@ -10,11 +10,15 @@ import { import { Linter } from '@nx/linter'; import { libraryGenerator } from '@nx/react'; import { GeneLibraryGenerator } from './schema'; -import { updateJestConfig } from '../utilities'; +import { getNpmScope, updateJestConfig } from '../utilities'; import { relative } from 'path'; export default async function (tree: Tree, schema: GeneLibraryGenerator) { const currentPackageJson = readJson(tree, 'package.json'); + const npmScope = getNpmScope(tree); + + const directory = schema.directory ? `${schema.directory}/` : ''; + await libraryGenerator(tree, { name: schema.name, directory: schema.directory, @@ -25,6 +29,7 @@ export default async function (tree: Tree, schema: GeneLibraryGenerator) { style: 'scss', compiler: 'babel', unitTestRunner: 'jest', + importPath: `@${npmScope}/${directory}${schema.name}`, }); const pathToProject = `libs/${schema.directory || ''}/${schema.name}`;