Skip to content

Commit

Permalink
Merge pull request #6 from dbpkgs/nextjs-support
Browse files Browse the repository at this point in the history
Nextjs and Gatsby support
  • Loading branch information
sheldon-welinga committed May 10, 2022
2 parents adbb4fe + 8277c06 commit a0eaa0f
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 19 deletions.
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: '🐛 Bug report'
about: File a bug report to help us improve!
title: 'Bug'
labels: bug
assignees: ''
---

**Describe the bug**
_A clear and concise description of what the bug is._

**To Reproduce**
_Steps to reproduce the behavior:_
_You can opt to attach a screenshot at the screenshot section or attach a loom video or briefly state your issue with words like suggested below_

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
_A clear and concise description of what you expected to happen._

**Screenshots**
_If applicable, add screenshots to help explain your problem._

**Desktop/Laptop (please complete the following information):**
_Describe the platform you are using to run this software that your are experiencing issue with_

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version (Optional) [e.g. 22]

**Smartphone (please complete the following information):**
_If device is a smartphone describe the optional below regarding the device_

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Version**
_What version of this software are you using/running and getting the bug in. e.g. v1.0.0_

**Additional context**
_Add any other context about the problem here._
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: '📃 Documentation Bug'
about: You want to report something that is wrong or missing from the documentation.
title: 'Docs:'
labels: 'Type: Docs'
---
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: '🚀 Feature request'
about: You have a better idea that will make @dbpkgs/cookie better or want to discuss some aspect of the software
title: 'Feature'
labels: Feature suggestion
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
_A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]_

**Describe the solution you'd like**
_A clear and concise description of what you want to happen._

**Describe alternatives you've considered**
_A clear and concise description of any alternative solutions or features you've considered._

**Additional context**
_Add any other context or screenshots about the feature request here._
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: '🤔 Questions and Help'
about: You need help installing or intergrating @dbpkgs/cookie package with your application.
title: 'Question: '
labels: 'Type: Question'
---
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. -->

## Summary

_Explain what existing problem does the pull request solve_

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

## Changelog

_Have you added your changes in the changelog? Have you followed pre-existing change format?_
[ ] - Edit CHANGELOG.md

<!-- Help reviewers and the release process by writing your own changelog entry. This should just be a brief oneline we can mention in our release notes: https://github.com/dbpkgs/cookie/releases -->

## Test Plan

_Attach a screenshot or loom video of the change done_

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI / output of the test runner and how you invoked it. -->
20 changes: 13 additions & 7 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This workflow will run when we release a package
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: npm-publish
name: Publish Release

on:
release:
Expand All @@ -17,11 +17,17 @@ jobs:
with:
node-version: '~14.17.1'
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn check:type
- run: yarn check:format
- run: yarn build
- run: yarn test
- run: yarn publish --access public
- name: Install packages
run: yarn install
- name: Check file types
run: yarn check:type
- name: Check files formatting
run: yarn check:format
- name: Build project
run: yarn build
- name: Check if tests are passing
run: yarn test
- name: Publish the release
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/push-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# The workflow runs on git push
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: push-checks
name: Push changes to github
on:
push:
jobs:
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
[dbpkgs](mailto:[email protected]).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Cookie Action Status](https://github.com/dbpkgs/cookie/workflows/npm-publish/badge.svg)](https://github.com/dbpkgs/cookie/actions) [![Downloads Action Status](https://img.shields.io/npm/dt/@dbpkgs/cookie.svg)](https://www.npmjs.com/package/@dbpkgs/cookie)

A lightweight browser cookie library for frontend applications
A lightweight browser cookie library for frontend applications <br/>
Library also supports special characters encoding

## Installation
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dbpkgs/cookie",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"description": "A lightweight browser cookie for frontend applications",
"main": "lib/index.js",
Expand Down
14 changes: 7 additions & 7 deletions src/Cookie.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
type Options = {
interface Options {
expires?: Date;
path?: string;
domain?: string;
secure?: boolean;
};
}

export const encode = window.encodeURIComponent;
export const decode = window.decodeURIComponent;
export const encode = global?.window?.encodeURIComponent;
export const decode = global?.window?.decodeURIComponent;

export default class Cookie {
private doc: Partial<Document> | undefined | string;
Expand Down Expand Up @@ -101,6 +101,6 @@ export default class Cookie {
};
}

// const cookie = new Cookie(document);
// export const Cookies = Cookie;
// export default cookie;
// const cookie = new Cookie(global?.window?.document);
// export const Cookies = Cookie;
// export default cookie;
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Cookie from './Cookie';
const cookie = new Cookie(document);
const cookie = new Cookie(global?.window?.document);
export default cookie;

0 comments on commit a0eaa0f

Please sign in to comment.