Repository navigation
fix: support running from outside the project with --path #6182
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
29af27d
fix: don't pass the CLI's own options to package managers
rigor789 64dc3d1
fix(ios): resolve NativeSource paths against the project
rigor789 6e00729
fix(ios): use the folders of a NativeSource glob's headers as search …
rigor789 3d737b2
test: remove the NativeSource tests' temp folders
NathanWalker 43270f0
fix(ios): keep the configured NativeSource path as the pbxgroup key
NathanWalker 564f570
fix(ios): don't nest absolute NativeSource glob matches under the pro…
NathanWalker c6e10a7
fix(ios): look for a NativeSource glob's module map next to its headers
NathanWalker 5c40db1
refactor(pnpm): drop option deletes covered by CLI_ONLY_OPTIONS
NathanWalker 89659c5
test: cover --ignore-scripts installs for npm, yarn and bun
NathanWalker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import { assert } from "chai"; | ||
| import { BasePackageManager } from "../lib/base-package-manager"; | ||
| import { BunPackageManager } from "../lib/bun-package-manager"; | ||
| import { IInjector } from "../lib/common/definitions/yok"; | ||
| import { Yok } from "../lib/common/yok"; | ||
| import { NodePackageManager } from "../lib/node-package-manager"; | ||
| import { YarnPackageManager } from "../lib/yarn-package-manager"; | ||
| import * as stubs from "./stubs"; | ||
|
|
||
| class TestPackageManager extends (<any>BasePackageManager) { | ||
| constructor() { | ||
| super({}, {}, {}, {}, "npm"); | ||
| } | ||
| } | ||
|
|
||
| describe("BasePackageManager", () => { | ||
| const flags = (config: object): string[] => | ||
| (<any>new TestPackageManager()).getFlagsString(config, true); | ||
|
|
||
| it("doesn't pass the CLI's own options to the package manager", () => { | ||
| assert.deepEqual( | ||
| flags({ | ||
| path: "apps/app", | ||
| frameworkPath: "runtime.tgz", | ||
| disableNpmInstall: true, | ||
| ignoreScripts: true, | ||
| }), | ||
| [], | ||
| ); | ||
| }); | ||
|
|
||
| it("passes the package manager's options on", () => { | ||
| assert.deepEqual(flags({ "ignore-scripts": true, "save-dev": true }), [ | ||
| "--ignore-scripts", | ||
| "--save-dev", | ||
| ]); | ||
| }); | ||
|
|
||
| [ | ||
| { name: "npm", packageManager: NodePackageManager }, | ||
| { name: "yarn", packageManager: YarnPackageManager }, | ||
| { name: "bun", packageManager: BunPackageManager }, | ||
| ].forEach(({ name, packageManager }) => { | ||
| it(`maps ignoreScripts to --ignore-scripts when installing with ${name}`, async () => { | ||
| const injector: IInjector = new Yok(); | ||
| injector.register("hostInfo", { isWindows: false }); | ||
| injector.register("errors", stubs.ErrorsStub); | ||
| injector.register("logger", stubs.LoggerStub); | ||
| injector.register("childProcess", stubs.ChildProcessStub); | ||
| injector.register("httpClient", {}); | ||
| injector.register("fs", stubs.FileSystemStub); | ||
| injector.register("pacoteService", {}); | ||
| injector.register(name, packageManager); | ||
| const projectDir = "/some-project"; | ||
|
|
||
| await injector | ||
| .resolve<BasePackageManager>(name) | ||
| .install(projectDir, projectDir, <any>{ | ||
| ignoreScripts: true, | ||
| path: "apps/app", | ||
| frameworkPath: "runtime.tgz", | ||
| }); | ||
|
|
||
| const args = | ||
| injector.resolve<stubs.ChildProcessStub>( | ||
| "childProcess", | ||
| ).lastCommandArgs; | ||
| assert.include(args, "--ignore-scripts"); | ||
| assert.notInclude(args, "--ignoreScripts"); | ||
| assert.notInclude(args, "--path"); | ||
| assert.notInclude(args, "--frameworkPath"); | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Script executed:
Repository: NativeScript/nativescript-cli
Length of output: 4422
Script executed:
Repository: NativeScript/nativescript-cli
Length of output: 32178
Script executed:
Repository: NativeScript/nativescript-cli
Length of output: 31981
Script executed:
Repository: NativeScript/nativescript-cli
Length of output: 8510
Script executed:
Repository: NativeScript/nativescript-cli
Length of output: 12681
Web query:
nativescript-dev-xcode 0.8.2 pbxProject addToHeaderSearchPaths removeFromHeaderSearchPaths implementationResult:
Web query:
site:github.com/NativeScript/nativescript-dev-xcode "addToHeaderSearchPaths" "removeFromHeaderSearchPaths" pbxProject.jsResult:
Script executed:
Repository: NativeScript/nativescript-cli
Length of output: 3654
Reconcile glob-owned header search paths on each prepare.
addToHeaderSearchPathsappends a path when it is not already present. It does not replace existing paths. Because each prepare reloads and saves the existing project, directories from earlier glob matches remain when later matches change.removeNativeSourceCoderemoves only the glob path, not the matched header directories.Track the paths owned by this group and remove paths that are no longer matched before adding the current paths. Fixed non-glob sources already used one stable
group.pathbefore this change; the accumulation of changing matched-directory entries is introduced by the new glob handling.