@nx/remix 18.1.0-beta.6 → 18.1.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/remix",
3
- "version": "18.1.0-beta.6",
3
+ "version": "18.1.0-beta.7",
4
4
  "description": "The Remix plugin for Nx contains executors and generators for managing Remix applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, routes, loaders, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,12 +28,12 @@
28
28
  "migrations": "./migrations.json"
29
29
  },
30
30
  "dependencies": {
31
- "@nx/devkit": "18.1.0-beta.6",
32
- "@nx/js": "18.1.0-beta.6",
33
- "@nx/react": "18.1.0-beta.6",
31
+ "@nx/devkit": "18.1.0-beta.7",
32
+ "@nx/js": "18.1.0-beta.7",
33
+ "@nx/react": "18.1.0-beta.7",
34
34
  "tslib": "^2.3.1",
35
35
  "@phenomnomnominal/tsquery": "~5.0.1",
36
- "@nrwl/remix": "18.1.0-beta.6"
36
+ "@nrwl/remix": "18.1.0-beta.7"
37
37
  },
38
38
  "peerDependencies": {},
39
39
  "publishConfig": {
@@ -19,7 +19,7 @@ function addPlugin(tree) {
19
19
  plugin: '@nx/remix/plugin',
20
20
  options: {
21
21
  buildTargetName: 'build',
22
- serveTargetName: 'serve',
22
+ devTargetName: 'dev',
23
23
  startTargetName: 'start',
24
24
  typecheckTargetName: 'typecheck',
25
25
  },
@@ -8,30 +8,30 @@ exports[`@nx/remix/plugin non-root project should create nodes 1`] = `
8
8
  "targets": {
9
9
  "build": {
10
10
  "cache": true,
11
+ "command": "remix build",
11
12
  "dependsOn": [
12
13
  "^build",
13
14
  ],
14
- "executor": "@nx/remix:build",
15
15
  "inputs": [
16
16
  "production",
17
17
  "^production",
18
18
  ],
19
19
  "options": {
20
- "outputPath": "my-app",
20
+ "cwd": "my-app",
21
21
  },
22
22
  "outputs": [
23
23
  "{workspaceRoot}/my-app/build",
24
24
  "{workspaceRoot}/my-app/public/build",
25
25
  ],
26
26
  },
27
- "serve": {
28
- "executor": "@nx/remix:serve",
27
+ "dev": {
28
+ "command": "remix dev --manual",
29
29
  "options": {
30
- "command": "npx remix-serve build/index.js",
30
+ "cwd": "my-app",
31
31
  },
32
32
  },
33
33
  "start": {
34
- "command": "npx remix-serve build/index.js",
34
+ "command": "remix-serve build/index.js",
35
35
  "dependsOn": [
36
36
  "build",
37
37
  ],
@@ -64,30 +64,30 @@ exports[`@nx/remix/plugin root project should create nodes 1`] = `
64
64
  "targets": {
65
65
  "build": {
66
66
  "cache": true,
67
+ "command": "remix build",
67
68
  "dependsOn": [
68
69
  "^build",
69
70
  ],
70
- "executor": "@nx/remix:build",
71
71
  "inputs": [
72
72
  "production",
73
73
  "^production",
74
74
  ],
75
75
  "options": {
76
- "outputPath": ".",
76
+ "cwd": ".",
77
77
  },
78
78
  "outputs": [
79
79
  "{workspaceRoot}/build",
80
80
  "{workspaceRoot}/public/build",
81
81
  ],
82
82
  },
83
- "serve": {
84
- "executor": "@nx/remix:serve",
83
+ "dev": {
84
+ "command": "remix dev --manual",
85
85
  "options": {
86
- "command": "npx remix-serve build/index.js",
86
+ "cwd": ".",
87
87
  },
88
88
  },
89
89
  "start": {
90
- "command": "npx remix-serve build/index.js",
90
+ "command": "remix-serve build/index.js",
91
91
  "dependsOn": [
92
92
  "build",
93
93
  ],
@@ -2,7 +2,7 @@ import { type CreateDependencies, type CreateNodes } from '@nx/devkit';
2
2
  export declare const createDependencies: CreateDependencies;
3
3
  export interface RemixPluginOptions {
4
4
  buildTargetName?: string;
5
- serveTargetName?: string;
5
+ devTargetName?: string;
6
6
  startTargetName?: string;
7
7
  typecheckTargetName?: string;
8
8
  }
@@ -31,7 +31,9 @@ exports.createNodes = [
31
31
  // Do not create a project if package.json and project.json isn't there
32
32
  const siblingFiles = (0, fs_1.readdirSync)(fullyQualifiedProjectRoot);
33
33
  if (!siblingFiles.includes('package.json') &&
34
- !siblingFiles.includes('project.json')) {
34
+ !siblingFiles.includes('project.json') &&
35
+ !siblingFiles.includes('vite.config.ts') &&
36
+ !siblingFiles.includes('vite.config.js')) {
35
37
  return {};
36
38
  }
37
39
  options = normalizeOptions(options);
@@ -57,7 +59,7 @@ async function buildRemixTargets(configFilePath, projectRoot, options, context,
57
59
  const { buildDirectory, assetsBuildDirectory, serverBuildPath } = await getBuildPaths(configFilePath, context.workspaceRoot);
58
60
  const targets = {};
59
61
  targets[options.buildTargetName] = buildTarget(options.buildTargetName, projectRoot, buildDirectory, assetsBuildDirectory, namedInputs);
60
- targets[options.serveTargetName] = serveTarget(serverBuildPath);
62
+ targets[options.devTargetName] = devTarget(serverBuildPath, projectRoot);
61
63
  targets[options.startTargetName] = startTarget(projectRoot, serverBuildPath, options.buildTargetName);
62
64
  targets[options.typecheckTargetName] = typecheckTarget(projectRoot, namedInputs, siblingFiles);
63
65
  return targets;
@@ -78,24 +80,20 @@ function buildTarget(buildTargetName, projectRoot, buildDirectory, assetsBuildDi
78
80
  : ['default', '^default']),
79
81
  ],
80
82
  outputs: [serverBuildOutputPath, assetsBuildOutputPath],
81
- executor: '@nx/remix:build',
82
- options: {
83
- outputPath: projectRoot,
84
- },
83
+ command: 'remix build',
84
+ options: { cwd: projectRoot },
85
85
  };
86
86
  }
87
- function serveTarget(serverBuildPath) {
87
+ function devTarget(serverBuildPath, projectRoot) {
88
88
  return {
89
- executor: '@nx/remix:serve',
90
- options: {
91
- command: `npx remix-serve ${serverBuildPath}`,
92
- },
89
+ command: 'remix dev --manual',
90
+ options: { cwd: projectRoot },
93
91
  };
94
92
  }
95
93
  function startTarget(projectRoot, serverBuildPath, buildTargetName) {
96
94
  return {
97
95
  dependsOn: [buildTargetName],
98
- command: `npx remix-serve ${serverBuildPath}`,
96
+ command: `remix-serve ${serverBuildPath}`,
99
97
  options: {
100
98
  cwd: projectRoot,
101
99
  },
@@ -129,7 +127,7 @@ async function getBuildPaths(configFilePath, workspaceRoot) {
129
127
  function normalizeOptions(options) {
130
128
  options ??= {};
131
129
  options.buildTargetName ??= 'build';
132
- options.serveTargetName ??= 'serve';
130
+ options.devTargetName ??= 'dev';
133
131
  options.startTargetName ??= 'start';
134
132
  options.typecheckTargetName ??= 'typecheck';
135
133
  return options;