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

Option to have spkl ignore paths when scanning for spkl.json files #468

Open
antoniocuegervas opened this issue Dec 23, 2022 · 0 comments
Open

Comments

@antoniocuegervas
Copy link

antoniocuegervas commented Dec 23, 2022

Currently I have a deployment for a react application where the deploy-webresources script fails because it's scanning inside my node_modules folder where there are very deep folder structures and something seems to go wrong (error below, not very descriptive).

So far I'm doing a workaround to delete my node_modules folder before deployment since I'm using a webpack build and I don't need to deploy the dependencies, however deleting the node_modules every time I need to deploy is really adding up to my deployment times, which is not ideal even if it's automated (not to say anything of when we need to do that locally)

I think it'd be a good idea to have the option to exclude a path from the spkl.json search, or have it ignore node_modules by default, since I find it unlikely that anybody is adding their spkl.json files there.

Find the error below. The referenced path in the error does exist and I can navigate to it, so I suppose it's probably an error related to path lengths or something similar.

Deploying WebResources
The application terminated with an error.
Could not find a part of the path 'C:\Users<username>\source\repos......\node_modules\npx\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\http-proxy-agent\node_modules\agent-base\node_modules\es6-promisify\node_modules\es6-promise'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator1.CommonInit() at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption) at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable`1 collection)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
at Microsoft.Extensions.FileSystemGlobbing.Matcher.Execute(DirectoryInfoBase directoryInfo)
at SparkleXrm.Tasks.DirectoryService.Search(String path, String search)
at SparkleXrm.Tasks.Config.ConfigFileService.FindConfig(String folder, Boolean raiseErrorIfNotFound)
at SparkleXrm.Tasks.DeployWebResourcesTask.ExecuteInternal(String folder, OrganizationServiceContext ctx)
at SparkleXrm.Tasks.BaseTask.Execute(String folder)
at SparkleXrmTask.Program.RunTask(CommandLineArgs arguments, IOrganizationService service, ITrace trace)
at SparkleXrmTask.Program.Run(CommandLineArgs arguments)
at SparkleXrmTask.Program.Main(String[] args)
Error Code=1

package.json file for reference

{
  "name": "",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "build": "npm install && npx webpack"
  },
  "dependencies": {},
  "devDependencies": {
    "@types/node": "^12.0.4",
    "@types/powerapps-component-framework": "^1.3.0",
    "@types/xrm": "^9.0.33",
    "clean-webpack-plugin": "^3.0.0",
    "copy-webpack-plugin": "^5.0.3",
    "declaration-bundler-webpack-plugin": "^1.0.3",
    "path": "^0.12.7",
    "ts-loader": "^6.0.1",
    "typescript": "^3.5.1",
    "webpack": "^5.75.0",
    "webpack-cli": "^5.0.0",
    "npx": "^10.2.2"
  }
}
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

No branches or pull requests

1 participant