Skip to content

Commit 7351239

Browse files
authoredDec 15, 2021
Merge pull request #22 from erkobridee/update/nx
update: nx into v13.3.4 and tailwindcss into v3.0.3
2 parents 2a1acc7 + 9d4a850 commit 7351239

File tree

15 files changed

+5371
-4401
lines changed

15 files changed

+5371
-4401
lines changed
 

‎.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66

77
**/webpack.config.js
88
**/tailwind.config.js
9+
10+
**/*.d.ts

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NxNextjs
22

3-
This project was generated using [Nx](https://nx.dev/) ([v13.1.2](https://github.com/nrwl/nx/releases/tag/13.1.2))
3+
This project was generated using [Nx](https://nx.dev/) ([13.3.4](https://github.com/nrwl/nx/releases/tag/13.3.4))
44

55
ℹ️  use the [node.js](https://nodejs.org/en/) v14 LTS
66

‎apps/nextjs/next-env.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32

43
// NOTE: This file should not be edited
54
// see https://nextjs.org/docs/basic-features/typescript for more information.

‎apps/nextjs/tailwind.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ const {
66
const configTailwind = require(`${appRootPath}/tools/config/tailwind`);
77

88
module.exports = configTailwind({
9-
purge: [`${__dirname}/src/${PURGE_MATCH_FILES}`],
9+
content: [`${__dirname}/src/${PURGE_MATCH_FILES}`],
1010
});

‎apps/nextjs/tsconfig.json

+2-11
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,15 @@
55
"allowJs": true,
66
"esModuleInterop": true,
77
"allowSyntheticDefaultImports": true,
8-
"types": [
9-
"node",
10-
"jest"
11-
],
8+
"types": ["node", "jest"],
129
"strict": false,
1310
"forceConsistentCasingInFileNames": true,
1411
"noEmit": true,
1512
"resolveJsonModule": true,
1613
"isolatedModules": true,
1714
"incremental": true
1815
},
19-
"include": [
20-
"**/*.ts",
21-
"**/*.tsx",
22-
"next-env.d.ts",
23-
"**/*.js",
24-
"**/*.jsx"
25-
],
16+
"include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", "**/*.js", "**/*.jsx"],
2617
"exclude": [
2718
"node_modules",
2819
"**/*.spec.ts",

‎docs/tailwindcss.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Tailwind CSS
44

5-
> [release v2.2](https://github.com/tailwindlabs/tailwindcss/releases/tag/v2.2.0) | [blog post](https://blog.tailwindcss.com/tailwindcss-2-2)
5+
> [release v3.0.3](https://github.com/tailwindlabs/tailwindcss/releases/tag/v3.0.3) | [blog post](https://tailwindcss.com/blog/tailwindcss-v3)
66
77
- [Tailwind CSS](https://tailwindcss.com/)
88

@@ -12,10 +12,6 @@
1212

1313
- [Optimizing for Production](https://tailwindcss.com/docs/optimizing-for-production)
1414

15-
- the [purge](https://purgecss.com/) uses the [glob notation](https://github.com/isaacs/node-glob#glob-primer)
16-
17-
- [Removing unused CSS](https://tailwindcss.com/docs/optimizing-for-production#removing-unused-css) - run when `NODE_ENV=production`
18-
1915
- [Tailwind CSS IntelliSense | VS Code - Extensions](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)
2016

2117
- [Start a Component Library with Storybook, Tailwind CSS, and TypeScript | BetterProgramming](https://medium.com/better-programming/start-a-component-library-with-storybook-tailwind-css-and-typescript-ebaffc33d098) - 2020/04/02
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import type { Story, Meta } from '@storybook/react';
32

43
import { SharedComponents, SharedComponentsProps } from './index';
@@ -8,9 +7,9 @@ export default {
87
title: 'Shared/Components',
98
} as Meta;
109

11-
const Template: Story<SharedComponentsProps> = (args) => (
12-
<SharedComponents {...args} />
13-
);
10+
type TStory = Story<SharedComponentsProps>;
1411

15-
export const Welcome = Template.bind({});
12+
const Template: TStory = (args) => <SharedComponents {...args} />;
13+
14+
export const Welcome: TStory = Template.bind({});
1615
Welcome.args = {};

‎libs/shared/components/src/lib/target-blank-link/index.stories.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import type { Story, Meta } from '@storybook/react';
32

43
import { TargetBlankLink, TargetBlankLinkProps } from './index';
@@ -8,11 +7,11 @@ export default {
87
title: 'Shared/Components/TargetBlankLink',
98
} as Meta;
109

11-
const Template: Story<TargetBlankLinkProps> = (args) => (
12-
<TargetBlankLink {...args} />
13-
);
10+
type TStory = Story<TargetBlankLinkProps>;
1411

15-
export const Default = Template.bind({});
12+
const Template: TStory = (args) => <TargetBlankLink {...args} />;
13+
14+
export const Default: TStory = Template.bind({});
1615
Default.args = {
1716
className: 'text-blue-700',
1817
href: 'https://google.com',

‎migrations.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"migrations": [
3+
{
4+
"version": "13.2.0",
5+
"description": "Set --parallel=1 for existing repos to preserve the existing behavior",
6+
"cli": "nx",
7+
"implementation": "./src/migrations/update-13-2-0/set-parallel-default",
8+
"package": "@nrwl/workspace",
9+
"name": "set-parallel-default"
10+
},
11+
{
12+
"version": "13.3.0-beta.0",
13+
"description": "@nrwl/workspace:tsc is now @nrwl/js:tsc",
14+
"cli": "nx",
15+
"implementation": "./src/migrations/update-13-3-0/update-tsc-executor-location",
16+
"package": "@nrwl/workspace",
17+
"name": "13-3-0-tsc-location"
18+
},
19+
{
20+
"cli": "nx",
21+
"version": "13.3.0-beta.1",
22+
"description": "Rename the 'package' executor to 'rollup'",
23+
"factory": "./src/migrations/update-13-3-0/rename-package-to-rollup",
24+
"package": "@nrwl/web",
25+
"name": "rename-package-to-rollup"
26+
}
27+
]
28+
}

‎nx.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"test",
2525
"e2e",
2626
"build-storybook"
27-
]
27+
],
28+
"parallel": 1
2829
}
2930
}
3031
},

‎package-lock.json

+5,296-4,315
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+19-18
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"private": true,
4646
"dependencies": {
4747
"document-register-element": "1.13.1",
48-
"next": "12.0.0",
48+
"next": "12.0.7",
4949
"react": "17.0.2",
5050
"react-dom": "17.0.2"
5151
},
@@ -55,23 +55,23 @@
5555
"@babel/preset-env": "7.9.6",
5656
"@babel/preset-react": "7.9.4",
5757
"@babel/preset-typescript": "7.9.0",
58-
"@nrwl/cli": "13.1.2",
59-
"@nrwl/cypress": "13.1.2",
60-
"@nrwl/eslint-plugin-nx": "13.1.2",
61-
"@nrwl/jest": "13.1.2",
62-
"@nrwl/next": "13.1.2",
63-
"@nrwl/react": "13.1.2",
64-
"@nrwl/storybook": "13.1.2",
65-
"@nrwl/tao": "13.1.2",
66-
"@nrwl/web": "13.1.2",
67-
"@nrwl/workspace": "13.1.2",
58+
"@nrwl/cli": "13.3.4",
59+
"@nrwl/cypress": "13.3.4",
60+
"@nrwl/eslint-plugin-nx": "13.3.4",
61+
"@nrwl/jest": "13.3.4",
62+
"@nrwl/next": "13.3.4",
63+
"@nrwl/react": "13.3.4",
64+
"@nrwl/storybook": "13.3.4",
65+
"@nrwl/tao": "13.3.4",
66+
"@nrwl/web": "13.3.4",
67+
"@nrwl/workspace": "13.3.4",
6868
"@storybook/addon-a11y": "^6.3.1",
6969
"@storybook/addon-actions": "^6.3.1",
70-
"@storybook/addon-essentials": "^6.3.1",
70+
"@storybook/addon-essentials": "6.4.9",
7171
"@storybook/addons": "^6.3.1",
72-
"@storybook/builder-webpack5": "^6.3.1",
73-
"@storybook/manager-webpack5": "^6.3.1",
74-
"@storybook/react": "^6.3.1",
72+
"@storybook/builder-webpack5": "6.4.9",
73+
"@storybook/manager-webpack5": "6.4.9",
74+
"@storybook/react": "6.4.9",
7575
"@svgr/webpack": "^5.4.0",
7676
"@testing-library/react": "12.1.2",
7777
"@types/jest": "27.0.2",
@@ -81,12 +81,13 @@
8181
"@types/webpack": "4.41.21",
8282
"@typescript-eslint/eslint-plugin": "4.19.0",
8383
"@typescript-eslint/parser": "^4.28.5",
84+
"autoprefixer": "^10.4.0",
8485
"babel-jest": "27.2.3",
8586
"babel-loader": "8.1.0",
8687
"cypress": "^5.5.0",
8788
"dotenv": "10.0.0",
8889
"eslint": "7.32.0",
89-
"eslint-config-next": "12.0.0",
90+
"eslint-config-next": "12.0.7",
9091
"eslint-config-prettier": "8.3.0",
9192
"eslint-plugin-cypress": "^2.10.3",
9293
"eslint-plugin-import": "2.25.2",
@@ -99,13 +100,13 @@
99100
"jest": "27.2.3",
100101
"lint-staged": "11.1.2",
101102
"npm-run-all2": "5.0.2",
102-
"postcss": "8.3.6",
103+
"postcss": "^8.4.5",
103104
"postcss-import": "14.0.2",
104105
"postcss-loader": "^4.1.0",
105106
"prettier": "2.3.2",
106107
"rimraf": "3.0.2",
107108
"sass": "^1.29.0",
108-
"tailwindcss": "2.2.15",
109+
"tailwindcss": "^3.0.3",
109110
"ts-jest": "27.0.5",
110111
"ts-node": "9.1.1",
111112
"tslib": "^2.1.0",

‎tailwind.config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
const { PURGE_MATCH_FILES } = require('./tools/config/tailwind/definitions');
22

33
module.exports = {
4-
mode: 'jit',
5-
purge: [`${__dirname}/libs/shared/components/src/${PURGE_MATCH_FILES}`],
6-
darkMode: false, // or 'media' or 'class'
4+
content: [`${__dirname}/libs/shared/components/src/${PURGE_MATCH_FILES}`],
75
theme: {
86
extend: {
97
fontFamily: {

‎tools/config/tailwind/index.js

+9-34
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,19 @@ const { appRootPath } = require('@nrwl/tao/src/utils/app-root');
99

1010
const rootTailwindConfig = require(`${appRootPath}/tailwind.config.js`);
1111

12-
const isObject = (value) =>
13-
value && typeof value === 'object' && value.constructor === Object;
14-
15-
const mergePurge = ({ rootPurge, projectPurge }) => {
16-
let newPurge = { content: [] };
17-
18-
if (isObject(rootPurge)) {
19-
newPurge = rootPurge;
20-
} else if (Array.isArray(rootPurge)) {
21-
newPurge.content = rootPurge;
22-
}
23-
24-
if (isObject(projectPurge)) {
25-
const rootPurge = newPurge.content;
26-
const projectPurge = project.purge || [];
27-
newPurge = {
28-
...newPurge,
29-
...projectPurge,
30-
content: [...rootPurge, ...projectPurge],
31-
};
32-
} else if (Array.isArray(projectPurge)) {
33-
newPurge.content = [...newPurge.content, ...projectPurge];
34-
}
35-
36-
return newPurge;
37-
};
38-
3912
module.exports = (tailwindConfig = {}) => {
40-
const rootPurge = rootTailwindConfig.purge;
41-
const projectPurge = tailwindConfig.purge;
13+
const rootContent = rootTailwindConfig.content || [];
14+
const projectContent = tailwindConfig.content || [];
15+
const content = [...rootContent, ...projectContent];
16+
17+
const rootSafelist = rootTailwindConfig.safelist || [];
18+
const projectSafelist = projectContent.safelist || [];
19+
const safelist = [...rootSafelist, ...projectSafelist];
4220

43-
const purge = mergePurge({
44-
rootPurge,
45-
projectPurge,
46-
});
4721
return {
4822
...rootTailwindConfig,
4923
...tailwindConfig,
50-
purge,
24+
content,
25+
safelist,
5126
};
5227
};

‎workspace.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"schematics": {},
99
"architect": {
1010
"build": {
11-
"builder": "@nrwl/web:build",
11+
"builder": "@nrwl/web:webpack",
1212
"options": {
1313
"outputPath": "dist/apps/app",
1414
"index": "apps/app/src/index.html",

0 commit comments

Comments
 (0)
Please sign in to comment.