Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Apr 7, 2022
0 parents commit ff0c326
Show file tree
Hide file tree
Showing 29 changed files with 11,346 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# editorconfig.org
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
40 changes: 40 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# .gitignore copy

# custom
dist
examples/**/package-lock.json

# os
.DS_Store
._*

# node
logs
*.log
node_modules

# yarn
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.yarn-integrity
yarn.lock

# npm
npm-debug.log*

# tests
coverage
.eslintcache
.nyc_output

# .env
.env
.env.test
.env*.local

# vscode
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
*.code-workspace
37 changes: 37 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
},
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
plugins: ["eslint-plugin-tsdoc"],
rules: {
"no-console": ["warn", { allow: ["info", "warn", "error"] }],
"no-debugger": "warn",
"no-undef": "off",
curly: "error",
"prefer-const": "error",
"padding-line-between-statements": [
"error",
{ blankLine: "always", prev: "*", next: "return" },
],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-var-requires": "off",
"tsdoc/syntax": "warn",
},
};
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# asserts everything is text
* text eol=lf

# treats lock files as binaries to prevent merge headache
package-lock.json -diff
yarn.lock -diff

# treats assets as binaries
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 🚨 Bug report
about: Report a bug report to help improve the package.
title: ""
labels: "bug"
assignees: ""
---

<!-- 💙 Thanks for your time to make this package better with your feedback 💙
**IMPORTANT** Before reporting a bug please make sure that you have read through the documentation:
- https://prismic.io/docs
👍 A properly detailed bug report can save a LOT of time and help fixing issues as soon as possible.
-->

### Versions

- package_name: <!-- ex: v0.1.0 -->
- node: <!-- ex: v12.14.0 -->

### Reproduction

<!-- If possible link to a minimal test case, without a reproduction, it is so hard to address problems :( -->

<details open>
<summary>Additional Details</summary>
<br>
<!-- Attaching `package.json`, dependencies, logs or code snippets would help to find the issue -->
</details>

### Steps to reproduce

### What is expected?

### What is actually happening?
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 👪 Prismic Community Forum
url: https://community.prismic.io
about: Ask a question about the package or raise an issue directly related to Prismic. You will usually get support there more quickly!
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: 🙋‍♀️ Feature request
about: Suggest an idea or enhancement for the package.
title: ""
labels: "enhancement"
assignees: ""
---

<!-- 💙 Thanks for your time to make this package better with your feedback 💙 -->

### 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. Adding some code examples would be neat! -->

### 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. -->
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--- Provide a general summary of your changes in the title above -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Chore (a non-breaking change which is related to package maintenance)
- [ ] Bug fix (a non-breaking change which fixes an issue)
- [ ] New feature (a non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Description

<!--- Describe your changes in detail -->
<!--- Why is this change required? What problem does it solve? -->
<!--- If it resolves an open issue, please link to the issue here. For example "Resolves: #137" -->

## Checklist:

<!--- Put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My change requires an update to the official documentation.
- [ ] All [TSDoc](https://tsdoc.org) comments are up-to-date and new ones have been added where necessary.
- [ ] All new and existing tests are passing.

<!--- A cute animal (or car) picture is welcome to close your PR! -->
60 changes: 60 additions & 0 deletions .github/prismic-oss-ecosystem.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: ci

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: Checkout
uses: actions/checkout@master

- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: Lint
run: npm run lint

- name: Unit
run: npm run unit

- name: Build
run: npm run build

- name: Coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 14
uses: codecov/codecov-action@v1

- name: Size
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == 14
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/issues--bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
> This issue has been labeled as a **bug** since it was created using the [🚨 **Bug Report Template**](./new?assignees=&labels=bug&template=bug_report.md&title=).
Hi there, thank you so much for the report!

Following our [Maintenance Process](../blob/HEAD/CONTRIBUTING.md#maintaining), we will review your bug report and get back to you _next Wednesday_. To ensure a smooth review of your issue and avoid unnecessary delays, please make sure your issue includes the following:

- Information about your environment and packages you use (Node.js version, package names and their versions, etc.)
_Feel free to attach a copy of your `package.json` file._
- Any troubleshooting steps you already went through
- A minimal reproduction of the issue, and/or instructions on how to reproduce it

If you have identified the cause of the bug described in your report and know how to fix it, you're more than welcome to [open a pull request](../pulls) addressing it. Check out our [quick start guide](../blob/HEAD/CONTRIBUTING.md#quick-start) for a simple contribution process.

If you think your issue is a _question_ (not a bug) and would like quicker support, please _close this issue_ and forward it to an appropriate section on our community forum: https://community.prismic.io

_- The Prismic Open-Source Team_
13 changes: 13 additions & 0 deletions .github/workflows/issues--feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
> This issue has been labeled as a **feature request** since it was created using the [🙋‍♀️ **Feature Request Template**](./new?assignees=&labels=enhancement&template=feature_request.md&title=).
Hi there, thank you so much for your request!

Following our [Maintenance Process](../blob/HEAD/CONTRIBUTING.md#maintaining), we will review your request and get back to you soon. If we decide to implement it, will proceed to implement the feature during the _last week of the month_. In the meantime, feel free to provide any details to help us better understand your request, such as:

- The context that made you think of this feature request
- As many details about the solution you'd like to see implemented, how it should behave, etc.
- Any alternative solution you have considered

If you think you can implement the proposed change yourself, you're more than welcome to [open a pull request](../pulls) implementing the new feature. Check out our [quick start guide](../blob/HEAD/CONTRIBUTING.md#quick-start) for a simple contribution process. Please note that submitting a pull request does not guarantee the feature will be merged.

_- The Prismic Open-Source Team_
Loading

0 comments on commit ff0c326

Please sign in to comment.