Comments (2)
The second option where an ahkpm-modules.ahk
contains the rest of the includes is actually a really good idea, but this would mean that ahkpm install
will need to add an include in the ahkpm-modules.ahk file and ahkpm needs to keep track of it.
Also I think we would need an ahkpm uninstall
command to remove the package
BTW in the ahkpm-modules.ahk
file, A_LineFIle could be used to reference it's own path
#Include %A_LineFile%\..\github.com\joshuacc\simple-http\simple-http.ahk
from ahkpm.
The project looks really good.
Thanks!
What if I decide to use the same package/version from my own Gitea or Codeberg or whatever else? This will do regardless of the upstream:
; Option 1: #Include, %A_ScriptDir%\ahkpm-modules\simple-http.ahk ; Optionally: #Include, %A_ScriptDir%\ahkpm-modules\simple-http
It is easier to manage (and it doesn't even need the extension).
Unfortunately, I don't believe that will work, because fundamentally your copy of a package is a different package, where you are free to version and update entirely separately from the original. You could even rewrite the entire git history if you wanted to.
Because of this issue, ahkpm can't allow referring to different git repositories by the same name. Not only because it can potentially cause confusion. It could easily lead to security issues as well.
; Option 2: #Include, %A_ScriptDir%\ahkpm-modules.ahk ; Optionally: ; #Include, %A_ScriptDir%\ahkpm-modulesThis is even better as that file can contain all the packages with full paths.
The end user is presented with just a single line and that's a relief for many AHK users as the target audience is people that doesn't code.
This option may be viable. When working purely with packages that have an ahkpm.json
file and a valid include
path, this would probably work the vast majority of the time. Just automatically update the ahkpm-modules.ahk
file with the includes whenver we run ahkpm install
.
There are two scenarios where it gets more complicated.
- Packages that don't have a single main file to
#Include
, but allow
including several different files. - "Packages" that are just git repositories without an
ahkpm.json
.
The first one may or may not be a big deal, but I do think that it would be confusing to users that including ahkpm-modules.ahk
usually includes all of their libraries, but not always.
The second one seems more problematic. Now, and for a while to come, most of the AHK packages that ahkpm can install will be plain git repositories without any ahkpm.json
file at all. If they happen to only have a single *.ahk
file in the repo, then we could automatically infer the proper include path. But what if it is more complicated? (As many of the existing GitHub repos are.)
At the very least, we would need to find a way to signal to the user that they need to handle those #Include
's manually. And I don't have great ideas about how to do that yet.
Given that your project is written in Go, you can add compatibility regardless of what the users have installed. And is just the removal of the comma:
Yep! This is something I will definitely fix in the next couple of days. I've opened #180 to track it until then.
I was quite surprised when AutoHotkey 2 went into RC. :)
from ahkpm.
Related Issues (20)
- Add flag to `ahkpm install` to automatically add the `#Include` directive to a file
- Add Concepts > Versions to ahkpm.dev HOT 1
- Add Concepts > Version ranges to ahkpm.dev
- Add Concepts > git & GitHub to ahkpm.dev
- Rework the Quick Start on ahkpm.dev
- When `ahkpm install` is adding a single package, output the `#Include` directive to terminal
- Add support for relative script paths for `ahkpm include` HOT 2
- Provide terminal output after `ahkpm update <package>`
- Add Guide > Installing GitHub repos as packages to ahkpm.dev
- Add GitHub gist support
- ahkpm.lock incorrectly recording version ranges instead of final resolved version
- `ahkpm include` generates `#Include` directives that are not compatible with AHK2 HOT 1
- Prompt suggests "UNLICENSED" but says it's invalid when entered HOT 7
- Update Overview > Introduction to mention installing packages that are just regular git repositories
- Automatically detect license during `ahkpm init`
- Update publishing guide to mention that descriptions are pulled from GitHub repository descriptions HOT 1
- Use ahkpm.json descriptions as fallback if there is no github repo description
- [Question] Install package from a private repository
- [FEAT] Global install
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ahkpm.