Skip to content

Commit

Permalink
Clone oss-npm-package
Browse files Browse the repository at this point in the history
  • Loading branch information
skuba committed Mar 20, 2023
1 parent 8c3638b commit 38ff868
Show file tree
Hide file tree
Showing 21 changed files with 8,127 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# managed by skuba
.gantry/
.git/
.idea/
.serverless/
.vscode/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/

.DS_Store
.npmrc
npm-debug.log
yarn-error.log
# end managed by skuba
14 changes: 14 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# managed by skuba
.idea/*
.vscode/*

.cdk.staging/
.serverless/
cdk.out/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/
# end managed by skuba
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['skuba'],
};
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* @seek-oss/skuba-maintainers

# Configured by Renovate
package.json
yarn.lock
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
extends: ['github>seek-oss/rynovate'],
}
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches:
- beta
- master

permissions: {}

jobs:
release:
name: Publish & Deploy
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Publish to npm
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEEK_OSS_CI_NPM_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Validate

on:
- pull_request
- push

permissions: {}

jobs:
validate:
name: Lint & Test
permissions:
checks: write
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Set up Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test
run: yarn test:ci

- name: Lint
run: yarn lint
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# managed by skuba
.idea/*
.vscode/*

.cdk.staging/
.serverless/
cdk.out/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/

.DS_Store
.eslintcache
.npmrc
*.tgz
*.tsbuildinfo
npm-debug.log
package-lock.json
yarn-error.log
# end managed by skuba
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
20 changes: 20 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# managed by skuba
.idea/*
.vscode/*

.cdk.staging/
.serverless/
cdk.out/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/

# Gantry resource files support non-standard template syntax
/.gantry/**/*.yaml
/.gantry/**/*.yml
gantry*.yaml
gantry*.yml
# end managed by skuba
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('skuba/config/prettier');
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### MIT License

Copyright (c) 2020 SEEK

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
128 changes: 128 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# zod-openapi

[![Powered by skuba](https://img.shields.io/badge/🤿%20skuba-powered-009DC4)](https://github.com/seek-oss/skuba)

This package is intended to be public on [seek-oss].
To create an internal package,
run `skuba init` and select the `private-npm-package` template.

Next steps:

1. [ ] Read [SEEK's Open Source RFC].
2. [ ] Create a new repository in the [seek-oss] GitHub organisation.
3. [ ] Push local commits to the upstream GitHub branch.
4. [ ] Configure [GitHub repository settings].
5. [ ] Keep dependencies up to date with [Renovate];
request installation in [#open-source].
6. [ ] Delete this checklist 😌.

[#open-source]: https://slack.com/app_redirect?channel=C39P1H2SU
[github repository settings]: https://github.com/seek-oss/zod-openapi/settings
[renovate]: https://github.com/apps/renovate
[seek's open source rfc]: https://rfc.skinfra.xyz/RFC016-Open-Source.html

## API

### `log`

Writes the module name to stdout.
Thrilling stuff.

```typescript
import { log } from 'zod-openapi';

log();
```

## Development

### Prerequisites

- Node.js LTS
- Yarn 1.x

```shell
yarn install
```

### Test

```shell
yarn test
```

### Lint

```shell
# Fix issues
yarn format

# Check for issues
yarn lint
```

### Package

```shell
# Compile source
yarn build

# Review bundle
npm pack
```

## Release

This package is published to the public npm registry with a GitHub Actions [release workflow].

The workflow runs on select branches:

```yaml
on:
push:
branches:
# add others as necessary
- beta
- master
# - alpha
```

It depends on this repo being hosted on [seek-oss] with appropriate access.

To set up this repo for publishing, follow the instructions in our [OSS npm package guidance].

### Commit messages

This package is published with **[semantic-release]**, which requires a particular commit format to manage semantic versioning.
You can run the interactive `yarn commit` command in place of `git commit` to generate a compliant commit title and message.
If you use the `Squash and merge` option on pull requests, take extra care to format the squashed commit in the GitHub UI before merging.

### Releasing latest

Commits to the `master` branch will be released with the `latest` tag,
which is the default used when running `npm install` or `yarn install`.

### Releasing other dist-tags

**[semantic-release]** prescribes a branch-based workflow for managing [distribution tags].

You can push to other branches to manage betas, maintenance updates to prior major versions, and more.

Here are some branches that **semantic-release** supports by default:

| Git branch | npm dist-tag |
| :--------- | :----------- |
| master | latest |
| alpha | alpha |
| beta | beta |
| next | next |
| 1.x | release-1.x |

For more information, see the **semantic-release** docs on [triggering a release].

[distribution tags]: https://docs.npmjs.com/adding-dist-tags-to-packages
[oss npm package guidance]: https://github.com/SEEK-Jobs/seek-oss-ci/blob/master/NPM_PACKAGES.md#access-to-publish-to-npm
[release workflow]: .github/workflows/release.yml
[seek-oss]: https://github.com/seek-oss
[semantic-release]: https://github.com/semantic-release/semantic-release
[triggering a release]: https://github.com/semantic-release/semantic-release/#triggering-a-release
15 changes: 15 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Jest } from 'skuba';

export default Jest.mergePreset({
coveragePathIgnorePatterns: ['src/testing'],
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
},
setupFiles: ['<rootDir>/jest.setup.ts'],
testPathIgnorePatterns: ['/test\\.ts'],
});
3 changes: 3 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
process.env.ENVIRONMENT = 'test';

export {};
54 changes: 54 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "zod-openapi",
"version": "0.0.0-semantically-released",
"description": "Zod OpenAPI Plugin",
"homepage": "https://github.com/seek-oss/zod-openapi#readme",
"bugs": {
"url": "https://github.com/seek-oss/zod-openapi/issues"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/seek-oss/zod-openapi.git"
},
"license": "MIT",
"sideEffects": false,
"main": "./lib-commonjs/index.js",
"module": "./lib-es2015/index.js",
"types": "./lib-types/index.d.ts",
"files": [
"lib*/**/*.d.ts",
"lib*/**/*.js",
"lib*/**/*.js.map",
"lib*/**/*.json"
],
"scripts": {
"build": "skuba build-package",
"commit": "cz",
"format": "skuba format",
"lint": "skuba lint",
"release": "yarn build && skuba release",
"test": "skuba test",
"test:ci": "skuba test --coverage",
"test:watch": "skuba test --watch"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"dependencies": {},
"devDependencies": {
"@types/node": "^16.18.3",
"commitizen": "^4.2.4",
"skuba": "6.0.0"
},
"engines": {
"node": ">=16.11"
},
"skuba": {
"entryPoint": "src/index.ts",
"template": "oss-npm-package",
"type": "package",
"version": "6.0.0"
}
}
5 changes: 5 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { log } from './index';

describe('app', () => {
it('defines a log function', () => expect(log).toBeDefined());
});
Loading

0 comments on commit 38ff868

Please sign in to comment.