Coder Social home page Coder Social logo

bikecoders / ngx-deploy-npm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from angular-schule/ngx-deploy-starter

107.0 3.0 14.0 9.1 MB

Publish your libraries to NPM with just one command

Home Page: https://www.npmjs.com/package/ngx-deploy-npm

License: MIT License

TypeScript 92.13% JavaScript 5.52% Shell 2.34%
nx npm npm-package angular ng-deploy npm-publish nx-plugin

ngx-deploy-npm's Issues

Dockerize sonarqube

Create a docker-compose.yml file to dockerize sonarqube for local development.

This is gonna improve the speed of sonar tweaking.

There are some of the commands used:

docker run \
    --rm \
    -e SONAR_HOST_URL="http://host.docker.internal:9000" \
    -v "`pwd`:/usr/src" \
    sonarsource/sonar-scanner-cli /bin/bash -c 'sonar-scanner \
        -Dsonar.host.url=$SONAR_HOST_URL \
        -Dsonar.login=local \
        -Dsonar.password=12345'
docker start sonarqube --interactive
docker run --name=sonarqube -p 9000:9000 sonarqube

Auto increment version?

I can enable auto increment version?
Example:
{
"version": "2.0.0"
}
nx deploy library --auto-increment
{
"version: "2.0.1"
}

Option to ignore packages already published error

Hello! This is a feature request to get a configuration to ignore the following failure:

npm ERR! 400 Bad Request - PUT https://npm.pkg.github.com/@spaceribs%2fservice-window-ref - failed to stream package from json: unhandled input: Cannot publish over existing version.

The reason why is that I'm using this alongside: https://github.com/jscutlery/semver in an Nx monorepo, and changes that occur to say the top level package.json are not guaranteed to bump the package version. At the moment, I'm just ignoring errors for my final publishing step, but it would be much better if I could just ignore if the package already exists.

--prod is no longer needed for library modules

my repo: https://github.com/xmlking/ngx-starter-kit
when I run

ng deploy ngx-utils --dry-run

I am getting error.

according to angular/angular-cli#12290

the --prod is no longer needed as the library is always build in AOT mode and without the --prod it does clean the previous files as well.

Error

Error when trying to deploy:
Error: Configuration 'production' is not set in the workspace.
    at WorkspaceNodeModulesArchitectHost.getOptionsForTarget (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:72:19)
    at ArchitectTargetJobRegistry.get (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/architect/src/architect.js:155:24)
    at MergeMapSubscriber.project (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/src/experimental/jobs/fallback-registry.js:23:81)
    at MergeMapSubscriber._tryNext (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
    at MergeMapSubscriber._next (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/node_modules/rxjs/internal/util/subscribeToArray.js:5:20)
    at Observable._trySubscribe (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:30:22)
    at MergeMapOperator.call (/Developer/Work/SPA/ngx-starter-kit/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/mergeMap.js:39:23)

my lib module in angular.json

    "ngx-utils": {
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-ng-packagr:build",
          "options": {
            "project": "libs/ngx-utils/ng-package.json",
            "tsConfig": "libs/ngx-utils/tsconfig.lib.json"
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "exclude": ["**/node_modules/**", "!libs/ngx-utils/**"],
            "tsConfig": ["libs/ngx-utils/tsconfig.lib.json", "libs/ngx-utils/tsconfig.spec.json"]
          }
        },
        "test": {
          "builder": "@nrwl/jest:jest",
          "options": {
            "jestConfig": "libs/ngx-utils/jest.config.js",
            "setupFile": "libs/ngx-utils/src/test-setup.ts",
            "tsConfig": "libs/ngx-utils/tsconfig.spec.json"
          }
        },
        "deploy": {
          "builder": "ngx-deploy-npm:deploy",
          "options": {
            "access": "public"
          }
        }
      },
      "prefix": "ngx",
      "projectType": "library",
      "root": "libs/ngx-utils",
      "sourceRoot": "libs/ngx-utils/src"
    },

How to reproduce

ng new my-project --create-application false
ng generate library my-lib
ng generate application my-app
ng add ngx-deploy-npm
ng deploy my-lib --dry-run 

Create a reusable workflow for sonar analysis

Right now, we have almost an identical sonarqube job for pr analysis and main analysis.

Create a reusable workflow parameterized to be able to reuse it on PR's and Main analysis

--no-build flag doesn't work

I am trying to run this command inside an nx project:
nx run-many --all --target=deploy --no-build
But the --no-build flag wont pass to the command, but if I pass --noBuild it does work.

Add the option to use a custom dist folder

Currently, we support two types of libraries, the ones that have outputPath on build options and angular like libraries, the ones with the ngPackage to indicate the dist path.

This project can't publish the library if something goes slightly out of that. Let's add the ability to define a custom dist folder path

npm link broken

With the introduction of husky, the npm link is broken.

Seems yarn link to work.

Do the test and update the docs to this method

Add on the README a suggestion to use JSCutlery/semver

This tool is excellent at something real simple, grab a package and publish it to NPM.

When dealing with NPM packages, it's common to wonder how are going to be the versions generated but that it's something out of our scope. Semver does an excellent job at doing this, and it has a feature called post-targets that runs an executor after the version is generated. We are using that feature on this project

Write on the README, on the version-bumping section an invitation to use JSCutlery/semver

Schema wants OTP to be a string, but it's really a number

Providing the OTP by passing it through the CLI fails as the value provided is coerced into a number, rather than staying a string like the executor schema expects.

>  nx run utilities:deploy-npm --otp=634119
Property 'otp' does not match the schema. '634119' should be a 'string'.

As a workaround, I've patched the schema to expect a number and it works just fine.

Using Nx 14.3.6 and ngx-deploy-npm 4.1.2.

Implement CI to this project, only Continuous Integration, PR analysis

It's time to have a CI to run the test, build and, all that cool stuff that a CI brings. Let's start giving small steps implementing for the beginning only Continuous Integration to analyze the PR's after its integration to master.

This will found a solid ground to embrace more complex stuff like continuous deployment or continuous inspection with SonarQube.

No changelog

You are publishing versions, but it is not clear what changes have been done. I would use the "releases" section for that!

Cheers,
Johannes

Improve Continuos Integration to print how the change log would look like

Improve the current CI process on PRs to indicate how you would like the change log with the introduced commit message.

Remember: We do squash on the commit message, so the commit that would take into account would be the one that we set on the merge squash

A bot to comment on the PR seems to be a fun approach.

NX 14.2.4 incompatibility

After upgrade to NX 14.2.4 getting:

Cannot find module 'nx/src/utils/app-root'
Require stack:
- /Users/nradulaski/code/hub/node_modules/ngx-deploy-npm/node_modules/@nrwl/devkit/index.js
- /Users/nradulaski/code/hub/node_modules/ngx-deploy-npm/src/executors/deploy/executor.js
- /Users/nradulaski/code/hub/node_modules/nx/src/config/workspaces.js
- /Users/nradulaski/code/hub/node_modules/nx/src/command-line/run.js
- /Users/nradulaski/code/hub/node_modules/nx/bin/run-executor.js

In NX app-root was renamed to workspace-root. @nrwl/devkit is locked to 14.0.5.

Having it ^14.0.5 should fix the issue.

Keep and eye on publish workflow

We've been facing a lot of errors in the publishment workflow; #129 Seems to be the end of our headaches.

Leave this issue open remind ourselves to keep watching that process

Create e2e test for Angular workspace

Right now, we don't have visibility on how the changes affect an Angular Workspace in a real scenario.

The current e2e test already a good part of the functionality so these new tests could be very simple.
Maybe a bash script?

Create integration test

With the recent launches of Angular and Nx, this builder has been broken, we want to avoid this in the future. It will reduce maintenance time drastically.
To perform the test to verify that everything is working as expected is a tedious manual task that required time and concentration.
With the integration tests, we can verify that everything looks great with new releases of Angular and Nx.

We have a little experience on e2e tests but with front-end applications, do it for a library that integrates into a system is a completely new thing for me and I'm a little bit lost about which technologies and approaches take to realize this.

Update docs to include GitHub Actions

Hello there! 👋

I've been working on GitHub Actions configuration for my project and I've spent pretty much time figuring out why I'm getting npm ENEEDAUTH error.

npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://registry.yarnpkg.com/
npm ERR! need auth You need to authorize this machine using npm adduser

But after, I've found this comment in publishment.yml that helped me to solve this issue.

Use npx instead of yarn because yarn automagically sets NPM_* environment variables
like NPM_CONFIG_REGISTRY so npm publish ends up ignoring the .npmrc file
which is set up by setup-node action.

I think it would be really helpful to have GitHub Actions sample configuration in docs (I know there is one for CircleCI).
Or at least include that comment to CI/CD section in docs.

Besides that, I'm really grateful for this tool!

Improve renovate frequency

We don't need to update all the libs every week. There are only a few of them that we care about being up to date.

For example, we don't need to update @types/node every week, or ts-jest, jest, prettier, and so on. But we want the latest change of @nrwl/devkit, mainly because our CI will run the e2e test and see if everything is correct beforehand.

  • Determine which packages we are interested in having recent updates
  • Create a separate check interval for them the critical ones
  • The rest of the dependencies, put them to check every month

[Feature] Is it possible to commit version change on git, using a simple flag?

Is it possible to commit version change on git, using a simple flag?

Is there any best practice about dealing with the changes if the deploy command is running in a CI/CD pipeline?

https://docs.npmjs.com/cli/v7/commands/npm-version

NPM version is automatically committing the change after patching the version, I would love to use this feature on the deploy command.

Is this feature already contained? And it is only mandatory to git push --tags?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • build: 📦 casperwa/push-protected action to v2.16.0
  • build: 📦 commitlint monorepo (@commitlint/cli, @commitlint/config-conventional)
  • build: 📦 dependency @jscutlery/semver to v5.3.1
  • build: 📦 dependency ts-jest to v29.2.5
  • build: 📦 dependency tslib to v2.7.0
  • build: 📦 jest monorepo (@types/jest, jest)
  • build: 📦 typescript-eslint monorepo to v7.18.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • build: 📦 commitlint monorepo to v19 (major) (@commitlint/cli, @commitlint/config-conventional)
  • build: 📦 dependency eslint to v9
  • build: 📦 dependency husky to v9
  • build: 📦 dependency prettier to v3
  • build: 📦 dependency pretty-quick to v4
  • build: 📦 github artifact actions to v4 (major) (actions/download-artifact, actions/upload-artifact)
  • build: 📦 typescript-eslint monorepo to v8 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yml
github-actions
.github/actions/download-build/action.yml
  • actions/download-artifact v3
.github/actions/download-coverage-report/action.yml
  • actions/download-artifact v3
.github/actions/download-lint-report/action.yml
  • actions/download-artifact v3
.github/actions/setup/action.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/basic-test.yml
  • actions/checkout v4
  • actions/upload-artifact v3
  • actions/checkout v4
  • actions/upload-artifact v3
  • actions/checkout v4
  • actions/upload-artifact v3
.github/workflows/e2e-test.yml
  • actions/checkout v4
.github/workflows/integration-test-nx-workspace.yml
  • actions/checkout v4
.github/workflows/pr.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
.github/workflows/publishment.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • CasperWA/push-protected v2.15.0
.github/workflows/test-nx-next.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
npm
package.json
  • tslib ^2.3.0
  • @commitlint/cli 18.5.0
  • @commitlint/config-conventional 18.5.0
  • @jscutlery/semver 5.2.2
  • @nx/devkit 19.5.3
  • @nx/eslint 19.5.3
  • @nx/eslint-plugin 19.5.3
  • @nx/jest 19.5.3
  • @nx/js 19.5.3
  • @nx/plugin 19.5.3
  • @nx/workspace 19.5.3
  • @types/jest 29.4.1
  • @types/node 18.19.34
  • @typescript-eslint/eslint-plugin 7.17.0
  • @typescript-eslint/parser 7.17.0
  • commitizen 4.3.0
  • create-nx-workspace 19.5.3
  • cz-conventional-changelog 3.3.0
  • eslint 8.57.0
  • eslint-config-prettier 9.0.0
  • husky 8.0.3
  • jest 29.4.3
  • jest-environment-jsdom ^29.4.1
  • jsonc-eslint-parser ^2.1.0
  • nx 19.5.3
  • prettier 2.8.4
  • pretty-quick ^3.1.3
  • ts-jest 29.1.0
  • ts-node 10.9.1
  • typescript 5.5.4
  • verdaccio ^5.0.4
  • @nx/devkit ^19.0.0
packages/ngx-deploy-npm/package.json
  • @nx/devkit ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0
  • tslib ^2.3.0
  • node >=18.0.0
nvm
.nvmrc
  • node 18

  • Check this box to trigger a request for Renovate to run again on this repository

Impossible to init ngx-deploy-npm in non-Angular NX monorepo

When we try to init ngx-deploy-npm inside a non-Angular NX monorepo, I'm facing the following issue:

yarn  nx generate ngx-deploy-npm:init                                
yarn run v1.22.10
$ nx generate ngx-deploy-npm:init
Cannot find module '@angular-devkit/core'
Require stack:
- /Users/contoso/Projects/nx_react_monorepo/node_modules/@nrwl/tao/src/commands/ngcli-adapter.js
- /Users/contoso/Projects/nx_react_monorepo/node_modules/@nrwl/tao/src/commands/generate.js
- /Users/contoso/Projects/nx_react_monorepo/node_modules/@nrwl/tao/index.js
- /Users/contoso/Projects/nx_react_monorepo/node_modules/@nrwl/cli/lib/init-local.js
- /Users/contoso/Projects/nx_react_monorepo/node_modules/@nrwl/cli/bin/nx.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

If ngx-deploy-npm is just a npm wrapper, why is it bounded to @angular-devkit/core?

Fix deployment for v11

Because we removed some experimental APIs (promoted them as public in v11), the deployment builder no longer works.

It should be relatively easy to migrate. Here's an example from AngularFire angular/angularfire#2643.

Improve prettier usage

Two things:

  • Configurate githook on commit to run prettier on staged files
  • On CI, verify if commits introduced ran prettier

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.