@nx/remix 21.1.2 → 21.2.0-beta.2
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 +4 -4
- package/package.json +4 -4
- package/src/generators/setup-tailwind/__snapshots__/setup-tailwind.impl.spec.ts.snap +1 -2
- package/src/generators/setup-tailwind/schema.json +1 -2
- package/src/generators/setup-tailwind/setup-tailwind.impl.js +2 -5
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/src/utils/upsert-links-function.d.ts +0 -2
- package/src/utils/upsert-links-function.js +0 -30
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
|
|
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
|
|
18
|
+
# Nx: Smart Repos · Fast Builds
|
|
19
19
|
|
|
20
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "21.2.0-beta.2",
|
|
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.
|
|
33
|
-
"@nx/js": "21.
|
|
34
|
-
"@nx/react": "21.
|
|
32
|
+
"@nx/devkit": "21.2.0-beta.2",
|
|
33
|
+
"@nx/js": "21.2.0-beta.2",
|
|
34
|
+
"@nx/react": "21.2.0-beta.2",
|
|
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
|
|
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',
|
|
@@ -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,
|
|
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,
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const reactDomVersion = "^18.2.0";
|
|
|
7
7
|
export declare const typesReactVersion = "^18.2.0";
|
|
8
8
|
export declare const typesReactDomVersion = "^18.2.0";
|
|
9
9
|
export declare const eslintVersion = "^8.56.0";
|
|
10
|
-
export declare const typescriptVersion = "~5.
|
|
10
|
+
export declare const typescriptVersion = "~5.8.2";
|
|
11
11
|
export declare const tailwindVersion = "^3.3.0";
|
|
12
12
|
export declare const postcssVersion = "^8.4.38";
|
|
13
13
|
export declare const autoprefixerVersion = "^10.4.19";
|
package/src/utils/versions.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.reactDomVersion = '^18.2.0';
|
|
|
12
12
|
exports.typesReactVersion = '^18.2.0';
|
|
13
13
|
exports.typesReactDomVersion = '^18.2.0';
|
|
14
14
|
exports.eslintVersion = '^8.56.0';
|
|
15
|
-
exports.typescriptVersion = '~5.
|
|
15
|
+
exports.typescriptVersion = '~5.8.2';
|
|
16
16
|
exports.tailwindVersion = '^3.3.0';
|
|
17
17
|
exports.postcssVersion = '^8.4.38';
|
|
18
18
|
exports.autoprefixerVersion = '^10.4.19';
|
|
@@ -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
|
-
}
|