@nx/remix 21.1.2 → 21.1.3

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart Monorepos · Fast CI"></p>
1
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart Repos · Fast Builds"></p>
2
2
 
3
3
  <div style="text-align: center;">
4
4
 
@@ -15,9 +15,9 @@
15
15
 
16
16
  <hr>
17
17
 
18
- # Nx: Smart Monorepos · Fast CI
18
+ # Nx: Smart Repos · Fast Builds
19
19
 
20
- Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
20
+ An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
21
21
 
22
22
  This package is a [Remix plugin for Nx](https://nx.dev/nx-api/remix).
23
23
 
@@ -59,5 +59,5 @@ npx nx@latest init
59
59
  - [Blog Posts About Nx](https://nx.dev/blog)
60
60
 
61
61
  <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
62
- width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
62
+ width="100%" alt="Nx - Smart Repos · Fast Builds"></a></p>
63
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/remix",
3
- "version": "21.1.2",
3
+ "version": "21.1.3",
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": "21.1.2",
33
- "@nx/js": "21.1.2",
34
- "@nx/react": "21.1.2",
32
+ "@nx/devkit": "21.1.3",
33
+ "@nx/js": "21.1.3",
34
+ "@nx/react": "21.1.3",
35
35
  "tslib": "^2.3.1",
36
36
  "@phenomnomnominal/tsquery": "~5.0.1"
37
37
  },
@@ -43,7 +43,7 @@ exports[`setup-tailwind generator should add a tailwind config to an application
43
43
  ScrollRestoration,
44
44
  } from '@remix-run/react';
45
45
  import type { MetaFunction, LinksFunction } from '@remix-run/node';
46
- import twStyles from './tailwind.css';
46
+ import './tailwind.css';
47
47
 
48
48
  export const meta: MetaFunction = () => [
49
49
  {
@@ -52,7 +52,6 @@ export const meta: MetaFunction = () => [
52
52
  ];
53
53
 
54
54
  export const links: LinksFunction = () => [
55
- { rel: 'stylesheet', href: twStyles },
56
55
  { rel: 'preconnect', href: 'https://fonts.googleapis.com' },
57
56
  {
58
57
  rel: 'preconnect',
@@ -17,8 +17,7 @@
17
17
  "$default": {
18
18
  "$source": "projectName"
19
19
  },
20
- "x-prompt": "What project would you like to add Tailwind to?",
21
- "pattern": "^[a-zA-Z].*$"
20
+ "x-prompt": "What project would you like to add Tailwind to?"
22
21
  },
23
22
  "skipFormat": {
24
23
  "type": "boolean",
@@ -2,18 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = setupTailwind;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const upsert_links_function_1 = require("../../utils/upsert-links-function");
6
5
  const versions_1 = require("../../utils/versions");
6
+ const insert_statement_after_imports_1 = require("../../utils/insert-statement-after-imports");
7
7
  async function setupTailwind(tree, options) {
8
8
  const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
9
- if (project.projectType !== 'application') {
10
- throw new Error(`Project "${options.project}" is not an application. Please ensure the project is an application.`);
11
- }
12
9
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), project.root, {
13
10
  tpl: '',
14
11
  });
15
12
  const pathToRoot = (0, devkit_1.joinPathFragments)(project.root, 'app/root.tsx');
16
- (0, upsert_links_function_1.upsertLinksFunction)(tree, pathToRoot, 'twStyles', './tailwind.css', `{ rel: "stylesheet", href: twStyles }`);
13
+ (0, insert_statement_after_imports_1.insertStatementAfterImports)(tree, pathToRoot, (0, devkit_1.stripIndents) `import './tailwind.css';`);
17
14
  (0, devkit_1.addDependenciesToPackageJson)(tree, {
18
15
  tailwindcss: versions_1.tailwindVersion,
19
16
  postcss: versions_1.postcssVersion,
@@ -1,2 +0,0 @@
1
- import { type Tree } from '@nx/devkit';
2
- export declare function upsertLinksFunction(tree: Tree, filePath: string, importName: string, importPath: string, linkObject: string): void;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.upsertLinksFunction = upsertLinksFunction;
4
- const devkit_1 = require("@nx/devkit");
5
- const tsquery_1 = require("@phenomnomnominal/tsquery");
6
- const insert_import_1 = require("./insert-import");
7
- const insert_statement_after_imports_1 = require("./insert-statement-after-imports");
8
- function upsertLinksFunction(tree, filePath, importName, importPath, linkObject) {
9
- (0, insert_import_1.insertImport)(tree, filePath, 'LinksFunction', '@remix-run/node', {
10
- typeOnly: true,
11
- });
12
- (0, insert_statement_after_imports_1.insertStatementAfterImports)(tree, filePath, (0, devkit_1.stripIndents) `import ${importName} from "${importPath}";`);
13
- const fileContents = tree.read(filePath, 'utf-8');
14
- const LINKS_FUNCTION_SELECTOR = 'VariableDeclaration:has(TypeReference > Identifier[name=LinksFunction])';
15
- const ast = tsquery_1.tsquery.ast(fileContents);
16
- const linksFunctionNodes = (0, tsquery_1.tsquery)(ast, LINKS_FUNCTION_SELECTOR, {
17
- visitAllChildren: true,
18
- });
19
- if (linksFunctionNodes.length === 0) {
20
- (0, insert_statement_after_imports_1.insertStatementAfterImports)(tree, filePath, (0, devkit_1.stripIndents) `export const links: LinksFunction = () => [
21
- ${linkObject},
22
- ];`);
23
- }
24
- else {
25
- const linksArrayNodes = (0, tsquery_1.tsquery)(linksFunctionNodes[0], 'ArrayLiteralExpression', { visitAllChildren: true });
26
- const arrayNode = linksArrayNodes[0];
27
- const updatedFileContents = `${fileContents.slice(0, arrayNode.getStart() + 1)}\n${linkObject},${fileContents.slice(arrayNode.getStart() + 1)}`;
28
- tree.write(filePath, updatedFileContents);
29
- }
30
- }