Giter Club home page Giter Club logo

Comments (9)

futuregerald avatar futuregerald commented on June 16, 2024 1

Another example showing that we are using the wrong yarn version when building from cache in an npm script.

Here is a test site:
https://app.netlify.com/sites/netlify-lerna-yarn-test/deploys

Build command used there is:
yarn --version && yarn run version

All this does is print the yarn version from terminal and also from inside of an npm/yarn script, and these are the results:

image

HOWEVER, when clearing cache, you get the intended result:

image

from build-image.

brycekahle avatar brycekahle commented on June 16, 2024

If they use base, then our current behavior will work correctly. (once the new image is deployed)

from build-image.

brycekahle avatar brycekahle commented on June 16, 2024

If they manually cd to another directory, a lot of our automatic Node behavior will not work, such as caching node_modules.

from build-image.

fool avatar fool commented on June 16, 2024

Indeed. But in a monorepo, you cannot set base if you want to build two or more separate code bases. I am aware it is a heavy lift and that's why I said we're just using this to track demand, not ask for change yet

from build-image.

brycekahle avatar brycekahle commented on June 16, 2024

Can't you use contexts?

from build-image.

fool avatar fool commented on June 16, 2024

How does that help this use case?

my repo has 2 subprojects. Both have individual package.json files. There is no /package.json. My build command is this:

cd project1 && npm install && npm run build && cd ../project2 && npm install && npm run build

Customer wants that to use npm@NPM_VERSION in both places and is unwilling/unable to change the root of the repo to have a package.json specifying it (it's a fine workaround for most, but not for all)

from build-image.

brycekahle avatar brycekahle commented on June 16, 2024

Ah, it was unclear they wanted to run commands in two different folders during the same build. I think the "workaround" you posted is the best solution at the moment.

from build-image.

rockonedege avatar rockonedege commented on June 16, 2024

I was the customer in question. Sorry being late to the discussion. But Chinese New Year is this long.

Here's my story.

At first I had my static site completely build with some Python scripts generating some html files and selected root site name: {my name}.netlify.com

Then I found more usage of this site, such as /blog, /cv etc. each subdirectory built with its own tech stack., say one with webpack+Vue, the other Python+plain html.

Rather than manage a few sites, I prefer an umbrella root site {my name}.netlify.com. So I had to build each sub-directory for deployment with my own script, and leave the index.html in the root directory as a site map.

It seems pretty natural and flexible for me build each subdirectory with different technologies.

from build-image.

fool avatar fool commented on June 16, 2024

We think this is affecting yarn too in monorepos, and are doing some tests to confirm. Reported in customer cases:

from build-image.

Related Issues (20)

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.