GithubHelp home page GithubHelp logo

dev-thought / nx-plugins Goto Github PK

View Code? Open in Web Editor NEW
76.0 6.0 7.0 4.03 MB

A collection of NX plugins baked with love ;)

License: MIT License

TypeScript 98.93% JavaScript 1.07%
schematics pulumi angular code-as-infrastructure nestjs angular-universal infrastructure angular-workspaces nx-workspace

nx-plugins's Introduction

Dev Thought - Nx Plugins

ng-deploy-it was refactored to be a nx plugin and with this change this repository will contain all nx plugins provided by Dev Thought.

The migration process for old ng-deploy-it can be fonund in the plugin documentation.

Welcome to our nx plugins repository

You can find here a collection (currently just one but who knows what the future brings :P) of usefull plugins which are usable in nx and the angular cli.

You are done with your application! But without deploying somewhere, nobody can enjoy it!

With NxDeployIt your live gets easier! Use it to deploy your applications to your favorite cloud provider! It can even autodetect the supported applications in your nx workspace ❤️

nx-plugins's People

Contributors

dependabot[bot] avatar elena-dev-thought avatar klebersyd avatar mitkotschimev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nx-plugins's Issues

Angular universal application on google cloud platform

Describe the solution you'd like
Deploy my angular universal application to GCP

Describe alternatives you've considered
As google function or server?

Check which provider is affected:
[] Azure
[] AWS
[x] Google Cloud Platform

Provide connection between apps

Is your feature request related to a problem? Please describe.
It's nice to be able to deploy frontend and backends now but they are not connected to each other.

Describe the solution you'd like
It would be nice if I could configure a connection between the apps. e.g.: react with express and the deployment self will take care to provide the API deployment URL to the frontend somehow.

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Align output variables for static, cdn and domain

Currently, all providers have different output namings.

They need to be aligned. What are the best names?

Outputs:
- cdnEndpoint                 : "https://cdn-xxxx.azureedge.net/"
- staticEndpoint              : "https://accountXXXX.z7.web.core.windows.net/"
- customDomainOutput          : "https://my-custom-domain.com/"

React application on Azure

Describe the solution you'd like
Deploy my react application to Azure

Check which provider is affected:
[x] Azure
[] AWS
[] Google Cloud Platform

New provider digital ocean

Is your feature request related to a problem? Please describe.
I want to use digital ocean as provider.

Describe the solution you'd like
Integrate digital ocean as provider for nx-deploy-it

Check which provider is affected:
[] Azure
[] AWS
[] Google Cloud Platform

Refactor to nx plugin

Is your feature request related to a problem? Please describe.
Better support for testing and structure

Describe the solution you'd like
Rewrite to nx plugin

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Extend Documentation (Onboarding)

The CLI asks at the moment a lot of questions. All of them can be clarified by going to the Pulumi website but it would be easier to make a summary with the necessary links.

This would help new developers to understand quicker what they get asked.

npm WARN deprecated @zeit/[email protected]: @zeit/ncc is no longer maintained. Please use @vercel/ncc instead.

Describe the bug
A clear and concise description of what the bug is.
so I just ran 'npx ng add @dev-thought/nx-deploy-it' and received this:
An unhandled exception occurred: npm WARN deprecated @zeit/[email protected]: @zeit/ncc is no longer maintained. Please use @vercel/ncc instead.
To Reproduce
create new project with and try to run

Expected behavior
A clear and concise description of what you expected to happen.

Logs
Installing packages for tooling via npm. An unhandled exception occurred: npm WARN deprecated @zeit/[email protected]: @zeit/ncc is no longer maintained. Please use @vercel/ncc instead. An error occurred while unpacking: Error: Unexpected end of data npm WARN [email protected] requires a peer of @angular/compiler@>=2.3.1 <9.0.0 || >8.0.0-beta <9.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of @angular/core@>=2.3.1 <9.0.0 || >8.0.0-beta <9.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of tslint@^5.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 40 npm ERR! @dev-thought/[email protected] postinstall: node src/install-pulumi npm ERR! Exit status 40 npm ERR! npm ERR! Failed at the @dev-thought/[email protected] postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/pablo/.npm/_logs/2020-12-07T14_23_22_155Z-debug.log Package install failed, see above. See "/tmp/ng-mY2VJ2/angular-errors.log" for further details.
Application type:
[x] Angular
[] NestJS

Provider:
[x] AWS
[] Azure
[] Google Cloud Platform

nx-deploy-it version
0.2.2

Additional context
Could you please take a look? probably an update of that @zeit/ncc might help

Github actions for tests

Is your feature request related to a problem? Please describe.
Currently, the PR's have no quality gate and we need to provide one.

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Make init, deploy & destroy more abstract for easier adaptions

Is your feature request related to a problem? Please describe.
Currently, it just grows and it will reach a point where it is not maintainable anymore without huge efforts.

Describe the solution you'd like
An adapter layer needs to be implemented.

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Problem with installation on Windows 10

Describe the bug
I just ran 'npx ng add @dev-thought/nx-deploy-it' and received this
Unfortunately, your platform and architecture (win32, x64) isn't currently supported by Pulumi. Please uninstall this package.

To Reproduce
Install on Windows 10

Expected behavior
successful installation

Logs
npm ERR! code ELIFECYCLE
npm ERR! errno 10
npm ERR! @dev-thought/[email protected] postinstall: node src/install-pulumi
npm ERR! Exit status 10
npm ERR!
npm ERR! Failed at the @dev-thought/[email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Application type:
[x] Angular
[x] NestJS

Provider:
[] AWS
[] Azure
[x] Google Cloud Platform

nx-deploy-it version
0.2.2

Additional context
Pulumi supports Win 10.

Angular universal application on Azure

Describe the solution you'd like
Deploy my angular universal application to Azure

Describe alternatives you've considered
As azure function or server?

Check which provider is affected:
[x] Azure
[] AWS
[] Google Cloud Platform

Update to Pulumi 2.0

Is your feature request related to a problem? Please describe.
Update to the new major version 2.0 of pulumi

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Predictive infrastructure as code on ng add

Describe the solution you'd like
When I add ng-deploy-it with ng add than I want to get a suggestion which applications can be created for deployment and helps me via the CLI to set them up.

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Nx 11 workspace error while running deploy

Describe the bug
Clean nx 11 mono repo, added deploy-it and configured correctly.

When I run yarn ng deploy appName the CLI throws this error

workspace_1.readWorkspaceConfigPath is not a function

I did some digging into @nrwl/workspace and it looks like in NX 11 readWorkspaceConfigPath was remove and replace with getWorkspace within the devkit.

Application type:
[x] Angular
[x] NestJS

Provider:
[x] AWS
[] Azure
[] Google Cloud Platform

nx-deploy-it version
1.5.0

Make ng-deploy-it NX native workspace compatible

Is your feature request related to a problem? Please describe.
At the moment only NX workspace with angular structure is supported

Describe the solution you'd like
Native NX workspace should be supported too

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Kubernetes integration

Would be really nice if we could deploy our applications to Docker Hub - for example :-)

Deployments to cloud providers are great but ability to deploy to docker hub (or even a private docker registry) - would open up a lot.

Deploy with Custom Webpack

Describe Feature
Create an option to deploy with custom webpack builders for angular build facade.

To Reproduce:
Always when I need to use a custom webpack I should change application-type.js to deploy.
I have tested only for Azure.
https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack

Solution:

Add

function isAngularCustomWebpack(targets: TargetDefinitionCollection): boolean {
  const build = getTarget(targets, 'build');
  if (!build) {
    return false;
  }
  return build.builder === '@angular-builders/custom-webpack:browser';
}

export function getApplicationType(
  targets: TargetDefinitionCollection,
  host?: Tree
): ApplicationType {
  if (!targets) {
    return null;
  }

  if (isNestJS(targets, host)) {
    return ApplicationType.NESTJS;
  }
  if (isExpressJS(targets)) {
    return ApplicationType.EXPRESS;
  }

  if (isAngularUniversal(targets)) {
    return ApplicationType.ANGULAR_UNIVERSAL;
  }
  if (isAngular(targets)) {
    return ApplicationType.ANGULAR;
  }
  if (isAngularCustomWebpack(targets)) {
    return ApplicationType.ANGULAR;
  }
  if (isReact(targets)) {
    return ApplicationType.REACT;
  }

  return null;
}

Aplication Type:
[x] Angular
[] NestJS

Prodiver:
[] Azure
[] AWS
[] Google Cloud Platform

Additional:
The package is not an official package, maybe other option as a parameter can be better to run a deploy

No applications selected. Skipping setup Nothing to be done.

Describe the bug
After running npx ng add @dev-thought/nx-deploy-it and choosing the project in my NX Workspace, i get the message that nothing was selected.

To Reproduce
Steps to reproduce the behavior:

  1. Create new NX Workspace
  2. Run npx ng add @dev-thought/nx-deploy-it
  3. Choose your project

Expected behavior
Deploy to Cloud provider

Logs
Output:
No applications selected. Skipping setup
Nothing to be done.

Application type:
Win 10
package.json
{
"name": "test-deploy",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "nx",
"postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main",
"start": "nx serve",
"build": "nx build",
"test": "nx test"
},
"private": true,
"dependencies": {
"@angular/animations": "^12.2.0",
"@angular/common": "^12.2.0",
"@angular/compiler": "^12.2.0",
"@angular/core": "^12.2.0",
"@angular/forms": "^12.2.0",
"@angular/platform-browser": "^12.2.0",
"@angular/platform-browser-dynamic": "^12.2.0",
"@angular/router": "^12.2.0",
"@dev-thought/nx-deploy-it": "^2.0.0",
"@nrwl/angular": "12.10.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.0",
"@angular-eslint/eslint-plugin": "~12.3.0",
"@angular-eslint/eslint-plugin-template": "~12.3.0",
"@angular-eslint/template-parser": "~12.3.0",
"@angular/cli": "~12.2.0",
"@angular/compiler-cli": "^12.2.0",
"@angular/language-service": "^12.2.0",
"@nrwl/cli": "12.10.0",
"@nrwl/cypress": "12.10.0",
"@nrwl/eslint-plugin-nx": "12.10.0",
"@nrwl/jest": "12.10.0",
"@nrwl/linter": "12.10.0",
"@nrwl/tao": "12.10.0",
"@nrwl/workspace": "12.10.0",
"@types/jest": "27.0.2",
"@types/node": "14.14.33",
"@typescript-eslint/eslint-plugin": "~4.31.1",
"@typescript-eslint/parser": "~4.31.1",
"cypress": "^8.3.0",
"eslint": "7.22.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-cypress": "^2.10.3",
"jest": "27.2.3",
"jest-preset-angular": "10.0.1",
"prettier": "^2.3.1",
"ts-jest": "27.0.5",
"typescript": "~4.3.5"
}
}

Provider:
[] AWS
[] Azure
[] Google Cloud Platform

nx-deploy-it version
0.2.2

Additional context
Add any other context about the problem here.

Deploying arbitrary services

Is your feature request related to a problem? Please describe.
This isn't specifically a feature request... more a discussion as to how best to do things.

Alongside my static app and API I might want to deploy other services (database, auth, etc.). These don't necessarily belong to a specific API or static app so I was wondering if you have any advice on how to go about adding these?

So far I've altered an API to include cognito + dynamodb to deploy with pulumi but ideally I'd have these elsewhere in their own applications/services as they won't change very often.

Describe the solution you'd like
Locally I've created a dynamodb app within nx. This is made up of a docker-compose file to run the database locally with a serve command and nothing else. My thinking is that I would be able to run deploy-it to generate a dynamodb pulumi app in the same way I can with an express app.

Describe alternatives you've considered

1. Base Infrastructure

I've considered is that this plugin can create its own application with some base/blueprint infrastructure where the user can add things that span multiple apps or won't change often. This could include things like a VPC, Database etc. but would be completely up to the user to build this out.

2. Pulumi wrapper

Another alternative is to create my own wrapper around pulumi, but that feels like duplicating the work you've already achieved here.

3. Pulumi directly

I could also add a pulumi file to the monorepo core somewhere and use pulumi directly.

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

I've talked about AWS services in my examples since that's what I'm using but this could apply to any provider.

Additional context
I think I've covered this above. If you want more info let me know.

nx-deploy-it could not be installed

Describe the bug
When I am trying to install nx-deploy-it package fails with error Failed at the @dev-thought/[email protected] postinstall script.

To Reproduce
run npx nx add @dev-thought/nx-deploy-it

Logs

npm ERR! code ELIFECYCLE
npm ERR! errno 40
npm ERR! @dev-thought/[email protected] postinstall: `node src/install-pulumi`
npm ERR! Exit status 40
npm ERR!
npm ERR! Failed at the @dev-thought/[email protected] postinstall script.

Application type:
[x] Angular
[x] NestJS

Provider:
[] AWS
[x] Azure
[] Google Cloud Platform

nx-deploy-it version
2.0.0

Evaluate: Refactor to nx plugin system

Is your feature request related to a problem? Please describe.
Currently, there are to less statistics if we can drop angular cli support and just stick to nx (support).
If we take the bigger view than we see that ng-deploy-it is made for mono repositories and this perfects just perfect to NX.

So the question is if we can drop the angular cli support. Or is the new nx plugin system supporting native angular cli?

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Error “Cannot find project” when installing plugin

The error appears just as I try to add the plugin to the freshly generated nx project.

~ npx create-nx-workspace@latest deploy-it-test
~ cd deploy-it-test
~ nx add @dev-thought/nx-deploy-it

>  NX   Cannot find project '@dev-thought/nx-deploy-it'

image

The latest nx version today is 14.2.4

Extend nx-deploy-it with tests

Is your feature request related to a problem? Please describe.
To less tests makes the testing afford to high if more features are getting implemented

Describe the solution you'd like
More tests :)

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Provide a generic way to deploy container based on @pulumi/cloud

Is your feature request related to a problem? Please describe.
Missing deployment templates/setup for containers

Describe the solution you'd like
With the usage of @pulumi/cloud, we can support the most major providers and are able to have a common template.

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

What do we need to consider?

  • Custom VPC support still available?
  • ...

Use AWS sync cli command

Change the logic to use the same approach as in azure with the storage sync resource.

Much faster and more reliable.

Adding nx-deploy-it plugin results in error

Describe the bug
When I follow the installation instructions precisely (either from the README or from https://medium.com/dev-thought/introducing-nx-deployit-e5cfe89b810c), I get an error https://medium.com/dev-thought/introducing-nx-deployit-e5cfe89b810c

To Reproduce
Steps to reproduce the behavior:

1 Install pulumi (version 2.25) and azure CLI, login to Azure (not sure if this step is necessary, but did it anyway)
2. Run npx create-nx-workspace@latest advanced-deployments --preset="angular-nest" --appName="i-love-iac" --style="scss"
3. Run npx nx add @dev-thought/nx-deploy-it

  • Select both projects (i-love-iac and api)
  • Chose Azure with switzerlandnorth (others wouldn't work either)
  1. Exits with an error Can not find generated pulumi package.json, only adding @dev-thought/nx-deploy-it dependency to package.json, nothing more

Expected behavior
I would expect the plugin to be installed and configure the pulumi deployment files

Logs

Here's the output from the nx add:

PS C:\prog\projects\inftec\testing\advanced-deployments> npx nx add @dev-thought/nx-deploy-it
ℹ Using package manager: npm
✔ Found compatible package version: @dev-thought/[email protected].
✔ Package information loaded.
✔ Package successfully installed.
    We found 2 supported applications.
√ Please select the applications you want to setup. If you don't select one, you will skip this process and you can do it later again. · i-love-iac (angular), api (nestjs)

√ provider · Azure
√ The Azure location to deploy into: · switzerlandnorth
Can not find generated pulumi package.json
PS C:\prog\projects\inftec\testing\advanced-deployments>

It exits with Can not find generated pulumi package.json

Application type:
[x] Angular
[x] NestJS

Provider:
[] AWS
[x] Azure
[] Google Cloud Platform

nx-deploy-it version
2.0.0

Version of nx: 12.0.8

Additional context
I've looked at https://github.com/Dev-Thought/nx-deploy-it-examples and saw that it has the 'infrastructure' sub folders in the app folders.

I've also seen where the error is output:

throw new Error('Can not find generated pulumi package.json');

But I don't understand why it's not working...

Angular universal application in AWS

Describe the solution you'd like
Deploy my angular universal application to AWS

Describe alternatives you've considered
As lambda or server?

Check which provider is affected:
[] Azure
[x] AWS
[] Google Cloud Platform

React application on AWS

Describe the solution you'd like
Deploy my react application to AWS

Check which provider is affected:
[] Azure
[x] AWS
[] Google Cloud Platform

Make ng-deploy-it angular cli workspace compatible

Is your feature request related to a problem? Please describe.
At the moment only NX workspace with angular structure is supported

Describe the solution you'd like
Pure angular CLI workspace should be supported too

Check which provider is affected:
[x] Azure
[x] AWS
[x] Google Cloud Platform

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.