Skip to content

Npm scripts#8823

Closed
farfromrefug wants to merge 15 commits into
NativeScript:masterfrom
Akylas:npm_scripts
Closed

Npm scripts#8823
farfromrefug wants to merge 15 commits into
NativeScript:masterfrom
Akylas:npm_scripts

Conversation

@farfromrefug
Copy link
Copy Markdown
Collaborator

@farfromrefug farfromrefug commented Sep 7, 2020

This PR brings back npm scripts for people not wanting to use nx.
It also brings a nice change in the sense that it allows you to use npm/pnpm/yarn as your package manager.

for nativescript(root)

npm config set nativescript:npm_alias pnpm

for webpack

npm config set @nativescript/webpack:npm_alias yarn

I needed to change the transformer path for the core for it to build.
I am not sure how it could work with nx before. nx simply does not work here for me so i cant really test that the core still builds.

I did not port the nx test commands as they dont work anymore ( jest config files removed).

Also to point out(so that it can be found later) that nx does not work with pnpm or yarn. It seems not to work with their node_modules structure.

PS: Maybe we should now change the nx commands to simply run npm run ... now? That way people using nx would also benefit from choosing npm/pnpm/yarn. And it would "unify" commands among tools.

@cla-bot cla-bot Bot added the cla: yes label Sep 7, 2020
Copy link
Copy Markdown
Contributor

@NathanaelA NathanaelA left a comment

Choose a reason for hiding this comment

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

  1. What happens when you do a "npm start" do the commands still work from the npm menus?
  2. What happens when you do a "npm run core:build" does it create the output .tgz file properly?

Comment thread packages/core/tsconfig.lib.json Outdated
"rootDir": "./",
"types": ["node"],
"plugins": [
{ "transform": "../../../packages/webpack/transformers/ns-transform-native-classes.ts", "type": "raw" }

This comment was marked as abuse.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That what I asked. Now that I know why nx did not work I can try

@farfromrefug
Copy link
Copy Markdown
Collaborator Author

core:build does not generate the tgz, core:build.npm does and it does with npm scripts
Npm start did not change

@farfromrefug
Copy link
Copy Markdown
Collaborator Author

BTW some scripts actually works better now with npm scripts (could be ported to nx). For example types build commands clear dist package before building it to avoid issues

@farfromrefug
Copy link
Copy Markdown
Collaborator Author

any news on this? the more ways to build you add the easier you make it for people to contribute

…m_scripts

# Conflicts:
#	CHANGELOG.md
#	apps/automated/package.json
#	apps/toolbox/package.json
#	apps/ui/package.json
#	package.json
#	packages/core/globals/index.ts
#	packages/core/package.json
#	packages/core/tsconfig.lib.json
#	packages/webpack/package.json
# Conflicts:
#	package.json
@NathanWalker
Copy link
Copy Markdown
Contributor

Closing in favor of this simplified approach which is now on master:
d7b2c84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants