@nx/remix 0.0.0-pr-29314-e664f92 → 0.0.0-pr-29286-735af1e

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2024 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2025 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/remix",
3
- "version": "0.0.0-pr-29314-e664f92",
3
+ "version": "0.0.0-pr-29286-735af1e",
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, Playwright, 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",
@@ -29,9 +29,9 @@
29
29
  "migrations": "./migrations.json"
30
30
  },
31
31
  "dependencies": {
32
- "@nx/devkit": "0.0.0-pr-29314-e664f92",
33
- "@nx/js": "0.0.0-pr-29314-e664f92",
34
- "@nx/react": "0.0.0-pr-29314-e664f92",
32
+ "@nx/devkit": "0.0.0-pr-29286-735af1e",
33
+ "@nx/js": "0.0.0-pr-29286-735af1e",
34
+ "@nx/react": "0.0.0-pr-29286-735af1e",
35
35
  "tslib": "^2.3.1",
36
36
  "@phenomnomnominal/tsquery": "~5.0.1"
37
37
  },
@@ -134,7 +134,6 @@ export default function Index() {
134
134
 
135
135
  exports[`Remix Application Integrated Repo --e2eTestRunner should generate a cypress e2e application for the app 1`] = `
136
136
  "import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
137
-
138
137
  import { defineConfig } from 'cypress';
139
138
 
140
139
  export default defineConfig({
@@ -386,7 +385,6 @@ export default function Index() {
386
385
 
387
386
  exports[`Remix Application Standalone Project Repo --e2eTestRunner should generate a cypress e2e application for the app 1`] = `
388
387
  "import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
389
-
390
388
  import { defineConfig } from 'cypress';
391
389
 
392
390
  export default defineConfig({
@@ -6,7 +6,6 @@ const devkit_1 = require("@nx/devkit");
6
6
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
7
7
  const js_1 = require("@nx/js");
8
8
  const create_ts_config_1 = require("@nx/js/src/utils/typescript/create-ts-config");
9
- const node_path_1 = require("node:path");
10
9
  const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
11
10
  const testing_config_utils_1 = require("../../utils/testing-config-utils");
12
11
  const versions_1 = require("../../utils/versions");
@@ -188,36 +187,6 @@ export default {...nxPreset};
188
187
  }
189
188
  }
190
189
  tasks.push(await (0, lib_1.addE2E)(tree, options));
191
- // If the project package.json uses type module, and the project uses flat eslint config, we need to make sure the eslint config uses an explicit .cjs extension
192
- // TODO: This could be re-evaluated once we support ESM in eslint configs
193
- if (tree.exists((0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json')) &&
194
- tree.exists((0, devkit_1.joinPathFragments)(options.projectRoot, 'eslint.config.js'))) {
195
- const pkgJson = (0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'));
196
- if (pkgJson.type === 'module') {
197
- tree.rename((0, devkit_1.joinPathFragments)(options.projectRoot, 'eslint.config.js'), (0, devkit_1.joinPathFragments)(options.projectRoot, 'eslint.config.cjs'));
198
- (0, devkit_1.visitNotIgnoredFiles)(tree, options.projectRoot, (file) => {
199
- if (file.endsWith('eslint.config.js')) {
200
- // Replace any extends on the eslint config to use the .cjs extension
201
- const content = tree.read(file).toString();
202
- if (content.includes('eslint.config')) {
203
- tree.write(file, content
204
- .replace(/eslint\.config'/g, `eslint.config.cjs'`)
205
- .replace(/eslint\.config"/g, `eslint.config.cjs"`)
206
- .replace(/eslint\.config\.js/g, `eslint.config.cjs`));
207
- }
208
- // If there is no sibling package.json with type commonjs, we need to rename the .js files to .cjs
209
- const siblingPackageJsonPath = (0, devkit_1.joinPathFragments)((0, node_path_1.dirname)(file), 'package.json');
210
- if (tree.exists(siblingPackageJsonPath)) {
211
- const siblingPkgJson = (0, devkit_1.readJson)(tree, siblingPackageJsonPath);
212
- if (siblingPkgJson.type === 'module') {
213
- return;
214
- }
215
- }
216
- tree.rename(file, file.replace('.js', '.cjs'));
217
- }
218
- });
219
- }
220
- }
221
190
  (0, lib_1.addViteTempFilesToGitIgnore)(tree);
222
191
  if (!options.skipFormat) {
223
192
  await (0, devkit_1.formatFiles)(tree);
@@ -229,6 +198,11 @@ export default {...nxPreset};
229
198
  }, options.linter === 'eslint'
230
199
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
231
200
  : undefined, '.');
201
+ // If we are using the new TS solution
202
+ // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
203
+ if (options.useTsSolution) {
204
+ (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
205
+ }
232
206
  tasks.push(() => {
233
207
  (0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
234
208
  });
@@ -3,5 +3,6 @@ import type { NxRemixGeneratorSchema } from '../schema';
3
3
  export interface RemixLibraryOptions extends NxRemixGeneratorSchema {
4
4
  projectName: string;
5
5
  projectRoot: string;
6
+ isUsingTsSolutionConfig: boolean;
6
7
  }
7
8
  export declare function normalizeOptions(tree: Tree, options: NxRemixGeneratorSchema): Promise<RemixLibraryOptions>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
6
7
  async function normalizeOptions(tree, options) {
7
8
  await (0, project_name_and_root_utils_1.ensureProjectName)(tree, options, 'application');
8
9
  const { projectName, projectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
@@ -19,5 +20,6 @@ async function normalizeOptions(tree, options) {
19
20
  unitTestRunner: options.unitTestRunner ?? 'vitest',
20
21
  projectName,
21
22
  projectRoot,
23
+ isUsingTsSolutionConfig: (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree),
22
24
  };
23
25
  }
@@ -49,6 +49,9 @@ async function remixLibraryGeneratorInternal(tree, schema) {
49
49
  }, options.linter === 'eslint'
50
50
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
51
51
  : undefined);
52
+ if (options.isUsingTsSolutionConfig) {
53
+ (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
54
+ }
52
55
  if (!options.skipFormat) {
53
56
  await (0, devkit_1.formatFiles)(tree);
54
57
  }