Skip to content

Commit

Permalink
Support for es modules, and bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Jan 1, 2024
1 parent 278a00f commit 754697f
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 43 deletions.
75 changes: 50 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,66 @@
# Contributing :star: :star2: :dizzy:
# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk:

So, you want to contribute to this project? That's awesome! However, before doing so, please read the following simple steps on how to contribute. This will make life easier and avoid wasting time on things that are not requested. ✨
So, you want to contribute to this project! That's awesome. However, before
doing so, please read the following simple steps explaining how to contribute. This will
make life easier and help avoid wasting time on things that are not
requested. :sparkles:

## Discuss the changes before making them
To begin, open an issue in the repository using the [bug tracker][1]. Describe the contribution you'd like to make, the bug you've found, or any other ideas you have. This step will help us get you started on the right track.
## Discuss the changes before doing them
- First of all, open an issue in the repository, using the [bug tracker][1],
describing the contribution you would like to make, the bug you found or any
other ideas you have. This will help us to get you started on the right
foot.

If it is relevant, include platform and software information (e.g., operating system, Node.JS version, etc.) and screenshots to help us understand what you're experiencing.
- If it makes sense, add the platform and software information (e.g. operating
system, Node.JS version etc.), screenshots (so we can see what you are
seeing).

We recommend waiting for feedback before proceeding to the next steps. However, if the issue is clear, such as a typo, and the fix is simple, you can go ahead and fix it.
- It is recommended to wait for feedback before continuing the next steps.
However, if the issue is clear (e.g. a typo) and the fix is simple, you can
continue to fix it.

## Fixing Issues
Begin by forking the project to your own account, and create a branch for your fix, naming it either `some-great-feature` or `some-issue-fix`.
## Fixing issues
- Fork the project in your account and create a branch with your fix:
`some-great-feature` or `some-issue-fix`.

Commit your changes to that branch, adhering to the [code style][2]. If the project includes tests (usually located in the `test` directory), we encourage you to add a test as well. :memo:
- Commit your changes in that branch, writing the code following the
[code style][2]. If the project contains tests (generally, the `test`
directory), you are encouraged to add a test as well. :memo:

If the project includes a `package.json` or a `bower.json` file, add yourself to the `contributors` array (or `authors` in the case of `bower.json`). If the array doesn't exist, create it as shown below:
- If the project contains a `package.json` or a `bower.json` file add yourself
in the `contributors` array (or `authors` in the case of `bower.json`;
if the array does not exist, create it):

```json
{
"contributors": [
"Your Name <your@email.address> (http://your.website)"
]
}
```
```json
{
"contributors": [
"Your Name <and@email.address> (http://your.website)"
]
}
```

## Creating a Pull Request
Start by opening a pull request and make sure to reference the initial issue in the pull request message (e.g., *fixes #<your-issue-number>*). Provide a clear and descriptive title to help everyone understand what is being fixed or improved.
## Creating a pull request

If applicable, consider adding screenshots, gifs, or any other visual aids that can make it easier to understand the changes you've made.
- Open a pull request, and reference the initial issue in the pull request
message (e.g. *fixes #<your-issue-number>*). Write a good description and
title, so everybody will know what is fixed/improved.

## Wait for Feedback
Before accepting your contributions, we will review them. You may receive feedback regarding what needs to be addressed in your modified code. If so, simply continue making commits to your branch, and the pull request will be automatically updated.
- If it makes sense, add screenshots, gifs etc., so it is easier to see what
is going on.

## Everyone Is Happy!
Ultimately, your contributions will be merged, and everyone will be delighted! 😄 Contributions are more than welcome!
## Wait for feedback
Before accepting your contributions, we will review them. You may get feedback
about what should be fixed in your modified code. If so, just keep committing
in your branch and the pull request will be updated automatically.

## Everyone is happy!
Finally, your contributions will be merged, and everyone will be happy! :smile:
Contributions are more than welcome!

Thanks! :sweat_smile:

[1]: /issues


[1]: https://github.com/LienJS/Lien/issues

[2]: https://github.com/IonicaBizau/code-style
6 changes: 3 additions & 3 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Sets, gets or deletes the cookie.
- **String** `value`: If provided and it not `null`, the cookie will be set. If it's null, the cookie will be deleted. If `value` is not provided, the cookie value will be returned.

#### Return
- **String** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.
- **String|null|undefined** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.

### `file(path, customRoot)`
Serves a file to the response.
Expand Down Expand Up @@ -218,7 +218,7 @@ Gets the transformer for a url.
- **String** `method`: The method.

#### Return
- **Transformer** The transformer (if it exists) or `null`.
- **Transformer|null** The transformer (if it exists) or `null`.

### `getHooksStrict(type, url, method)`
Similar to `getHooks`, but doesn't concat hooks based on the regex
Expand All @@ -231,7 +231,7 @@ matching but only if they are the same regex.
- **String** `method`: The method.

#### Return
- **Transformer** The transformer (if it exists) or `null`.
- **Transformer|null** The transformer (if it exists) or `null`.

### `insertHook(type, url, method, trans)`
Inserts a new hook.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-23 Ionică Bizău <[email protected]> (https://ionicabizau.net/)
Copyright (c) 2014-24 Ionică Bizău <[email protected]> (https://ionicabizau.net/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Sets, gets or deletes the cookie.
- **String** `value`: If provided and it not `null`, the cookie will be set. If it's null, the cookie will be deleted. If `value` is not provided, the cookie value will be returned.

#### Return
- **String** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.
- **String|null|undefined** `null`, if the cookie was deleted. `undefined` if the cookie doesn't exist. The cookie value if this exists.

### `file(path, customRoot)`
Serves a file to the response.
Expand Down Expand Up @@ -352,7 +352,7 @@ Gets the transformer for a url.
- **String** `method`: The method.

#### Return
- **Transformer** The transformer (if it exists) or `null`.
- **Transformer|null** The transformer (if it exists) or `null`.

### `getHooksStrict(type, url, method)`
Similar to `getHooks`, but doesn't concat hooks based on the regex
Expand All @@ -365,7 +365,7 @@ matching but only if they are the same regex.
- **String** `method`: The method.

#### Return
- **Transformer** The transformer (if it exists) or `null`.
- **Transformer|null** The transformer (if it exists) or `null`.

### `insertHook(type, url, method, trans)`
Inserts a new hook.
Expand Down Expand Up @@ -483,24 +483,25 @@ Thanks! :heart:
## :dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:

- `@dottjt/mediareade`
- `@everything-registry/sub-chunk-2069`
- `bloggify`
- `gh-contributions`
- `bloggify-cli`
- `web-term`
- `bloggify-prebuilt`
- `bloggify-server-prebuilt`
- `@dottjt/mediareade`
- `youtube-album-uploader`
- `youtube-album-uploader-multiple`
- `bnotify`
- `test-youtube-api`
- `bloggify-prebuilt`
- `chewb-youtube-uploader`
- `fb-token-updater`
- `gh-contributions`
- `learning-node-file-upload`
- `learning-nodejs-file-upload`
- `lien-github-comments-example`
- `fb-token-updater`
- `nodejs-youtube-uploader`
- `chewb-youtube-uploader`
- `test-youtube-api`
- `web-term`
- `wrabbit`
- `learning-nodejs-file-upload`
- `youtube-album-uploader`
- `youtube-album-uploader-multiple`



Expand Down
3 changes: 3 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ class Lien extends EventEmitter {
if (typeof options.session.store === "string") {
try {
this.SessionStoreModule = require(options.session.store);
if (this.SessionStoreModule.__esModule && this.SessionStoreModule.default) {
this.SessionStoreModule = this.SessionStoreModule.default;
}
} catch (e) {
if (e.code === "MODULE_NOT_FOUND") {
this.emit("error", new Error(`The ${options.session.store} should be installed in your app to use it as session store.`));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
"transformer": "^1.0.1",
"ul": "^5.2.1"
}
}
}

0 comments on commit 754697f

Please sign in to comment.