Skip to content
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

import, refactor, improve & yarn support #2

Merged
merged 21 commits into from
Nov 20, 2018
Merged

import, refactor, improve & yarn support #2

merged 21 commits into from
Nov 20, 2018

Conversation

obfusk
Copy link
Contributor

@obfusk obfusk commented Oct 19, 2018

No description provided.

@obfusk obfusk requested a review from yorickvP October 19, 2018 20:12
tar xzvf ./${name}.tgz -C $out --strip-components=1
if [ "$installJavascript" = "1" ]; then
cp -R node_modules $out/
${ concatStringsSep ";" (map (cmd:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is every anything but npm start --scripts-prepend-node-path=true .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ever*. I symlinked npm so it could run the npm start script, which is somewhat trivial to do (doesn't differ between npm and yarn, afaik)

default.nix Show resolved Hide resolved
deps[key] = { name, resolved: url, integrity }
})

console.log(JSON.stringify(deps, null, 2))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the best way to generate non-log output.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It's less verbose than process.stdout.write(... + "\n") and does the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantics. console.log is for logs ;)

default.nix Show resolved Hide resolved
preInstallPhases = [ "yarnPackPhase" ];

# TODO
yarnConfigPhase = ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put this in preConfigurePhases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one.

default.nix Show resolved Hide resolved
yarn pack --ignore-scripts --filename ${info.name}.tgz
'';

installPhase = untarAndWrap info.name [npmCmd yarnCmd];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if there's anything here that you can't do with npm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. I'd say it depends on the project. And how well npm works for yarn packages. For the vault ui you'd need neither npm nor yarn after building I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script running is fairly trivial and the code might even be shared between npm and yarn.

preInstallPhases = [ "npmPackPhase" ];

npmCachePhase = ''
addToSearchPath NODE_PATH ${npmModules} # pacote
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this add to the final npm build search path as well?

@mkaito mkaito self-requested a review November 1, 2018 14:42
@yorickvP yorickvP merged commit 918d604 into master Nov 20, 2018
@serokell-bot serokell-bot deleted the obfusk-wip-2 branch November 20, 2018 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants