-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add example locations #16
Add example locations #16
Conversation
Can you document it for the other properties too? |
You also need to update the docs in index.d.ts |
readme.md
Outdated
Example locations (with the default `nodejs` [suffix](#suffix)): | ||
|
||
- macOS: `~/Library/Preferences/MyApp-nodejs` | ||
- Windows: `%APPDATA%\MyApp-nodejs\Config` |
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.
Would be useful to also show an example of the full resolved path.
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.
My rationale for %APPDATA%
is that it's better / easier to read than C:\Users\sindresorhus\AppData\Roaming
(and even that depends on the Windows version I believe).
While we're at it, do you think ~
is fine? I prefer ~/Library/Preferences/MyApp-nodejs
over /Users/sindresorhus/Library/Preferences/MyApp-nodejs
but it's a similar issue as with %APPDATA%
. Overall, my preference is towards shorter, more generic examples where possible.
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.
My rationale for %APPDATA% is that it's better / easier to read
I agree. I meant just showing an example of the resolved path afterwards.
While we're at it, do you think ~ is fine?
Yes
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.
Oh, so what do you mean by "resolved path"? paths.config
is a directory so examples like ~/Library/Preferences/MyApp-nodejs
or %APPDATA%\MyApp-nodejs\Config
are already fully resolved, aren't they?
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.
From experience, people know what ~
resolves to, but it's not always clear what %APPDATA
resolves to.
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.
- macOS: `~/Library/Preferences/MyApp-nodejs`
- Windows: `%APPDATA%\MyApp-nodejs\Config` (Example: `C:\Users\USERNAME\AppData\Roaming\MyApp-nodejs\Config`)
- Linux: `~/.config/MyApp-nodejs` (or `$XDG_CONFIG_HOME/MyApp-nodejs`)
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.
Thanks. I've changed the format and also documented the other properties, see readme.md
as of f4f8c05.
It would be great if you could double-check the actual values, for example, I'm not that sure that .temp
examples are fully correct on Windows & Linux. But if you could review the other as well that would be great 🙏.
After this is checked, I'll be happy to update the .d.ts
file as well.
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.
for example, I'm not that sure that .temp examples are fully correct on Windows & Linux
It's all in the code. I don't have a Linux or Windows system to test on right now. The Linux one for temp looks incorrect from a quick look as (per the code) it should include the username.
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.
I tried to work with the source code closely, for all the examples, I hope that .temp
is the only one I missed – you're right, it should contain username. For example, https://runkit.com/embed/kefcnj8b9f7d.
Fixed in ff5b24a.
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.
You also need to update the docs in
index.d.ts
Done in 2fff90a.
Good idea. I'd like to sort out the current first example first, then do the rest. |
readme.md
Outdated
Example locations (with the default `nodejs` [suffix](#suffix)): | ||
|
||
- macOS: `~/Library/Application Support/MyApp-nodejs` | ||
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (e.g., `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`) |
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.
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (e.g., `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`) | |
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`) |
Not everyone knows e.g.
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.
Agree, improved in 4546c80.
readme.md
Outdated
Example locations (with the default `nodejs` [suffix](#suffix)): | ||
|
||
- macOS: `/var/folders/jf/f2twvvvs5jl_m49tf034ffpw0000gn/T/MyApp-nodejs` | ||
- Windows: `%LOCALAPPDATA%\Temp\MyApp-nodejs` (e.g., `C:\Users\USERNAME\AppData\Local\Temp\MyApp-nodejs`; ) |
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.
Typo
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.
Fixed in a3ea6d8.
index.d.ts
Outdated
*/ | ||
readonly log: string; | ||
|
||
/** | ||
Directory for temporary files. | ||
|
||
Example locations (with the default `nodejs` [suffix](#suffix)): |
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.
The Markdown link should not be used here.
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.
Fixed in 0b20ba6.
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.
I think you misunderstood. The text should still be there. It should just not be a link.
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.
I've added the text back (for all properties) in cbefe18.
The PR title is outdated. |
I've updated both the title and PR description. Feel free to update it some more if you wish. Thanks for all the feedback! |
Thanks :) |
Resolves #15
This PR adds examples of
paths
directories on macOS, Windows and Linux toreadme.md
(rendered) andindex.d.ts
.