Skip to content

Commit

Permalink
fix(stencil): init js libs when creating stencil lib
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-twardziak authored and DominikPieper committed Oct 16, 2024
1 parent 50cc9cf commit f476ef8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/stencil/src/generators/library/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
ensureProjectName,
} from '@nx/devkit/src/generators/project-name-and-root-utils';
import { assertNotUsingTsSolutionSetup } from '@nx/js/src/utils/typescript/ts-solution-setup';
import { initGenerator as jsInitGenerator } from '@nx/js';

async function normalizeOptions(
host: Tree,
Expand Down Expand Up @@ -91,6 +92,13 @@ export async function libraryGenerator(host: Tree, schema: RawLibrarySchema) {
`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`
);
}

const jsInitTask = await jsInitGenerator(host, {
...options,
tsConfigName: 'tsconfig.base.json',
skipFormat: true,
});

const initTask = await initGenerator(host, options);

addProject(host, options);
Expand All @@ -109,7 +117,7 @@ export async function libraryGenerator(host: Tree, schema: RawLibrarySchema) {
await formatFiles(host);
}

return runTasksInSerial(initTask);
return runTasksInSerial(jsInitTask, initTask);
}

export default libraryGenerator;

0 comments on commit f476ef8

Please sign in to comment.