Skip to content

Commit

Permalink
fix(remix): update app generator with valid package.json without Pret…
Browse files Browse the repository at this point in the history
…tier
  • Loading branch information
jaysoo committed Dec 5, 2024
1 parent b848bb3 commit c57e724
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
22 changes: 20 additions & 2 deletions packages/remix/src/generators/application/application.impl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ describe('Remix Application', () => {
});

describe('TS solution setup', () => {
it('should add project references when using TS solution', async () => {
const tree = createTreeWithEmptyWorkspace();
let tree: Tree;

beforeEach(() => {
tree = createTreeWithEmptyWorkspace();
updateJson(tree, 'package.json', (json) => {
json.workspaces = ['packages/*', 'apps/*'];
return json;
Expand All @@ -333,7 +335,9 @@ describe('Remix Application', () => {
files: [],
references: [],
});
});

it('should add project references when using TS solution', async () => {
await applicationGenerator(tree, {
directory: 'myapp',
e2eTestRunner: 'playwright',
Expand Down Expand Up @@ -523,6 +527,20 @@ describe('Remix Application', () => {
}
`);
});

it('should generate valid package.json without formatting', async () => {
await applicationGenerator(tree, {
directory: 'myapp',
e2eTestRunner: 'playwright',
unitTestRunner: 'jest',
addPlugin: true,
skipFormat: true,
});

expect(() =>
JSON.parse(tree.read('myapp/package.json', 'utf-8'))
).not.toThrow();
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"nx": {
<%_ if (name !== projectName) { _%>
"name": "<%= name %>",<%_ } _%>
"projectType": "application",
"sourceRoot": "<%- projectRoot %>",
<%_ if (parsedTags?.length) { _%>
"sourceRoot": "<%- projectRoot %>"<%_ if (parsedTags?.length) { _%>,
"tags": <%- JSON.stringify(parsedTags) %>
<%_ } _%>
}<% } %>
Expand Down

0 comments on commit c57e724

Please sign in to comment.