Code Monkey home page Code Monkey logo

netlify-plugin-nx-skip-build's Introduction

Hi ๐Ÿ‘‹, I'm Fahad Allibdi

A passionate full stack developer from Saudi Arabia

f22hd

f22hd

fallebdi

  • ๐Ÿ‘จโ€๐Ÿ’ป All of my public projects are available at my-repositories

  • ๐Ÿ“ I regularly write articles on Medium

  • ๐Ÿ’ฌ Ask me about react,angular,typescript,javascript,html,css,tailwindcss,bootstrap,php,laravel

  • ๐Ÿ“ซ How to reach me https://twitter.com/Fallebdi

Blogs posts

Connect with me:

fallebdi fahd-allebdi-4556a189 https://stackoverflow.com/users/6627559/fahd-allebdi @f13hd fahad allebdi http://allebdi.me/feed/

Languages and Tools:

amplify angular aws bootstrap codeigniter css3 cypress figma firebase gatsby git graphql html5 ionic java javascript laravel linux mongodb mysql nextjs php postgresql postman react reactnative sass spring svelte tailwind typescript

f22hd

ย f22hd

f22hd

netlify-plugin-nx-skip-build's People

Contributors

f22hd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

netlify-plugin-nx-skip-build's Issues

Always skips build on project that doesn't have a deploy?

Describe the bug

We're testing this plugin with Netlify and Nx, and it seems to work fine for sites that have already had a deploy before adding this plugin, but for a new site it doesn't seem to allow any builds through. I'm assuming that this is because nx print-affected isn't getting a base commit? The base commit comes from process.env.CACHED_COMMIT_REF but is there a chance that this environment variable isn't set to anything when the site hasn't had a successful build?

If it's not set, it seems that the nx print-affected command will throw an error (with exit code 1). If the command fails, does execution continue as if the project is unaffected?

Steps to reproduce

I believe this happens just to new sites that haven't had a successful build when the plugin runs, but haven't confirmed.

Expected behavior

I'd expect the plugin to allow the build to finish if the nx print-affected command fails for any reason.

I'll try to deploy a local version of the plugin to test further.

`README` improvements

Thanks a lot for this plugin!

The README is good but quite concise. What are your thoughts on adding more instructions in the README for users?
The following documentation has several ideas which might be helpful for this. What do you think?

Project name is sometimes invalid

The current logic to retrieve the project name currently fails in the following situations:

  • On Windows, the file path is \, so
    const [name] = dir.split('/').reverse()
    does not work.
  • Although PUBLISH_DIR is currently never ending with a /, this might change in the future. If this was to change, the current logic would return an empty string.

As a small additional note, constants.PUBLISH_DIR is always defined, so no default value is needed.

I believe the following code might solve those problems:

const { basename } = require('path')

const projectName = basename(constants.PUBLISH_DIR)

What do you think?

Additional question: does this code work with the two following situations?

  • By default, the publish directory is the repository root directory, i.e. projectName will most likely be the repository name.
  • However, users can configure the publish directory. In that case, projectName will be the publish directory filename.

Enabling manual deploy site

Thanks for suggesting a new feature!

Please fill in the sections below.

Which problem is this feature request solving?

For example, I'm always frustrated when trying to redeploy my site with no code changes, so the plugin prevents me from doing this.

Describe the solution you'd like

Example: This could be fixed by skipping the check if the site is deploying manually either the Netlfiy website or CLI.

Describe alternatives you've considered

Example: Another solution would be listening to the env variable like MANUAL_DEPLOYMENT to true, so we can skip the logic if it is true.

Can you submit a pull request?

Yes, Soon.

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.