@nrwl/next 15.9.2 → 16.0.0-beta.1
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/babel.js +1 -12
- package/babel.js.map +1 -1
- package/executors.json +12 -12
- package/generators.json +2 -70
- package/index.d.ts +1 -6
- package/index.js +1 -12
- package/index.js.map +1 -1
- package/package.json +7 -30
- package/plugins/with-less.d.ts +1 -2
- package/plugins/with-less.js +1 -75
- package/plugins/with-less.js.map +1 -1
- package/plugins/with-nx.d.ts +1 -15
- package/plugins/with-nx.js +1 -274
- package/plugins/with-nx.js.map +1 -1
- package/plugins/with-stylus.d.ts +1 -2
- package/plugins/with-stylus.js +1 -75
- package/plugins/with-stylus.js.map +1 -1
- package/tailwind.d.ts +1 -2
- package/tailwind.js +2 -4
- package/tailwind.js.map +1 -1
- package/README.md +0 -63
- package/migrations.json +0 -306
- package/src/executors/build/build.impl.d.ts +0 -6
- package/src/executors/build/build.impl.js +0 -62
- package/src/executors/build/build.impl.js.map +0 -1
- package/src/executors/build/compat.d.ts +0 -2
- package/src/executors/build/compat.js +0 -6
- package/src/executors/build/compat.js.map +0 -1
- package/src/executors/build/lib/check-project.d.ts +0 -1
- package/src/executors/build/lib/check-project.js +0 -13
- package/src/executors/build/lib/check-project.js.map +0 -1
- package/src/executors/build/lib/create-next-config-file.d.ts +0 -3
- package/src/executors/build/lib/create-next-config-file.js +0 -15
- package/src/executors/build/lib/create-next-config-file.js.map +0 -1
- package/src/executors/build/lib/update-package-json.d.ts +0 -3
- package/src/executors/build/lib/update-package-json.js +0 -24
- package/src/executors/build/lib/update-package-json.js.map +0 -1
- package/src/executors/build/schema.json +0 -68
- package/src/executors/export/compat.d.ts +0 -2
- package/src/executors/export/compat.js +0 -6
- package/src/executors/export/compat.js.map +0 -1
- package/src/executors/export/export.impl.d.ts +0 -6
- package/src/executors/export/export.impl.js +0 -53
- package/src/executors/export/export.impl.js.map +0 -1
- package/src/executors/export/schema.json +0 -30
- package/src/executors/server/compat.d.ts +0 -2
- package/src/executors/server/compat.js +0 -6
- package/src/executors/server/compat.js.map +0 -1
- package/src/executors/server/lib/custom-server.d.ts +0 -2
- package/src/executors/server/lib/custom-server.js +0 -15
- package/src/executors/server/lib/custom-server.js.map +0 -1
- package/src/executors/server/lib/default-server.d.ts +0 -6
- package/src/executors/server/lib/default-server.js +0 -34
- package/src/executors/server/lib/default-server.js.map +0 -1
- package/src/executors/server/lib/tsnode-register.d.ts +0 -1
- package/src/executors/server/lib/tsnode-register.js +0 -23
- package/src/executors/server/lib/tsnode-register.js.map +0 -1
- package/src/executors/server/schema.json +0 -61
- package/src/executors/server/server.impl.d.ts +0 -7
- package/src/executors/server/server.impl.js +0 -120
- package/src/executors/server/server.impl.js.map +0 -1
- package/src/generators/application/application.d.ts +0 -4
- package/src/generators/application/application.js +0 -45
- package/src/generators/application/application.js.map +0 -1
- package/src/generators/application/files/.babelrc__tmpl__ +0 -21
- package/src/generators/application/files/index.d.ts__tmpl__ +0 -18
- package/src/generators/application/files/next-env.d.ts__tmpl__ +0 -5
- package/src/generators/application/files/next.config.js__tmpl__ +0 -70
- package/src/generators/application/files/pages/__fileName__.module.__style__ +0 -1
- package/src/generators/application/files/pages/__fileName__.tsx__tmpl__ +0 -28
- package/src/generators/application/files/pages/_app.tsx__tmpl__ +0 -18
- package/src/generators/application/files/pages/_document.tsx__tmpl__ +0 -33
- package/src/generators/application/files/pages/styles.__stylesExt____tmpl__ +0 -1
- package/src/generators/application/files/public/.gitkeep +0 -0
- package/src/generators/application/files/specs/__fileName__.spec.tsx__tmpl__ +0 -11
- package/src/generators/application/files/tsconfig.json__tmpl__ +0 -18
- package/src/generators/application/lib/add-cypress.d.ts +0 -3
- package/src/generators/application/lib/add-cypress.js +0 -18
- package/src/generators/application/lib/add-cypress.js.map +0 -1
- package/src/generators/application/lib/add-jest.d.ts +0 -3
- package/src/generators/application/lib/add-jest.js +0 -36
- package/src/generators/application/lib/add-jest.js.map +0 -1
- package/src/generators/application/lib/add-linting.d.ts +0 -3
- package/src/generators/application/lib/add-linting.js +0 -66
- package/src/generators/application/lib/add-linting.js.map +0 -1
- package/src/generators/application/lib/add-project.d.ts +0 -3
- package/src/generators/application/lib/add-project.js +0 -59
- package/src/generators/application/lib/add-project.js.map +0 -1
- package/src/generators/application/lib/create-application-files.d.ts +0 -3
- package/src/generators/application/lib/create-application-files.helpers.d.ts +0 -2
- package/src/generators/application/lib/create-application-files.helpers.js +0 -785
- package/src/generators/application/lib/create-application-files.helpers.js.map +0 -1
- package/src/generators/application/lib/create-application-files.js +0 -34
- package/src/generators/application/lib/create-application-files.js.map +0 -1
- package/src/generators/application/lib/create-next-server-files.d.ts +0 -3
- package/src/generators/application/lib/create-next-server-files.js +0 -57
- package/src/generators/application/lib/create-next-server-files.js.map +0 -1
- package/src/generators/application/lib/normalize-options.d.ts +0 -13
- package/src/generators/application/lib/normalize-options.js +0 -33
- package/src/generators/application/lib/normalize-options.js.map +0 -1
- package/src/generators/application/lib/set-defaults.d.ts +0 -3
- package/src/generators/application/lib/set-defaults.js +0 -14
- package/src/generators/application/lib/set-defaults.js.map +0 -1
- package/src/generators/application/lib/update-jest-config.d.ts +0 -3
- package/src/generators/application/lib/update-jest-config.js +0 -16
- package/src/generators/application/lib/update-jest-config.js.map +0 -1
- package/src/generators/application/schema.d.ts +0 -20
- package/src/generators/application/schema.json +0 -131
- package/src/generators/component/component.d.ts +0 -15
- package/src/generators/component/component.js +0 -34
- package/src/generators/component/component.js.map +0 -1
- package/src/generators/component/schema.json +0 -119
- package/src/generators/custom-server/custom-server.d.ts +0 -4
- package/src/generators/custom-server/custom-server.js +0 -79
- package/src/generators/custom-server/custom-server.js.map +0 -1
- package/src/generators/custom-server/files/server/main.ts__tmpl__ +0 -46
- package/src/generators/custom-server/files/tsconfig.server.json__tmpl__ +0 -15
- package/src/generators/custom-server/schema.d.ts +0 -4
- package/src/generators/custom-server/schema.json +0 -30
- package/src/generators/init/init.d.ts +0 -5
- package/src/generators/init/init.js +0 -49
- package/src/generators/init/init.js.map +0 -1
- package/src/generators/init/schema.d.ts +0 -7
- package/src/generators/init/schema.json +0 -39
- package/src/generators/library/library.d.ts +0 -5
- package/src/generators/library/library.js +0 -73
- package/src/generators/library/library.js.map +0 -1
- package/src/generators/library/schema.d.ts +0 -26
- package/src/generators/library/schema.json +0 -162
- package/src/generators/page/page.d.ts +0 -5
- package/src/generators/page/page.js +0 -27
- package/src/generators/page/page.js.map +0 -1
- package/src/generators/page/schema.d.ts +0 -13
- package/src/generators/page/schema.json +0 -107
- package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.d.ts +0 -3
- package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.js +0 -34
- package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.js.map +0 -1
- package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.d.ts +0 -3
- package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.js +0 -26
- package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.js.map +0 -1
- package/src/migrations/update-13-0-0/update-emotion-setup.d.ts +0 -3
- package/src/migrations/update-13-0-0/update-emotion-setup.js +0 -39
- package/src/migrations/update-13-0-0/update-emotion-setup.js.map +0 -1
- package/src/migrations/update-13-0-0/update-to-webpack-5.d.ts +0 -3
- package/src/migrations/update-13-0-0/update-to-webpack-5.js +0 -32
- package/src/migrations/update-13-0-0/update-to-webpack-5.js.map +0 -1
- package/src/migrations/update-13-0-3/fix-less.d.ts +0 -3
- package/src/migrations/update-13-0-3/fix-less.js +0 -27
- package/src/migrations/update-13-0-3/fix-less.js.map +0 -1
- package/src/migrations/update-13-1-1/enable-swc.d.ts +0 -3
- package/src/migrations/update-13-1-1/enable-swc.js +0 -46
- package/src/migrations/update-13-1-1/enable-swc.js.map +0 -1
- package/src/migrations/update-14-0-0/add-default-development-configurations.d.ts +0 -3
- package/src/migrations/update-14-0-0/add-default-development-configurations.js +0 -36
- package/src/migrations/update-14-0-0/add-default-development-configurations.js.map +0 -1
- package/src/migrations/update-14-4-3/add-dev-output-path.d.ts +0 -3
- package/src/migrations/update-14-4-3/add-dev-output-path.js +0 -24
- package/src/migrations/update-14-4-3/add-dev-output-path.js.map +0 -1
- package/src/migrations/update-14-5-3/add-gitignore-entry.d.ts +0 -3
- package/src/migrations/update-14-5-3/add-gitignore-entry.js +0 -15
- package/src/migrations/update-14-5-3/add-gitignore-entry.js.map +0 -1
- package/src/migrations/update-14-5-3/update-dev-output-path.d.ts +0 -3
- package/src/migrations/update-14-5-3/update-dev-output-path.js +0 -29
- package/src/migrations/update-14-5-3/update-dev-output-path.js.map +0 -1
- package/src/migrations/update-14-5-7/update-next-eslint.d.ts +0 -3
- package/src/migrations/update-14-5-7/update-next-eslint.js +0 -32
- package/src/migrations/update-14-5-7/update-next-eslint.js.map +0 -1
- package/src/migrations/update-15-8-8/add-style-packages.d.ts +0 -3
- package/src/migrations/update-15-8-8/add-style-packages.js +0 -28
- package/src/migrations/update-15-8-8/add-style-packages.js.map +0 -1
- package/src/utils/add-gitignore-entry.d.ts +0 -2
- package/src/utils/add-gitignore-entry.js +0 -18
- package/src/utils/add-gitignore-entry.js.map +0 -1
- package/src/utils/config-invalid-function.fixture.d.ts +0 -0
- package/src/utils/config-invalid-function.fixture.js +0 -2
- package/src/utils/config-invalid-function.fixture.js.map +0 -1
- package/src/utils/config-not-a-function.fixture.d.ts +0 -0
- package/src/utils/config-not-a-function.fixture.js +0 -2
- package/src/utils/config-not-a-function.fixture.js.map +0 -1
- package/src/utils/config.d.ts +0 -4
- package/src/utils/config.fixture.d.ts +0 -0
- package/src/utils/config.fixture.js +0 -4
- package/src/utils/config.fixture.js.map +0 -1
- package/src/utils/config.js +0 -65
- package/src/utils/config.js.map +0 -1
- package/src/utils/constants.d.ts +0 -1
- package/src/utils/constants.js +0 -5
- package/src/utils/constants.js.map +0 -1
- package/src/utils/create-copy-plugin.d.ts +0 -2
- package/src/utils/create-copy-plugin.js +0 -63
- package/src/utils/create-copy-plugin.js.map +0 -1
- package/src/utils/generate-globs.d.ts +0 -5
- package/src/utils/generate-globs.js +0 -30
- package/src/utils/generate-globs.js.map +0 -1
- package/src/utils/styles.d.ts +0 -40
- package/src/utils/styles.js +0 -56
- package/src/utils/styles.js.map +0 -1
- package/src/utils/types.d.ts +0 -57
- package/src/utils/types.js +0 -3
- package/src/utils/types.js.map +0 -1
- package/src/utils/versions.d.ts +0 -9
- package/src/utils/versions.js +0 -13
- package/src/utils/versions.js.map +0 -1
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
//@ts-check
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
4
|
-
const { withNx } = require('@nrwl/next/plugins/with-nx');
|
|
5
|
-
|
|
6
|
-
<% if (style === 'less') { %>
|
|
7
|
-
// This plugin is needed until this PR is merged.
|
|
8
|
-
// https://github.com/vercel/next.js/pull/23185
|
|
9
|
-
const { withLess } = require('@nrwl/next/plugins/with-less');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
|
13
|
-
**/
|
|
14
|
-
const nextConfig = {
|
|
15
|
-
nx: {
|
|
16
|
-
// Set this to true if you would like to to use SVGR
|
|
17
|
-
// See: https://github.com/gregberge/svgr
|
|
18
|
-
svgr: false,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
module.exports = withLess(withNx(nextConfig));
|
|
23
|
-
<% } else if (style === 'styl') { %>
|
|
24
|
-
const { withStylus } = require('@nrwl/next/plugins/with-stylus');
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
|
28
|
-
**/
|
|
29
|
-
const nextConfig = {
|
|
30
|
-
nx: {
|
|
31
|
-
// Set this to true if you would like to to use SVGR
|
|
32
|
-
// See: https://github.com/gregberge/svgr
|
|
33
|
-
svgr: false,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
module.exports = withStylus(withNx(nextConfig));
|
|
38
|
-
<% } else if (
|
|
39
|
-
style === 'styled-components'
|
|
40
|
-
||style === '@emotion/styled'
|
|
41
|
-
|| style === 'styled-jsx'
|
|
42
|
-
|| style === 'none'
|
|
43
|
-
) { %>
|
|
44
|
-
/**
|
|
45
|
-
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
|
46
|
-
**/
|
|
47
|
-
const nextConfig = {
|
|
48
|
-
nx: {
|
|
49
|
-
// Set this to true if you would like to to use SVGR
|
|
50
|
-
// See: https://github.com/gregberge/svgr
|
|
51
|
-
svgr: false,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
module.exports = withNx(nextConfig);
|
|
56
|
-
<% } else {
|
|
57
|
-
// Defaults to CSS/SASS (which don't need plugin as of Next 9.3) %>
|
|
58
|
-
/**
|
|
59
|
-
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
|
|
60
|
-
**/
|
|
61
|
-
const nextConfig = {
|
|
62
|
-
nx: {
|
|
63
|
-
// Set this to true if you would like to use SVGR
|
|
64
|
-
// See: https://github.com/gregberge/svgr
|
|
65
|
-
svgr: false,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
module.exports = withNx(nextConfig);
|
|
70
|
-
<% } %>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<%- pageStyleContent %>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<% if (styledModule && styledModule !== 'styled-jsx') {
|
|
2
|
-
var wrapper = 'StyledPage';
|
|
3
|
-
%>import styled from '<%= styledModule %>';<% } else {
|
|
4
|
-
var wrapper = 'div';
|
|
5
|
-
%>
|
|
6
|
-
<%- style !== 'styled-jsx' ? `import styles from './${fileName}.module.${style}';` : '' %>
|
|
7
|
-
<% }
|
|
8
|
-
%>
|
|
9
|
-
|
|
10
|
-
<% if (styledModule && styledModule !== 'styled-jsx') { %>
|
|
11
|
-
const StyledPage = styled.div`<%- pageStyleContent %>`;
|
|
12
|
-
<% }%>
|
|
13
|
-
|
|
14
|
-
export function Index() {
|
|
15
|
-
/*
|
|
16
|
-
* Replace the elements below with your own.
|
|
17
|
-
*
|
|
18
|
-
* Note: The corresponding styles are in the ./<%= fileName %>.<%= style %> file.
|
|
19
|
-
*/
|
|
20
|
-
return (
|
|
21
|
-
<<%= wrapper %><% if (!styledModule) {%> className={styles.page}<% } %>>
|
|
22
|
-
<%- styledModule === 'styled-jsx' ? `<style jsx>{\`${pageStyleContent}\`}</style>` : `` %>
|
|
23
|
-
<%- appContent %>
|
|
24
|
-
</<%= wrapper %>>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default Index;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AppProps } from 'next/app';
|
|
2
|
-
import Head from 'next/head';
|
|
3
|
-
import './styles.<%= stylesExt %>';
|
|
4
|
-
|
|
5
|
-
function CustomApp({ Component, pageProps }: AppProps) {
|
|
6
|
-
return (
|
|
7
|
-
<>
|
|
8
|
-
<Head>
|
|
9
|
-
<title>Welcome to <%= name %>!</title>
|
|
10
|
-
</Head>
|
|
11
|
-
<main className="app">
|
|
12
|
-
<Component {...pageProps}/>
|
|
13
|
-
</main>
|
|
14
|
-
</>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default CustomApp;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/display-name */
|
|
2
|
-
import Document, { Html, Head, Main, NextScript, DocumentContext, DocumentInitialProps } from 'next/document';
|
|
3
|
-
import { ServerStyleSheet } from 'styled-components';
|
|
4
|
-
|
|
5
|
-
export default class CustomDocument extends Document {
|
|
6
|
-
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
|
|
7
|
-
const originalRenderPage = ctx.renderPage;
|
|
8
|
-
|
|
9
|
-
const sheet = new ServerStyleSheet();
|
|
10
|
-
|
|
11
|
-
ctx.renderPage = () => originalRenderPage({
|
|
12
|
-
enhanceApp: (App) => (props) => sheet.collectStyles(<App {...props} />),
|
|
13
|
-
enhanceComponent: (Component) => Component,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const intialProps = await Document.getInitialProps(ctx);
|
|
17
|
-
const styles = sheet.getStyleElement();
|
|
18
|
-
|
|
19
|
-
return {...intialProps, styles };
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
render() {
|
|
23
|
-
return (
|
|
24
|
-
<Html>
|
|
25
|
-
<Head>{this.props.styles}</Head>
|
|
26
|
-
<body>
|
|
27
|
-
<Main />
|
|
28
|
-
<NextScript />
|
|
29
|
-
</body>
|
|
30
|
-
</Html>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<%- styleContent %>
|
|
File without changes
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import Index from '../pages/index';
|
|
5
|
-
|
|
6
|
-
describe('Index', () => {
|
|
7
|
-
it('should render successfully', () => {
|
|
8
|
-
const { baseElement } = render(<Index />);
|
|
9
|
-
expect(baseElement).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "<%= rootTsConfigPath %>",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
<% if (style === '@emotion/styled') { %>"jsxImportSource": "@emotion/react",<% } %>
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"strict": false,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"incremental": true
|
|
15
|
-
},
|
|
16
|
-
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "next-env.d.ts"],
|
|
17
|
-
"exclude": ["node_modules", "jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addCypress = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const linter_1 = require("@nrwl/linter");
|
|
7
|
-
const versions_1 = require("../../../utils/versions");
|
|
8
|
-
function addCypress(host, options) {
|
|
9
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
-
if (options.e2eTestRunner !== 'cypress') {
|
|
11
|
-
return () => { };
|
|
12
|
-
}
|
|
13
|
-
const { cypressProjectGenerator } = (0, devkit_1.ensurePackage)('@nrwl/cypress', versions_1.nxVersion);
|
|
14
|
-
return cypressProjectGenerator(host, Object.assign(Object.assign({}, options), { linter: linter_1.Linter.EsLint, name: `${options.name}-e2e`, directory: options.directory, project: options.projectName, skipFormat: true }));
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
exports.addCypress = addCypress;
|
|
18
|
-
//# sourceMappingURL=add-cypress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-cypress.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-cypress.ts"],"names":[],"mappings":";;;;AAAA,yCAAmD;AACnD,yCAAsC;AAEtC,sDAAoD;AAGpD,SAAsB,UAAU,CAAC,IAAU,EAAE,OAAyB;;QACpE,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,EAAE;YACvC,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;SACjB;QAED,MAAM,EAAE,uBAAuB,EAAE,GAAG,IAAA,sBAAa,EAE/C,eAAe,EAAE,oBAAS,CAAC,CAAC;QAC9B,OAAO,uBAAuB,CAAC,IAAI,kCAC9B,OAAO,KACV,MAAM,EAAE,eAAM,CAAC,MAAM,EACrB,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,MAAM,EAC3B,SAAS,EAAE,OAAO,CAAC,SAAS,EAC5B,OAAO,EAAE,OAAO,CAAC,WAAW,EAC5B,UAAU,EAAE,IAAI,IAChB,CAAC;IACL,CAAC;CAAA;AAhBD,gCAgBC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addJest = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const versions_1 = require("../../../utils/versions");
|
|
7
|
-
function addJest(host, options) {
|
|
8
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
-
if (options.unitTestRunner !== 'jest') {
|
|
10
|
-
return () => { };
|
|
11
|
-
}
|
|
12
|
-
const { jestProjectGenerator } = (0, devkit_1.ensurePackage)('@nrwl/jest', versions_1.nxVersion);
|
|
13
|
-
const jestTask = yield jestProjectGenerator(host, Object.assign(Object.assign({}, options), { project: options.projectName, supportTsx: true, skipSerializers: true, setupFile: 'none', compiler: 'babel', skipFormat: true }));
|
|
14
|
-
const tsConfigSpecJson = (0, devkit_1.readJson)(host, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.spec.json'));
|
|
15
|
-
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json'), (json) => {
|
|
16
|
-
var _a, _b, _c, _d;
|
|
17
|
-
var _e;
|
|
18
|
-
(_a = json.compilerOptions) !== null && _a !== void 0 ? _a : (json.compilerOptions = {});
|
|
19
|
-
(_b = (_e = json.compilerOptions).types) !== null && _b !== void 0 ? _b : (_e.types = []);
|
|
20
|
-
json.compilerOptions.types.push(...((_d = (_c = tsConfigSpecJson === null || tsConfigSpecJson === void 0 ? void 0 : tsConfigSpecJson.compilerOptions) === null || _c === void 0 ? void 0 : _c.types) !== null && _d !== void 0 ? _d : []));
|
|
21
|
-
return json;
|
|
22
|
-
});
|
|
23
|
-
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.spec.json'), (json) => {
|
|
24
|
-
json.compilerOptions.jsx = 'react';
|
|
25
|
-
// have to override exclude otherwise lint will fail with setParserOptionsProject and jest.config.ts
|
|
26
|
-
if (options.setParserOptionsProject) {
|
|
27
|
-
const tsConfig = (0, devkit_1.readJson)(host, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json'));
|
|
28
|
-
json.exclude = tsConfig.exclude.filter((e) => e !== 'jest.config.ts');
|
|
29
|
-
}
|
|
30
|
-
return json;
|
|
31
|
-
});
|
|
32
|
-
return jestTask;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
exports.addJest = addJest;
|
|
36
|
-
//# sourceMappingURL=add-jest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-jest.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-jest.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AAEtB,sDAAoD;AAGpD,SAAsB,OAAO,CAAC,IAAU,EAAE,OAAyB;;QACjE,IAAI,OAAO,CAAC,cAAc,KAAK,MAAM,EAAE;YACrC,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;SACjB;QAED,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAA,sBAAa,EAC5C,YAAY,EACZ,oBAAS,CACV,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,IAAI,kCAC3C,OAAO,KACV,OAAO,EAAE,OAAO,CAAC,WAAW,EAC5B,UAAU,EAAE,IAAI,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;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAxDD,0BAwDC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addLinting = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const linter_1 = require("@nrwl/linter");
|
|
6
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const lint_1 = require("@nrwl/react/src/utils/lint");
|
|
8
|
-
function addLinting(host, options) {
|
|
9
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
-
const lintTask = yield (0, linter_1.lintProjectGenerator)(host, {
|
|
11
|
-
linter: options.linter,
|
|
12
|
-
project: options.projectName,
|
|
13
|
-
tsConfigPaths: [
|
|
14
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
|
15
|
-
],
|
|
16
|
-
unitTestRunner: options.unitTestRunner,
|
|
17
|
-
eslintFilePatterns: [`${options.appProjectRoot}/**/*.{ts,tsx,js,jsx}`],
|
|
18
|
-
skipFormat: true,
|
|
19
|
-
});
|
|
20
|
-
if (options.linter === linter_1.Linter.EsLint) {
|
|
21
|
-
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(options.appProjectRoot, '.eslintrc.json'), (json) => {
|
|
22
|
-
var _a, _b, _c;
|
|
23
|
-
json = (0, lint_1.extendReactEslintJson)(json);
|
|
24
|
-
// Turn off @next/next/no-html-link-for-pages since there is an issue with nextjs throwing linting errors
|
|
25
|
-
// TODO(nicholas): remove after Vercel updates nextjs linter to only lint ["*.ts", "*.tsx", "*.js", "*.jsx"]
|
|
26
|
-
json.ignorePatterns = [...json.ignorePatterns, '.next/**/*'];
|
|
27
|
-
json.rules = Object.assign({ '@next/next/no-html-link-for-pages': 'off' }, json.rules);
|
|
28
|
-
// Find the override that handles both TS and JS files.
|
|
29
|
-
const commonOverride = (_a = json.overrides) === null || _a === void 0 ? void 0 : _a.find((o) => ['*.ts', '*.tsx', '*.js', '*.jsx'].every((ext) => o.files.includes(ext)));
|
|
30
|
-
if (commonOverride) {
|
|
31
|
-
// Only set parserOptions.project if it already exists (defined by options.setParserOptionsProject)
|
|
32
|
-
if ((_b = commonOverride.parserOptions) === null || _b === void 0 ? void 0 : _b.project) {
|
|
33
|
-
commonOverride.parserOptions.project = [
|
|
34
|
-
`${options.appProjectRoot}/tsconfig(.*)?.json`,
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
// Configure custom pages directory for next rule
|
|
38
|
-
if (commonOverride.rules) {
|
|
39
|
-
commonOverride.rules = Object.assign(Object.assign({}, commonOverride.rules), { '@next/next/no-html-link-for-pages': [
|
|
40
|
-
'error',
|
|
41
|
-
`${options.appProjectRoot}/pages`,
|
|
42
|
-
] });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
(_c = json.extends) !== null && _c !== void 0 ? _c : (json.extends = []);
|
|
46
|
-
if (typeof json.extends === 'string') {
|
|
47
|
-
json.extends = [json.extends];
|
|
48
|
-
}
|
|
49
|
-
// add next.js configuration
|
|
50
|
-
json.extends.unshift(...['next', 'next/core-web-vitals']);
|
|
51
|
-
// remove nx/react plugin, as it conflicts with the next.js one
|
|
52
|
-
json.extends = json.extends.filter((name) => name !== 'plugin:@nrwl/nx/react');
|
|
53
|
-
json.extends.unshift('plugin:@nrwl/nx/react-typescript');
|
|
54
|
-
if (!json.env) {
|
|
55
|
-
json.env = {};
|
|
56
|
-
}
|
|
57
|
-
json.env.jest = true;
|
|
58
|
-
return json;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
62
|
-
return (0, devkit_1.runTasksInSerial)(lintTask, installTask);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
exports.addLinting = addLinting;
|
|
66
|
-
//# sourceMappingURL=add-linting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-linting.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-linting.ts"],"names":[],"mappings":";;;;AAAA,yCAA4D;AAC5D,yCAOsB;AACtB,qDAGoC;AAGpC,SAAsB,UAAU,CAC9B,IAAU,EACV,OAAyB;;QAEzB,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAoB,EAAC,IAAI,EAAE;YAChD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,WAAW;YAC5B,aAAa,EAAE;gBACb,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC;aAC/D;YACD,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,kBAAkB,EAAE,CAAC,GAAG,OAAO,CAAC,cAAc,uBAAuB,CAAC;YACtE,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,MAAM,EAAE;YACpC,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,gBAAgB,CAAC,EAC3D,CAAC,IAAI,EAAE,EAAE;;gBACP,IAAI,GAAG,IAAA,4BAAqB,EAAC,IAAI,CAAC,CAAC;gBAEnC,yGAAyG;gBACzG,4GAA4G;gBAE5G,IAAI,CAAC,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;gBAE7D,IAAI,CAAC,KAAK,mBACR,mCAAmC,EAAE,KAAK,IACvC,IAAI,CAAC,KAAK,CACd,CAAC;gBAEF,uDAAuD;gBACvD,MAAM,cAAc,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CA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GAAG,IAAI,CAAC;gBAErB,OAAO,IAAI,CAAC;YACd,CAAC,CACF,CAAC;SACH;QAED,MAAM,WAAW,GAAG,IAAA,qCAA4B,EAC9C,IAAI,EACJ,8BAAuB,CAAC,YAAY,EACpC,8BAAuB,CAAC,eAAe,CACxC,CAAC;QAEF,OAAO,IAAA,yBAAgB,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACjD,CAAC;CAAA;AAtFD,gCAsFC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addProject = void 0;
|
|
4
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
function addProject(host, options) {
|
|
6
|
-
const targets = {};
|
|
7
|
-
targets.build = {
|
|
8
|
-
executor: '@nrwl/next:build',
|
|
9
|
-
outputs: ['{options.outputPath}'],
|
|
10
|
-
defaultConfiguration: 'production',
|
|
11
|
-
options: {
|
|
12
|
-
root: options.appProjectRoot,
|
|
13
|
-
outputPath: (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot),
|
|
14
|
-
},
|
|
15
|
-
configurations: {
|
|
16
|
-
development: {
|
|
17
|
-
outputPath: options.appProjectRoot,
|
|
18
|
-
},
|
|
19
|
-
production: {},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
targets.serve = {
|
|
23
|
-
executor: '@nrwl/next:server',
|
|
24
|
-
defaultConfiguration: 'development',
|
|
25
|
-
options: {
|
|
26
|
-
buildTarget: `${options.projectName}:build`,
|
|
27
|
-
dev: true,
|
|
28
|
-
},
|
|
29
|
-
configurations: {
|
|
30
|
-
development: {
|
|
31
|
-
buildTarget: `${options.projectName}:build:development`,
|
|
32
|
-
dev: true,
|
|
33
|
-
},
|
|
34
|
-
production: {
|
|
35
|
-
buildTarget: `${options.projectName}:build:production`,
|
|
36
|
-
dev: false,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
if (options.server) {
|
|
41
|
-
targets.serve.options = Object.assign(Object.assign({}, targets.serve.options), { customServerPath: options.server });
|
|
42
|
-
}
|
|
43
|
-
targets.export = {
|
|
44
|
-
executor: '@nrwl/next:export',
|
|
45
|
-
options: {
|
|
46
|
-
buildTarget: `${options.projectName}:build:production`,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
const project = {
|
|
50
|
-
root: options.appProjectRoot,
|
|
51
|
-
sourceRoot: options.appProjectRoot,
|
|
52
|
-
projectType: 'application',
|
|
53
|
-
targets,
|
|
54
|
-
tags: options.parsedTags,
|
|
55
|
-
};
|
|
56
|
-
(0, devkit_1.addProjectConfiguration)(host, options.projectName, Object.assign({}, project), options.standaloneConfig);
|
|
57
|
-
}
|
|
58
|
-
exports.addProject = addProject;
|
|
59
|
-
//# sourceMappingURL=add-project.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/add-project.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAEtB,SAAgB,UAAU,CAAC,IAAU,EAAE,OAAyB;IAC9D,MAAM,OAAO,GAAwB,EAAE,CAAC;IAExC,OAAO,CAAC,KAAK,GAAG;QACd,QAAQ,EAAE,kBAAkB;QAC5B,OAAO,EAAE,CAAC,sBAAsB,CAAC;QACjC,oBAAoB,EAAE,YAAY;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,cAAc;YAC5B,UAAU,EAAE,IAAA,0BAAiB,EAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;SAC9D;QACD,cAAc,EAAE;YACd,WAAW,EAAE;gBACX,UAAU,EAAE,OAAO,CAAC,cAAc;aACnC;YACD,UAAU,EAAE,EAAE;SACf;KACF,CAAC;IAEF,OAAO,CAAC,KAAK,GAAG;QACd,QAAQ,EAAE,mBAAmB;QAC7B,oBAAoB,EAAE,aAAa;QACnC,OAAO,EAAE;YAC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