Skip to content

Commit

Permalink
update to nx-11
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachJW34 authored and BuckyMaler committed Mar 25, 2021
1 parent afc95fe commit f242d98
Show file tree
Hide file tree
Showing 46 changed files with 725 additions and 340 deletions.
58 changes: 24 additions & 34 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.*?.json"
},
"ignorePatterns": ["**/*"],
"plugins": ["@typescript-eslint", "@nrwl/nx"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
],
"@typescript-eslint/explicit-module-boundary-types": "off"
},
"overrides": [
},
{
"files": ["*.tsx"],
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
}
]
}
2 changes: 1 addition & 1 deletion apps/vue-e2e/tests/vue-2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('vue 2 e2e', () => {

updateFile(
`apps/${appName}/src/App.vue`,
'<script lang="ts">{}</script>'
'<script lang="ts">let myVar: {}</script>'
);

const result = await runNxCommandAsync(`lint ${appName}`, {
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-e2e/tests/vue-3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('vue 3 e2e', () => {

updateFile(
`apps/${appName}/src/App.vue`,
'<script lang="ts">{}</script>'
'<script lang="ts">let myVar: {}</script>'
);

const result = await runNxCommandAsync(`lint ${appName}`, {
Expand Down
19 changes: 18 additions & 1 deletion libs/docusaurus/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"extends": "../../.eslintrc.json",
"rules": {},
"ignorePatterns": ["!**/*"]
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["libs/docusaurus/tsconfig.*?.json"]
},
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
2 changes: 1 addition & 1 deletion libs/docusaurus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
If you have not already, [create an Nx workspace](https://github.com/nrwl/nx#creating-an-nx-workspace) with the following:

```
npx create-nx-workspace@^10.0.0
npx create-nx-workspace@^11.0.0
```

## Getting Started
Expand Down
18 changes: 18 additions & 0 deletions libs/docusaurus/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"version": "0.6.0",
"description": "update docusaurus dependencies",
"factory": "./src/migrations/update-0.6.0/update-0.6.0"
},
"update-11.0.0": {
"version": "11.0.0",
"description": "update docusaurus dependencies",
"factory": "./src/migrations/update-11.0.0/update-11.0.0"
}
},
"packageJsonUpdates": {
Expand Down Expand Up @@ -42,6 +47,19 @@
"alwaysAddToPackageJson": false
}
}
},
"11.0.0": {
"version": "11.0.0",
"packages": {
"@docusaurus/core": {
"version": "^2.0.0-alpha.70",
"alwaysAddToPackageJson": false
},
"@docusaurus/preset-classic": {
"version": "^2.0.0-alpha.70",
"alwaysAddToPackageJson": false
}
}
}
}
}
10 changes: 5 additions & 5 deletions libs/docusaurus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nx-plus/docusaurus",
"version": "10.4.0",
"version": "11.0.0",
"main": "src/index.js",
"schematics": "./collection.json",
"builders": "./builders.json",
Expand All @@ -25,12 +25,12 @@
},
"homepage": "https://github.com/ZachJW34/nx-plus/tree/master/libs/docusaurus#readme",
"peerDependencies": {
"@nrwl/workspace": "^10.0.0"
"@nrwl/workspace": "^11.0.0"
},
"dependencies": {
"@angular-devkit/architect": "0.1001.4",
"@angular-devkit/core": "10.1.4",
"@angular-devkit/schematics": "10.1.4",
"@angular-devkit/architect": "0.1102.1",
"@angular-devkit/core": "11.2.1",
"@angular-devkit/schematics": "11.2.1",
"rxjs": "6.5.5",
"typescript": "4.0.3"
},
Expand Down
16 changes: 16 additions & 0 deletions libs/docusaurus/src/migrations/update-11.0.0/update-11.0.0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { chain, Rule } from '@angular-devkit/schematics';
import {
addDepsToPackageJson,
updatePackagesInPackageJson,
} from '@nrwl/workspace';
import * as path from 'path';

export default function update(): Rule {
return chain([
updatePackagesInPackageJson(
path.join(__dirname, '../../../', 'migrations.json'),
'11.0.0'
),
addDepsToPackageJson({ '@mdx-js/react': '^1.6.21' }, {}),
]);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: hola
slug: hola
title: Hola
author: Gao Wei
author_title: Docusaurus Core Team
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: hello-world
slug: hello-world
title: Hello
author: Endilie Yacop Sucipto
author_title: Maintainer of Docusaurus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: welcome
slug: welcome
title: Welcome
author: Yangshun Tay
author_title: Front End Engineer @ Facebook
Expand Down
11 changes: 6 additions & 5 deletions libs/docusaurus/src/schematics/app/files/docs/doc1.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: doc1
title: Style Guide
sidebar_label: Style Guide
slug: /
---

You can write content using [GitHub-flavored Markdown syntax](https://github.github.com/gfm/).
Expand All @@ -28,9 +29,9 @@ To serve as an example page when styling markdown based Docusaurus sites.

## Emphasis

Emphasis, aka italics, with _asterisks_ or _underscores_.
Emphasis, aka italics, with *asterisks* or _underscores_.

Strong emphasis, aka bold, with **asterisks** or **underscores**.
Strong emphasis, aka bold, with **asterisks** or __underscores__.

Combined emphasis with **asterisks and _underscores_**.

Expand All @@ -47,11 +48,11 @@ Strikethrough uses two tildes. ~~Scratch this.~~
1. Ordered sub-list
1. And another item.

- Unordered list can use asterisks
* Unordered list can use asterisks

* Or minuses
- Or minuses

- Or pluses
+ Or pluses

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
url: 'https://your-docusaurus-test-site.com',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.
Expand All @@ -16,12 +17,12 @@ module.exports = {
},
items: [
{
to: 'docs/doc1',
to: 'docs/',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
{ to: 'blog', label: 'Blog', position: 'left' },
{to: 'blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
Expand All @@ -37,7 +38,7 @@ module.exports = {
items: [
{
label: 'Style Guide',
to: 'docs/doc1/',
to: 'docs/',
},
{
label: 'Second Doc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import styles from './styles.module.css';

const features = [
{
title: <>Easy to Use</>,
title: 'Easy to Use',
imageUrl: 'img/undraw_docusaurus_mountain.svg',
description: (
<>
Expand All @@ -18,7 +18,7 @@ const features = [
),
},
{
title: <>Focus on What Matters</>,
title: 'Focus on What Matters',
imageUrl: 'img/undraw_docusaurus_tree.svg',
description: (
<>
Expand All @@ -28,7 +28,7 @@ const features = [
),
},
{
title: <>Powered by React</>,
title: 'Powered by React',
imageUrl: 'img/undraw_docusaurus_react.svg',
description: (
<>
Expand All @@ -39,7 +39,7 @@ const features = [
},
];

function Feature({ imageUrl, title, description }) {
function Feature({imageUrl, title, description}) {
const imgUrl = useBaseUrl(imageUrl);
return (
<div className={clsx('col col--4', styles.feature)}>
Expand All @@ -56,12 +56,11 @@ function Feature({ imageUrl, title, description }) {

function Home() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
const {siteConfig = {}} = context;
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />"
>
description="Description will go into a meta tag in <head />">
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
Expand All @@ -70,10 +69,9 @@ function Home() {
<Link
className={clsx(
'button button--outline button--secondary button--lg',
styles.getStarted
styles.getStarted,
)}
to={useBaseUrl('docs/doc1')}
>
to={useBaseUrl('docs/')}>
Get Started
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion libs/docusaurus/src/schematics/app/schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$schema": "http://json-schema.org/schema",
"id": "App",
"title": "",
"type": "object",
Expand Down
5 changes: 3 additions & 2 deletions libs/docusaurus/src/schematics/app/schematic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ export default function (options: AppSchematicSchema): Rule {
updatePrettierIgnore(),
addDepsToPackageJson(
{
'@docusaurus/core': '^2.0.0-alpha.61',
'@docusaurus/preset-classic': '^2.0.0-alpha.61',
'@docusaurus/core': '^2.0.0-alpha.70',
'@docusaurus/preset-classic': '^2.0.0-alpha.70',
'@mdx-js/react': '^1.6.21',
clsx: '^1.1.1',
react: '^16.8.4',
'react-dom': '^16.8.4',
Expand Down
19 changes: 18 additions & 1 deletion libs/nuxt/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"extends": "../../.eslintrc.json",
"rules": {},
"ignorePatterns": ["!**/*"]
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {
"project": ["libs/nuxt/tsconfig.*?.json"]
},
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
Loading

0 comments on commit f242d98

Please sign in to comment.