ZachJW34 / nx-plus

Collection of Nx Community Plugins
MIT License
302 stars 51 forks source link

Support Docusaurus deployments #65

Open BuckyMaler opened 4 years ago

BuckyMaler commented 4 years ago

Description

Support the Docusaurus deployment options listed here.

Suggested Implementation

Add a builder for deploying a Docusaurus website.

MauriceNino commented 2 years ago

@ZachJW34 are there any plans to implement this, or alternatively write some documentation on how to do it yourself?

ZachJW34 commented 2 years ago

I don't plan on implementing this anytime soon. If you're interested, a community contribution would be great! I can help out along the way

MauriceNino commented 2 years ago

I will look into it when I have time. Problem is mainly the beforeCli check in docusaurus. But I bypassed that, by directly calling the deploy function without going through the cli.

deploy.ts at root:

import deploy from '@docusaurus/core/lib/commands/deploy';

deploy(__dirname, {
  skipBuild: true,
  outDir: '../../dist/apps/docs',
});

And a new script in the docs project:

    "deploy": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/docs",
        "command": "ts-node deploy.ts"
      }
    }

It might not be super pretty, but it works.

What do you think of this solution? Should I add it to the project?