+ Resources & Tools
+
+ Thank you for using and showing some ♥ for Nx.
+
+
+
+ Here are some links to help you get started.
+
+
+ Next Steps
+
+ Here are some things you can do with Nx.
+
+
+ Add UI library
+ {\`# Generate UI lib
+nx g @nrwl/react:lib ui
+
+# Add a component
+nx g @nrwl/react:component xyz --project ui\`}
+
+
+ View dependency graph
+ {\`nx dep-graph\`}
+
+
+ Run affected commands
+ {\`# see what's been affected by changes
+nx affected:dep-graph
+
+# run tests for current changes
+nx affected:test
+
+# run e2e tests for current changes
+nx affected:e2e
+\`}
+
+
+`;
+}
+
+export function createPageWrapperStyle() {
+ return `
+ font-family: sans-serif;
+ min-width: 300px;
+ max-width: 600px;
+ margin: 50px auto;
+ `;
+}
+
+export function createPageStyleContent() {
+ return `
+ .gutter-left {
+ margin-left: 9px;
+ }
+
+ .col-span-2 {
+ grid-column: span 2;
+ }
+
+ .flex {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ header {
+ background-color: #143055;
+ color: white;
+ padding: 5px;
+ border-radius: 3px;
+ }
+
+ main {
+ padding: 0 36px;
+ }
+
+ p {
+ text-align: center;
+ }
+
+ h1 {
+ text-align: center;
+ margin-left: 18px;
+ font-size: 24px;
+ }
+
+ h2 {
+ text-align: center;
+ font-size: 20px;
+ margin: 40px 0 10px 0;
+ }
+
+ .resources {
+ text-align: center;
+ list-style: none;
+ padding: 0;
+ display: grid;
+ grid-gap: 9px;
+ grid-template-columns: 1fr 1fr;
+ }
+
+ .resource {
+ color: #0094ba;
+ height: 36px;
+ background-color: rgba(0, 0, 0, 0);
+ border: 1px solid rgba(0, 0, 0, 0.12);
+ border-radius: 4px;
+ padding: 3px 9px;
+ text-decoration: none;
+ }
+
+ .resource:hover {
+ background-color: rgba(68, 138, 255, 0.04);
+ }
+
+ pre {
+ padding: 9px;
+ border-radius: 4px;
+ background-color: black;
+ color: #eee;
+ }
+
+ details {
+ border-radius: 4px;
+ color: #333;
+ background-color: rgba(0, 0, 0, 0);
+ border: 1px solid rgba(0, 0, 0, 0.12);
+ padding: 3px 9px;
+ margin-bottom: 9px;
+ }
+
+ summary {
+ outline: none;
+ height: 36px;
+ line-height: 36px;
+ }
+
+ .github-star-container {
+ margin-top: 12px;
+ line-height: 20px;
+ }
+
+ .github-star-container a {
+ display: flex;
+ align-items: center;
+ text-decoration: none;
+ color: #333;
+ }
+
+ .github-star-badge {
+ color: #24292e;
+ display: flex;
+ align-items: center;
+ font-size: 12px;
+ padding: 3px 10px;
+ border: 1px solid rgba(27,31,35,.2);
+ border-radius: 3px;
+ background-image: linear-gradient(-180deg,#fafbfc,#eff3f6 90%);
+ margin-left: 4px;
+ font-weight: 600;
+ }
+
+ .github-star-badge:hover {
+ background-image: linear-gradient(-180deg,#f0f3f6,#e6ebf1 90%);
+ border-color: rgba(27,31,35,.35);
+ background-position: -.5em;
+ }
+ .github-star-badge .material-icons {
+ height: 16px;
+ width: 16px;
+ margin-right: 4px;
+ }
+ `;
+}
diff --git a/packages/gatsby/src/generators/application/lib/create-application-files.ts b/packages/gatsby/src/generators/application/lib/create-application-files.ts
index aba3f67b69..3f5542a5cc 100644
--- a/packages/gatsby/src/generators/application/lib/create-application-files.ts
+++ b/packages/gatsby/src/generators/application/lib/create-application-files.ts
@@ -8,6 +8,11 @@ import {
Tree,
updateTsConfigsToJs,
} from '@nrwl/devkit';
+import {
+ createAppJsx,
+ createPageStyleContent,
+ createPageWrapperStyle,
+} from './create-application-files.helpers';
export function createApplicationFiles(host: Tree, options: NormalizedSchema) {
const isPnpm = host.exists('pnpm-lock.yaml');
@@ -17,6 +22,9 @@ export function createApplicationFiles(host: Tree, options: NormalizedSchema) {
...names(options.name),
offsetFromRoot: offsetFromRoot(options.projectRoot),
tmpl: '',
+ appContent: createAppJsx(options.name),
+ pageWrapperStyle: createPageWrapperStyle(),
+ pageStyleContent: createPageStyleContent(),
};
generateFiles(
diff --git a/packages/gatsby/src/generators/application/schema.json b/packages/gatsby/src/generators/application/schema.json
index c729d4134e..0ec1afc20c 100644
--- a/packages/gatsby/src/generators/application/schema.json
+++ b/packages/gatsby/src/generators/application/schema.json
@@ -69,6 +69,10 @@
"value": "@emotion/styled",
"label": "emotion [ https://emotion.sh ]"
},
+ {
+ "value": "styled-jsx",
+ "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
+ },
{
"value": "none",
"label": "None"
diff --git a/packages/gatsby/src/generators/component/schema.json b/packages/gatsby/src/generators/component/schema.json
index f31d70e697..d3209c410b 100644
--- a/packages/gatsby/src/generators/component/schema.json
+++ b/packages/gatsby/src/generators/component/schema.json
@@ -66,6 +66,10 @@
"value": "@emotion/styled",
"label": "emotion [ https://emotion.sh ]"
},
+ {
+ "value": "styled-jsx",
+ "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
+ },
{
"value": "none",
"label": "None"
diff --git a/packages/gatsby/src/generators/page/schema.json b/packages/gatsby/src/generators/page/schema.json
index d3cb98a0e4..51a3fa25bf 100644
--- a/packages/gatsby/src/generators/page/schema.json
+++ b/packages/gatsby/src/generators/page/schema.json
@@ -66,6 +66,10 @@
"value": "@emotion/styled",
"label": "emotion [ https://emotion.sh ]"
},
+ {
+ "value": "styled-jsx",
+ "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
+ },
{
"value": "none",
"label": "None"
diff --git a/packages/gatsby/src/utils/styles.ts b/packages/gatsby/src/utils/styles.ts
index 5f9522550b..8769358f9a 100644
--- a/packages/gatsby/src/utils/styles.ts
+++ b/packages/gatsby/src/utils/styles.ts
@@ -4,6 +4,7 @@ import {
gatsbyPluginLessVersion,
gatsbyPluginSassVersion,
gatsbyPluginStyledComponentsVersion,
+ gatsbyPluginStyledJsx,
gatsbyPluginStylusVersion,
nodeSassVersion,
} from './versions';
@@ -46,6 +47,13 @@ export const GATSBY_SPECIFIC_STYLE_DEPENDENCIES = {
'gatsby-plugin-stylus': gatsbyPluginStylusVersion,
},
},
+ 'styled-jsx': {
+ dependencies: CSS_IN_JS_DEPENDENCIES['styled-jsx'].dependencies,
+ devDependencies: {
+ 'gatsby-plugin-styled-jsx': gatsbyPluginStyledJsx,
+ ...CSS_IN_JS_DEPENDENCIES['styled-jsx'].devDependencies,
+ },
+ },
};
export function addStyleDependencies(host: Tree, style: string) {
diff --git a/packages/gatsby/src/utils/versions.ts b/packages/gatsby/src/utils/versions.ts
index ab75bfc6a6..db56c8886a 100644
--- a/packages/gatsby/src/utils/versions.ts
+++ b/packages/gatsby/src/utils/versions.ts
@@ -6,6 +6,7 @@ export const gatsbyPluginManifestVersion = '3.2.0';
export const gatsbyPluginOfflineVersion = '4.2.0';
export const gatsbyPluginReactHelmetVersion = '4.2.0';
export const gatsbyPluginSharpVersion = '3.2.0';
+export const gatsbyPluginStyledJsx = '4.2.0';
export const gatsbySourceFilesystemVersion = '3.2.0';
export const gatsbyTransformerSharpVersion = '3.2.0';
export const propTypesVersion = '15.7.2';
diff --git a/workspace.json b/workspace.json
index f66fbd3143..f15efc6af5 100644
--- a/workspace.json
+++ b/workspace.json
@@ -2019,6 +2019,32 @@
"sourceRoot": "packages/gatsby",
"projectType": "library",
"targets": {
+ "e2e": {
+ "executor": "@nrwl/workspace:run-commands",
+ "options": {
+ "commands": [
+ {
+ "command": "yarn e2e-start-local-registry"
+ },
+ {
+ "command": "yarn e2e-build-package-publish"
+ },
+ {
+ "command": "nx run-e2e-tests e2e-gatsby"
+ }
+ ],
+ "parallel": false
+ }
+ },
+ "run-e2e-tests": {
+ "executor": "@nrwl/jest:jest",
+ "options": {
+ "jestConfig": "e2e/gatsby/jest.config.js",
+ "passWithNoTests": true,
+ "runInBand": true
+ },
+ "outputs": ["coverage/e2e/gatsby"]
+ },
"test": {
"executor": "@nrwl/jest:jest",
"options": {