Skip to content

Commit

Permalink
Merge pull request #34 from M-Scott-Lassiter/beta
Browse files Browse the repository at this point in the history
Initial Release v1.0.0
  • Loading branch information
M-Scott-Lassiter authored Jun 2, 2022
2 parents e450510 + 58a9824 commit e0c5942
Show file tree
Hide file tree
Showing 173 changed files with 38,697 additions and 3,498 deletions.
90 changes: 73 additions & 17 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
// When adding new matchers, place them in alphabetical order inside the coordinateMatchers array

const coordinateMatchers = [
{ name: 'isValid2DBoundingBox' },
{ name: 'isValid2DCoordinate' },
{ name: 'isValid3DBoundingBox' },
{ name: 'isValid3DCoordinate' },
{ name: 'isValidBoundingBox' },
{ name: 'isValidCoordinate' },
{ name: 'toBeAnyGeometry' },
{ name: 'toBeFeature' },
{ name: 'toBeFeatureCollection' },
{ name: 'toBeGeometryCollection' },
{ name: 'toBeLineStringGeometry' },
{ name: 'toBeMultiLineStringGeometry' },
{ name: 'toBeMultiPointGeometry' },
{ name: 'toBeMultiPolygonGeometry' },
{ name: 'toBePointGeometry' },
{ name: 'toBePolygonGeometry' }
]

const boundingBoxMatchers = []

const geometryMatchers = []

const geometryCollectionMatchers = []

const featureMatchers = []

const featureCollectionMatchers = []

const functionalMatchers = []

const allMatchers = [
...coordinateMatchers,
...boundingBoxMatchers,
...geometryMatchers,
...geometryCollectionMatchers,
...featureMatchers,
...featureCollectionMatchers,
...functionalMatchers
]

const documentationScopes = [
{ name: 'contributing' },
{ name: 'code of conduct' },
{ name: 'license' },
{ name: 'readme' },
{ name: 'security' }
]

module.exports = {
types: [
{
value: 'api',
name: 'api: Non-functional changes to code API documentation that help other developers understand how to use a tool or feature (i.e. intellisense)'
},
{
value: 'build',
name: 'build: Changes that affect the build system configuration, package scripts, or dev dependencies (i.e. adds/remove/modify/update)'
Expand All @@ -9,7 +64,7 @@ module.exports = {
name: 'ci: Changes to CI configuration files and scripts (e.g. release configs, YAML scripts)'
},
{ value: 'docs', name: 'docs: Documentation only changes' },
{ value: 'feat', name: 'feat: Adds or enhances a new matcher' },
{ value: 'feat', name: 'feat: Adds a new feature' },
{
value: 'fix',
name: 'fix: Fixes a bug in an existing feature. Also used for non-dev dependency updates.'
Expand All @@ -26,30 +81,31 @@ module.exports = {
{ value: 'test', name: 'test: Add missing tests or correct existing tests' }
],

scopes: [
{ name: 'api' },
{ name: 'contributing' },
{ name: 'license' },
{ name: 'readme' },
{ name: 'security' }
],
scopes: [...allMatchers, ...documentationScopes],

allowTicketNumber: false,
isTicketNumberRequired: false,
ticketNumberPrefix: 'TICKET-',
ticketNumberRegExp: '\\d{1,5}',

// it needs to match the value for field type. Eg.: 'fix'
/*
scopeOverrides: {
fix: [
{name: 'merge'},
{name: 'style'},
{name: 'e2eTest'},
{name: 'unitTest'}
]
api: allMatchers,
ci: [{ name: 'publish' }, { name: 'test' }, { name: 'hooks' }, { name: 'templates' }],
build: [
{ name: 'dependencies' },
{ name: 'devDependencies' },
{ name: 'scripts' },
{ name: 'package' }
],
docs: documentationScopes,
feat: allMatchers,
fix: allMatchers,
perf: allMatchers,
refactor: allMatchers,
test: allMatchers
},
*/

// override the messages, defaults are as follows
messages: {
type: "Select the type of change that you're committing:",
Expand All @@ -70,7 +126,7 @@ module.exports = {

// limit subject length
subjectLimit: 100,
// breaklineChar: '|', // It is supported for fields body and footer.
breaklineChar: '|', // It is supported for fields body and footer.
footerPrefix: 'Resolves:'
// askForBreakingChangeFirst : true, // default is false
}
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
coverage
out
out
docs
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug Report
description: File a bug report
title: '[Bug]: '
title: 'Bug Description'
labels: ['bug']
assignees:
- m-scott-lassiter
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Documentation Request
description: Request additional or clarified documentation
title: '[Docs Request]: '
title: 'Description'
labels: ['documentation']
assignees:
- m-scott-lassiter
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/new_matcher_request.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: New Matcher Request
about: Suggest a new matcher for this project
title: '[New Matcher]: '
labels: 'new matcher'
title: 'newMatcherName'
labels: 'new matcher proposal'
assignees: m-scott-lassiter
---

Expand Down
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,35 @@ Please check if your PR fulfills the following requirements:
- [ ] My commits follow the [appropriate guidance](https://github.com/M-Scott-Lassiter/jest-geojson/blob/main/CONTRIBUTING.md#commits)
- [ ] I certify that I have the appropriate permissions to add these changes to the repository
- [ ] An issue is open for the changes proposed

## Non-Matcher Checklist

- [ ] I have added/updated tests for new code changes (if applicable)
- [ ] Documentation has been added/updated (if applicable)
- [ ] I built (`npm run build`) locally and pushed all changes

## New Matcher Checklist

- <u>Create Core Function</u>
- [ ] Create a core function under `src/core/<category>`
- [ ] Document the function using JSDoc. Refer to the issue.
- [ ] Register the core function in `src/core.js`
- <u>Create Matcher Function</u>
- [ ] Create a matcher function under `src/matchers/<category>`
- [ ] Document the matcher using JSDoc. Refer to the issue.
- [ ] Register the matcher in `src/matchers.js`
- <u>Add Testing</u>
- [ ] Create a test for the matcher under `tests/<category>`
- [ ] Add a test to `tests/core.test.js`
- [ ] Add a test to `matchers.test.js`
- [ ] Verify all tests pass and have 100% coverage
- <u>Setup</u>
- [ ] Register the matcher under `src/setup/all.js`
- [ ] Register the matcher under `src/setup/<category>.js`
- [ ] Add the matcher to the README.md list (alphabetical order within category)
- [ ] Add the matcher to the `.cz-config.js` list (alphabetical order under the `coordinateMatchers` variable)
- [ ] I built (`npm run build`) locally and pushed all changes

Issues Addressed: (e.g. #1, #5, #22)

## Other Information
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CD Build

on:
push:
branches: [main, beta]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Clean Install
run: npm ci
# The FORCE_COLOR is required because tests were failing in Github due to the snapshots.
# See: https://stackoverflow.com/questions/72311493/jest-snapshots-causing-github-action-tests-to-fail
- name: Build
run: npm run build
env:
FORCE_COLOR: true
- name: Release new version to NPM
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI Tests

on:
push:
branches: [main]
pull_request:
branches: [main, next]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x, 17.x, 18.x]
os: [ubuntu-latest, windows-latest, macos-latest]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Clean Install
run: npm ci
# The FORCE_COLOR is required because tests were failing in Github due to the snapshots.
# See: https://stackoverflow.com/questions/72311493/jest-snapshots-causing-github-action-tests-to-fail
- name: Test
run: npm run test
env:
FORCE_COLOR: true
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,3 @@ dist

# TernJS port file
.tern-port

# JSDoc Generated Documentation
out
Loading

0 comments on commit e0c5942

Please sign in to comment.