-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rationalise DCR's env checking scripts #9400
Conversation
22b91c9
to
ed02a19
Compare
they don’t need to run every time you use the makefile
ed02a19
to
2af6b0e
Compare
Size Change: 0 B Total Size: 696 kB ℹ️ View Unchanged
|
2af6b0e
to
e183b80
Compare
e183b80
to
dd355bd
Compare
part of #9421 |
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
process.chdir(resolve(__dirname, '..')); | ||
|
||
const nvmrc = (await readFile('.nvmrc', 'utf-8')) | ||
const nvmrc = (await readFile('../.nvmrc', 'utf-8')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure this should live inside dotcom-rendering
as it’s looking for files in both workspaces and in the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a DCR concern though right? it's looking in the root for the root version, and making sure that DCR-related files (which AR files are, really, i think?) are in sync with the repo more generally.
should it be the responsibility of the root to ensure that apps in the workspace stay in sync with the root?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my mind the root is a good place for scripts that span all workspaces, but I agree that it should be a workspace concern to stay in sync with the root.
I’ll defer to anyone in @guardian/dotcom-platform with a stronger or better articulated view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged, but if anyone prefers to move it, please do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it!
It makes sense for check-node
not to be written in JS.
and standardise the escape char
What does this change?
log
,check-node
andcheck-yarn
scripts to the project rootcheck-node-versions
script to DCRcheck-deps
andcheck-files
to DCR's makefilelint-project
targetensure
There are also the following changes to how they work:
log
to output un-coloured messages outside of terminalscheck-node
to a bash scriptcheck-yarn
check for any yarn, and recommends usingcorepack enable
if none is availableWhy?
This is preparation work for updating and upgrading the way
yarn
and the workspace is used in the repo.log
,check-node
andcheck-yarn
are not DCR-specificcheck-node-versions
is DCR-specificcheck-node
currently runs in node, writing it as a bash script means it has no dependencies (e.g. node no longer comes with macOS).