Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solid: Some fixes for library and component generation. Fix for playground initialisation. #1164

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/solid/src/generators/component/component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('component schematic', () => {

const indexFile = tree.read(`${projectLibDirectory}/src/index.ts`);
expect(indexFile.toString('utf-8')).toMatch(
`export { default as ${name.className} } from './components/${name.fileName}/${name.className}.ts';`
`export { default as ${name.className} } from './components/${name.fileName}/${name.className}';`
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function addExportsToBarrel(tree: Tree, options: SolidComponentSchema) {

const { className, fileName } = names(options.name);
const indexFilePath = joinPathFragments(projectConfig.sourceRoot, 'index.ts');
const componentFile = `./components/${fileName}/${className}.ts`;
const componentFile = `./components/${fileName}/${className}`;

if (projectConfig.projectType === 'library') {
const { content, source } = readSourceFile(tree, indexFilePath);
Expand Down
3 changes: 1 addition & 2 deletions packages/solid/src/generators/library/lib/update-tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from '@nx/devkit';

export function updateTsConfig(tree: Tree, options: NormalizedSchema) {
const { libsDir } = getWorkspaceLayout(tree);

return updateJson(tree, 'tsconfig.base.json', (json) => {
const c = json.compilerOptions;
Expand All @@ -21,7 +20,7 @@ export function updateTsConfig(tree: Tree, options: NormalizedSchema) {
}

c.paths[options.importPath] = [
joinPathFragments(`${libsDir}/${options.projectDirectory}/src/index.ts`),
joinPathFragments(`${options.projectDirectory}/src/index.ts`),
];
return json;
});
Expand Down
2 changes: 1 addition & 1 deletion tools/scripts/create-playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const baseName = basename(tmpProjPath());

logger.info('Creating nx workspace...');
execSync(
`npx --yes create-nx-workspace@latest ${baseName} --preset empty --nxCloud skip --no-interactive`,
`npx --yes create-nx-workspace@latest ${baseName} --preset apps --nxCloud skip --no-interactive`,
{
cwd: localTmpDir,
stdio: 'inherit',
Expand Down