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

[DO NOT MERGE] Highlight CI issue #359

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@nx/workspace": "17.0.1",
"@nx/storybook": "17.0.1",
"@phenomnomnominal/tsquery": "^5.0.1",
"@remix-run/dev": "1.15.0",
"@remix-run/node": "1.15.0",
"@remix-run/dev": "2.3.0",
"@remix-run/node": "2.3.0",
"@rspack/core": "^0.1.12",
"@rspack/dev-server": "^0.1.12",
"@rspack/less-loader": "^0.0.22",
Expand Down
12 changes: 0 additions & 12 deletions packages/remix/executors.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,5 @@
"schema": "./src/executors/build/schema.json",
"description": "Build a Remix application."
}
},
"builders": {
"serve": {
"implementation": "./src/executors/serve/compat",
"schema": "./src/executors/serve/schema.json",
"description": "Serve a Remix application."
},
"build": {
"implementation": "./src/executors/build/build.impl",
"schema": "./src/executors/build/schema.json",
"description": "Build a Remix application."
}
}
}
49 changes: 49 additions & 0 deletions packages/remix/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,55 @@
"alwaysAddToPackageJson": true
}
}
},
"17.1.0": {
"version": "17.1.0",
"packages": {
"@remix-run/node": {
"version": "^2.3.0",
"alwaysAddToPackageJson": true
},
"@remix-run/react": {
"version": "^2.3.0",
"alwaysAddToPackageJson": true
},
"@remix-run/serve": {
"version": "^2.3.0",
"alwaysAddToPackageJson": true
},
"@remix-run/dev": {
"version": "^2.3.0",
"alwaysAddToPackageJson": true
},
"@remix-run/css-bundle": {
"version": "^2.3.0",
"alwaysAddToPackageJson": true
},
"@remix-run/eslint-config": {
"version": "^2.3.0",
"alwaysAddToPackageJson": true
},
"isbot": {
"version": "^3.6.8",
"alwaysAddToPackageJson": true
},
"eslint": {
"version": "^8.38.0",
"alwaysAddToPackageJson": true
},
"@testing-library/react": {
"version": "^14.1.2",
"alwaysAddToPackageJson": false
},
"@testing-library/jest-dom": {
"version": "^6.1.4",
"alwaysAddToPackageJson": false
},
"@testing-library/user-event": {
"version": "^14.5.1",
"alwaysAddToPackageJson": false
}
}
}
}
}
5 changes: 0 additions & 5 deletions packages/remix/src/executors/build/compat.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/remix/src/executors/serve/compat.ts

This file was deleted.

8 changes: 4 additions & 4 deletions packages/remix/src/generators/action/action.impl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ describe('action', () => {
const content = tree.read('apps/demo/app/routes/example.tsx', 'utf-8');
expect(content).toMatch(`import { json } from '@remix-run/node';`);
expect(content).toMatch(
`import type { ActionArgs } from '@remix-run/node';`
`import type { ActionFunctionArgs } from '@remix-run/node';`
);
expect(content).toMatch(
`import { useActionData } from '@remix-run/react';`
);
});

it('should add action function', () => {
const actionFunction = `export const action = async ({ request }: ActionArgs)`;
const actionFunction = `export const action = async ({ request }: ActionFunctionArgs)`;
const content = tree.read('apps/demo/app/routes/example.tsx', 'utf-8');
expect(content).toMatch(actionFunction);
});
Expand All @@ -76,10 +76,10 @@ describe('action', () => {
// ASSERT
const content = tree.read('apps/demo/app/routes/example.tsx', 'utf-8');
const useActionData = `const actionMessage = useActionData<typeof action>();`;
const actionFunction = `export const action = async ({ request }: ActionArgs)`;
const actionFunction = `export const action = async ({ request }: ActionFunctionArgs)`;
expect(content).toMatch(`import { json } from '@remix-run/node';`);
expect(content).toMatch(
`import type { ActionArgs } from '@remix-run/node';`
`import type { ActionFunctionArgs } from '@remix-run/node';`
);
expect(content).toMatch(
`import { useActionData } from '@remix-run/react';`
Expand Down
6 changes: 3 additions & 3 deletions packages/remix/src/generators/action/action.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export default async function (tree: Tree, schema: LoaderSchema) {
const routeFilePath =
schema.nameAndDirectoryFormat === 'as-provided'
? schema.path
: resolveRemixRouteFile(tree, schema.path, schema.project);
: await resolveRemixRouteFile(tree, schema.path, schema.project);

if (!tree.exists(routeFilePath)) {
throw new Error(
`Route path does not exist: ${routeFilePath}. Please generate a Remix route first.`
);
}

insertImport(tree, routeFilePath, 'ActionArgs', '@remix-run/node', {
insertImport(tree, routeFilePath, 'ActionFunctionArgs', '@remix-run/node', {
typeOnly: true,
});
insertImport(tree, routeFilePath, 'json', '@remix-run/node');
Expand All @@ -27,7 +27,7 @@ export default async function (tree: Tree, schema: LoaderSchema) {
tree,
routeFilePath,
`
export const action = async ({ request }: ActionArgs) => {
export const action = async ({ request }: ActionFunctionArgs) => {
let formData = await request.formData();

return json({message: formData.toString()}, { status: 200 });
Expand Down
Loading
Loading