René's URL Explorer Experiment


Title: Enable NPM as package manager for NativeScript projects · Issue #362 · NativeScript/nativescript-cli · GitHub

Open Graph Title: Enable NPM as package manager for NativeScript projects · Issue #362 · NativeScript/nativescript-cli

X Title: Enable NPM as package manager for NativeScript projects · Issue #362 · NativeScript/nativescript-cli

Description: A common use case for NativeScript developers is the ability to install pure JavaScript modules from NPM. Currently this process is cumbersome and it is not straightforward how to require modules that have dependencies due to the nesting...

Open Graph Description: A common use case for NativeScript developers is the ability to install pure JavaScript modules from NPM. Currently this process is cumbersome and it is not straightforward how to require modules t...

X Description: A common use case for NativeScript developers is the ability to install pure JavaScript modules from NPM. Currently this process is cumbersome and it is not straightforward how to require modules t...

Opengraph URL: https://github.com/NativeScript/nativescript-cli/issues/362

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enable NPM as package manager for NativeScript projects","articleBody":"A common use case for NativeScript developers is the ability to install pure JavaScript modules from NPM. Currently this process is cumbersome and it is not straightforward how to `require` modules that have dependencies due to the nesting of `node_modules` folders. The end goal is that `npm install ...` should work out of the box.\n### Relying on 'standards'\n\nIn order to support this a couple of things have to be changed in the CLI. Currently we create a project file `.tnsproject` that stores the app id (bundle identifier) along with the currently used version of each runtime. We plan to replace this file with `package.json` that will be compatible with [NPM package json](https://docs.npmjs.com/files/package.json) format. Here is the structure of a simple app following this rule:\n\n```\nmy-app/\n|-- app/\n|-- |-- App_Resources/\n|-- |-- tns_modules/\n|-- |-- ...\n|-- platforms/\n|-- node_modules/\n`-- package.json\n```\n### Preparing for a better world\n\nAssuming we have `package.json` in the root of the project will allow us to support `npm install lodash --save` which will install `lodash` into `node_modules` folder and save it as dependency in the `package.json`. All good but how `lodash` will end-up in the `tns_modules` folder of the app? This is where the second significant change will come into place. We will extend the `prepare` command to recursively transform the `node_modules` folder contents into `tns_modules` in the native platform project. This transformation should exclude all modules defined in the `devDependencies` section of the `package.json`.\n### Open questions:\n#### What should be the way to add NativeScript specific properties to the `project.json`?\n- prefixed with `tns_` or `nativescript_` Example:\n\n``` json\n{\n  \"name\": \"myapp\",\n  \"version\": \"10.3.1\",\n  \"tns_id\": \"org.nativescript.myapp\",\n  \"tns_platforms\": {\n    \"ios\" : \"0.9.2\",\n    \"android\" : \"0.9.0\"\n  }\n}\n```\n- in a designated `nativescript` key. Example:\n\n``` json\n{\n  \"name\": \"myapp\",\n  \"version\": \"10.3.1\",\n  \"nativescript\": {\n    \"id\" : \"org.nativescript.myapp\",\n    \"platforms\": {\n        \"ios\" : \"0.9.2\",\n        \"android\" : \"0.9.0\"\n    }\n  }\n}\n```\n#### Should we require NativeScript tailored modules published to NPM to have `nativescript` as an `engine`?\n\nExample:\n\n``` json\n{ \"engines\" : { \"nativescript\" : \">=0.9 \u003c0.10\" } }\n```\n\nor\n\n``` json\n{  \n  \"engines\" : { \n    \"nativescript-android\" : \"0.9.0\",\n    \"nativescript-ios\" : \"0.9.3\" \n  }   \n}\n```\n\nThis will give us a couple of advantages:\n- We can warn (or error) the user if the module is not compatible with currently used runtime versions. \n- (Future) We can implement a Node compatibility layer in the runtimes that will be able to load Node dependent modules from `node_modules` folder by providing shims for all Node APIs.\n\n---\n### Tasks\n- [x] Remove `.tnsproject` and introduce `package.json`\n- [x] Move project properties into `nativescript` key in the `package.json`\n- [x]  Extend `prepare` to copy the modules from `node_modules` into platform native project 'tns_modules'\n  - [x] Flatten nested dependencies\n  - [x] Do not `prepare` `devDependencies`.\n  - [x] Make sure we do not degrade the performance during `prepare` when copying the modules. We can consider things like symlinks or broccoli.js kind of infrastructure. \n- [x] Guard the new code with tests\n- [x] Implement an upgrade procedure for the old projects\n","author":{"url":"https://github.com/ligaz","@type":"Person","name":"ligaz"},"datePublished":"2015-03-21T15:36:49Z","url":"https://github.com/NativeScript/nativescript-cli/issues/362"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:371b4927-e2e7-c88c-f57d-280ab3c76b51
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id81E0:2E5652:1AA58BE:21E9813:6B014FF1
html-safe-noncee2ced5959f7d8eb3cacf50938e4f1d9429fc185baab7e7bd9a46a0ab5ea337c8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUUwOjJFNTY1MjoxQUE1OEJFOjIxRTk4MTM6NkIwMTRGRjEiLCJ2aXNpdG9yX2lkIjoiMjQ1MTUxNDUyNzcyOTE0Mzc5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac421f6a911d3b8c3b9fc6297eb2ea7ad436dfaaaa01fe7ff2aecabd4fda133192
hovercard-subject-tagissue:63419140
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-cli/362/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2cbcc5bcd06c2e591a4d1aa1dfdfdc23935d2cbf4da3504f903c76d37e488535/NativeScript/nativescript-cli/issues/362
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2cbcc5bcd06c2e591a4d1aa1dfdfdc23935d2cbf4da3504f903c76d37e488535/NativeScript/nativescript-cli/issues/362
og:image:altA common use case for NativeScript developers is the ability to install pure JavaScript modules from NPM. Currently this process is cumbersome and it is not straightforward how to require modules t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameligaz
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id21347346
octolytics-dimension-repository_nwoNativeScript/nativescript-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id21347346
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/NativeScript/nativescript-cli/issues/362#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fissues%2F362
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fissues%2F362
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2Fnativescript-cli
Reloadhttps://github.com/NativeScript/nativescript-cli/issues/362
Reloadhttps://github.com/NativeScript/nativescript-cli/issues/362
Reloadhttps://github.com/NativeScript/nativescript-cli/issues/362
NativeScripthttps://github.com/NativeScript
nativescript-clihttps://github.com/NativeScript/nativescript-cli
Codehttps://github.com/NativeScript/nativescript-cli
Issues357 (357)https://github.com/NativeScript/nativescript-cli/issues
Pull requests37 (37)https://github.com/NativeScript/nativescript-cli/pulls
Actionshttps://github.com/NativeScript/nativescript-cli/actions
Projectshttps://github.com/NativeScript/nativescript-cli/projects
Security and qualityhttps://github.com/NativeScript/nativescript-cli/security
Insightshttps://github.com/NativeScript/nativescript-cli/insights
https://github.com/NativeScript/nativescript-cli
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-cli/issues/362
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-cli/issues/362
Enable NPM as package manager for NativeScript projectshttps://github.com/NativeScript/nativescript-cli/issues/362#top
featurehttps://github.com/NativeScript/nativescript-cli/issues?q=state%3Aopen%20label%3A%22feature%22
1.1.0https://github.com/NativeScript/nativescript-cli/milestone/6
https://github.com/ligaz
ligazhttps://github.com/ligaz
on Mar 21, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issue-63419140
NPM package jsonhttps://docs.npmjs.com/files/package.json
Nexthttps://github.com/NativeScript/nativescript-cli/issues/362?timeline_page=1
https://github.com/ErjanGavalji
ErjanGavaljihttps://github.com/ErjanGavalji
on Mar 21, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-84376513
https://github.com/ErjanGavalji
ErjanGavaljihttps://github.com/ErjanGavalji
on Mar 21, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-84377120
https://github.com/ligaz
ligazhttps://github.com/ligaz
on Mar 21, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-84378639
https://github.com/tjvantoll
tjvantollhttps://github.com/tjvantoll
on Mar 21, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-84463914
https://github.com/RangerMauve
RangerMauvehttps://github.com/RangerMauve
on Mar 25, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-86242584
https://github.com/JpCapdevila
JpCapdevilahttps://github.com/JpCapdevila
on Mar 26, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-86258386
@tjvantollhttps://github.com/tjvantoll
https://github.com/burkeholland
burkehollandhttps://github.com/burkeholland
on Apr 1, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-88505048
ligazhttps://github.com/ligaz
on Apr 1, 2015https://github.com/NativeScript/nativescript-cli/issues/362#event-271031289
ikoevskahttps://github.com/ikoevska
1.0.1https://github.com/NativeScript/nativescript-cli/milestone/13
on Apr 27, 2015https://github.com/NativeScript/nativescript-cli/issues/362#event-290646602
https://github.com/gngeorgiev
gngeorgievhttps://github.com/gngeorgiev
on May 4, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-98683363
https://github.com/RangerMauve
RangerMauvehttps://github.com/RangerMauve
on May 6, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-99504701
https://github.com/ligaz
ligazhttps://github.com/ligaz
on May 8, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-100120946
@RangerMauvehttps://github.com/RangerMauve
Fatmehttps://github.com/Fatme
featurehttps://github.com/NativeScript/nativescript-cli/issues?q=state%3Aopen%20label%3A%22feature%22
on May 13, 2015https://github.com/NativeScript/nativescript-cli/issues/362#event-303517345
Fatmehttps://github.com/Fatme
on May 13, 2015https://github.com/NativeScript/nativescript-cli/issues/362#event-303517393
https://github.com/moll
mollhttps://github.com/moll
on Jul 30, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126443203
https://github.com/moll
mollhttps://github.com/moll
on Jul 30, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126465758
https://github.com/RangerMauve
RangerMauvehttps://github.com/RangerMauve
on Jul 30, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126468154
@mollhttps://github.com/moll
https://github.com/tjvantoll
tjvantollhttps://github.com/tjvantoll
on Jul 30, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126495617
@mollhttps://github.com/moll
#577https://github.com/NativeScript/nativescript-cli/issues/577
a minimal app/package.jsonhttps://github.com/NativeScript/sample-Groceries/blob/master/app/package.json
https://github.com/moll
mollhttps://github.com/moll
on Jul 31, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126611339
@tjvantollhttps://github.com/tjvantoll
https://github.com/tjvantoll
tjvantollhttps://github.com/tjvantoll
on Jul 31, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126707968
@ligazhttps://github.com/ligaz
https://github.com/moll
mollhttps://github.com/moll
on Jul 31, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126729687
https://github.com/tjvantoll
tjvantollhttps://github.com/tjvantoll
on Jul 31, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126735768
@ligazhttps://github.com/ligaz
https://github.com/ligaz
ligazhttps://github.com/ligaz
on Aug 1, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-126937780
#493https://github.com/NativeScript/nativescript-cli/issues/493
preparehttps://github.com/NativeScript/nativescript-cli/blob/master/lib/services/platform-service.ts#L143-L189
https://github.com/rclai
rclaihttps://github.com/rclai
on Nov 16, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-157028037
this onehttps://www.npmjs.com/package/loki-nativescript-adapter
https://github.com/Vitaly-Mashkov
Vitaly-Mashkovhttps://github.com/Vitaly-Mashkov
on Nov 19, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-157996921
https://github.com/didiepetrova
didiepetrovahttps://github.com/didiepetrova
on Nov 19, 2015https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-158013942
herehttp://www.telerik.com/account/support-tickets/contact-support-team.aspx?odid=2473488&pid=978
teobugslayerhttps://github.com/teobugslayer
completedhttps://github.com/NativeScript/nativescript-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 9, 2015https://github.com/NativeScript/nativescript-cli/issues/362#event-487257624
https://github.com/augmen
augmenhttps://github.com/augmen
on Jun 13, 2017https://github.com/NativeScript/nativescript-cli/issues/362#issuecomment-308012083
augmenhttps://github.com/augmen
Fatmehttps://github.com/Fatme
on Jun 13, 2017https://github.com/NativeScript/nativescript-cli/issues/362#event-1120702126
Sign up for freehttps://github.com/signup?return_to=https://github.com/NativeScript/nativescript-cli/issues/362
Sign in to commenthttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-cli/issues/362
featurehttps://github.com/NativeScript/nativescript-cli/issues?q=state%3Aopen%20label%3A%22feature%22
1.1.0https://github.com/NativeScript/nativescript-cli/milestone/6
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.