Skip to content

Commit

Permalink
fix(nextjs): Remove deprecated export executor (#28702)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
ndcunningham authored Oct 31, 2024
1 parent 51bed0e commit faf4483
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 231 deletions.
8 changes: 0 additions & 8 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -8747,14 +8747,6 @@
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "export",
"path": "/nx-api/next/executors/export",
"name": "export",
"children": [],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
Expand Down
9 changes: 0 additions & 9 deletions docs/generated/manifests/nx-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1531,15 +1531,6 @@
"originalFilePath": "/packages/next/src/executors/server/schema.json",
"path": "/nx-api/next/executors/server",
"type": "executor"
},
"/nx-api/next/executors/export": {
"description": "Export a Next.js application. The exported application is located at `dist/$outputPath/exported`.",
"file": "generated/packages/next/executors/export.json",
"hidden": false,
"name": "export",
"originalFilePath": "/packages/next/src/executors/export/schema.json",
"path": "/nx-api/next/executors/export",
"type": "executor"
}
},
"generators": {
Expand Down
9 changes: 0 additions & 9 deletions docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1511,15 +1511,6 @@
"originalFilePath": "/packages/next/src/executors/server/schema.json",
"path": "next/executors/server",
"type": "executor"
},
{
"description": "Export a Next.js application. The exported application is located at `dist/$outputPath/exported`.",
"file": "generated/packages/next/executors/export.json",
"hidden": false,
"name": "export",
"originalFilePath": "/packages/next/src/executors/export/schema.json",
"path": "next/executors/export",
"type": "executor"
}
],
"generators": [
Expand Down
41 changes: 0 additions & 41 deletions docs/generated/packages/next/executors/export.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/shared/reference/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@
- [executors](/nx-api/next/executors)
- [build](/nx-api/next/executors/build)
- [server](/nx-api/next/executors/server)
- [export](/nx-api/next/executors/export)
- [generators](/nx-api/next/generators)
- [init](/nx-api/next/generators/init)
- [application](/nx-api/next/generators/application)
Expand Down
1 change: 0 additions & 1 deletion e2e/next/src/next-legacy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ describe('@nx/next (legacy)', () => {
checkUnitTest: true,
checkLint: true,
checkE2E: isNotWindows(),
checkExport: false,
appsDir: 'packages',
});

Expand Down
6 changes: 0 additions & 6 deletions e2e/next/src/next-styles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe('Next.js Styles', () => {
checkUnitTest: false,
checkLint: false,
checkE2E: false,
checkExport: false,
});

const scApp = uniq('app');
Expand All @@ -52,7 +51,6 @@ describe('Next.js Styles', () => {
checkUnitTest: true,
checkLint: false,
checkE2E: false,
checkExport: false,
});

const scAppWithAppRouter = uniq('app');
Expand All @@ -65,7 +63,6 @@ describe('Next.js Styles', () => {
checkUnitTest: false, // No unit tests for app router
checkLint: false,
checkE2E: false,
checkExport: false,
});

const emotionApp = uniq('app');
Expand All @@ -78,7 +75,6 @@ describe('Next.js Styles', () => {
checkUnitTest: true,
checkLint: false,
checkE2E: false,
checkExport: false,
});
}, 600_000);

Expand All @@ -94,7 +90,6 @@ describe('Next.js Styles', () => {
checkUnitTest: true,
checkLint: false,
checkE2E: false,
checkExport: false,
});

checkFilesExist(`${tailwindApp}/tailwind.config.js`);
Expand All @@ -119,7 +114,6 @@ describe('Next.js Styles', () => {
checkUnitTest: true,
checkLint: false,
checkE2E: false,
checkExport: false,
});

checkFilesExist(`${tailwindApp}/tailwind.config.js`);
Expand Down
3 changes: 0 additions & 3 deletions e2e/next/src/next.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ describe('Next.js Applications', () => {
checkUnitTest: true,
checkLint: true,
checkE2E: false,
checkExport: false,
});

// Consume a JS lib
Expand Down Expand Up @@ -128,7 +127,6 @@ describe('Next.js Applications', () => {
checkUnitTest: true,
checkLint: true,
checkE2E: false,
checkExport: false,
});
}, 300_000);

Expand All @@ -144,7 +142,6 @@ describe('Next.js Applications', () => {
checkUnitTest: false,
checkLint: false,
checkE2E: false,
checkExport: false,
});
}, 300_000);

Expand Down
1 change: 0 additions & 1 deletion e2e/next/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export async function checkApp(
checkUnitTest: boolean;
checkLint: boolean;
checkE2E: boolean;
checkExport: boolean;
appsDir?: string;
}
) {
Expand Down
2 changes: 1 addition & 1 deletion nx-dev/nx-dev-e2e/src/packages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const pages: Array<{ title: string; path: string }> = [
{ title: '@nx/next:library', path: '/packages/next/generators/library' },
{ title: '@nx/next:build', path: '/packages/next/executors/build' },
{ title: '@nx/next:server', path: '/packages/next/executors/server' },
{ title: '@nx/next:export', path: '/packages/next/executors/export' },

{ title: '@nx/node', path: '/packages/node' },
{ title: '@nx/node:init', path: '/packages/node/generators/init' },
{
Expand Down
6 changes: 0 additions & 6 deletions packages/next/executors.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
"implementation": "./src/executors/server/server.impl",
"schema": "./src/executors/server/schema.json",
"description": "Serve a Next.js application."
},
"export": {
"implementation": "./src/executors/export/export.impl",
"schema": "./src/executors/export/schema.json",
"description": "Export a Next.js application. The exported application is located at `dist/$outputPath/exported`.",
"x-deprecated": "Use static exports in next.config.js instead. See: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports."
}
}
}
1 change: 0 additions & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"copy-webpack-plugin": "^10.2.4",
"file-loader": "^6.2.0",
"ignore": "^5.0.4",
"picocolors": "^1.1.0",
"semver": "^7.5.3",
"tslib": "^2.3.0",
"webpack-merge": "^5.8.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/plugins/with-nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function getNxContext(
parseTargetString(targetOptions.devServerTarget, partialExecutorContext)
);
} else if (targetOptions.buildTarget) {
// Executors such as @nx/next:server or @nx/next:export define the buildTarget option.
// Executors such as @nx/next:server define the buildTarget option.
return getNxContext(
graph,
parseTargetString(targetOptions.buildTarget, partialExecutorContext)
Expand Down
84 changes: 0 additions & 84 deletions packages/next/src/executors/export/export.impl.ts

This file was deleted.

30 changes: 0 additions & 30 deletions packages/next/src/executors/export/schema.json

This file was deleted.

3 changes: 1 addition & 2 deletions packages/next/src/generators/application/application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ describe('app (legacy)', () => {
}
});

it('should generate build serve and export targets', async () => {
it('should generate build and serve targets', async () => {
const name = uniq();

await applicationGenerator(tree, {
Expand All @@ -832,7 +832,6 @@ describe('app (legacy)', () => {
const projectConfiguration = readProjectConfiguration(tree, name);
expect(projectConfiguration.targets.build).toBeDefined();
expect(projectConfiguration.targets.serve).toBeDefined();
expect(projectConfiguration.targets.export).toBeDefined();
});
});

Expand Down
7 changes: 0 additions & 7 deletions packages/next/src/generators/application/lib/add-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ export function addProject(host: Tree, options: NormalizedSchema) {
},
},
};

targets.export = {
executor: '@nx/next:export',
options: {
buildTarget: `${options.projectName}:build:production`,
},
};
}

const project: ProjectConfiguration = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,7 @@
}
}
},
"export": {
"executor": "@nx/next:export",
"options": { "buildTarget": "nextapp:build:production" }
},

"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
Expand Down
Loading

0 comments on commit faf4483

Please sign in to comment.