Skip to content

Commit

Permalink
feat: release packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Nov 23, 2022
1 parent df6a1b6 commit 247817b
Show file tree
Hide file tree
Showing 22 changed files with 1,349 additions and 4,056 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@antfu"
"extends": "@ocavue/eslint-config"
}
22 changes: 0 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,3 @@ jobs:

- name: Typecheck
run: nr typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [14.x, 16.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node }}

- name: Build
run: nr build

- name: Test
run: nr test
15 changes: 3 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ jobs:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
release-type: node
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
command: manifest

publish:
runs-on: ubuntu-latest
needs: [version]
if: ${{ needs.version.outputs.release_created }}
steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/setup

- name: Build
run: nr build

- name: Publish to NPM
run: npm publish
run: pnpm -r publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/update-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Update Lock

on:
push:
branches:
- release-please*

jobs:
update-lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: false

- name: Update Lockfile
run: pnpm install --no-frozen-lockfile

- name: Push updated files
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "chore: update files"
git push || true
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
6 changes: 6 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages/eslint-config-basic": "0.3.0",
"packages/eslint-config-react": "0.3.0",
"packages/eslint-config": "0.3.0",
"packages/eslint-config-prettier": "0.3.0"
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# pkg-name
# @ocavue/eslint-config

[![@ocavue/eslint-config](https://img.shields.io/npm/v/@ocavue/eslint-config/latest?label=%40ocavue%2Feslint-config)](https://www.npmjs.com/package/@ocavue/eslint-config)
[![@ocavue/eslint-config-react](https://img.shields.io/npm/v/@ocavue/eslint-config-react/latest?label=%40ocavue%2Feslint-config-react)](https://www.npmjs.com/package/@ocavue/eslint-config-react)

[![NPM version](https://img.shields.io/npm/v/pkg-name?color=a1b858&label=)](https://www.npmjs.com/package/pkg-name)

## License

Expand Down
12 changes: 0 additions & 12 deletions build.config.ts

This file was deleted.

50 changes: 11 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,31 @@
{
"name": "pkg-name",
"name": "@ocavue/dev-config-monorepo",
"type": "module",
"version": "0.0.0",
"private": true,
"packageManager": "pnpm@7.12.0",
"description": "",
"author": "ocavue <ocavue@gmail.com>",
"license": "MIT",
"funding": "https://github.com/sponsors/ocavue",
"homepage": "https://github.com/ocavue/pkg-name#readme",
"homepage": "https://github.com/ocavue/@ocavue/dev-config-monorepo#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ocavue/pkg-name.git"
"url": "git+https://github.com/ocavue/@ocavue/dev-config-monorepo.git"
},
"bugs": "https://github.com/ocavue/pkg-name/issues",
"bugs": "https://github.com/ocavue/@ocavue/dev-config-monorepo/issues",
"keywords": [],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
}
},
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./dist/index.d.ts"
]
}
},
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint .",
"prepublishOnly": "nr build",
"start": "esno src/index.ts",
"test": "vitest",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@antfu/eslint-config": "^0.27.0",
"@antfu/ni": "^0.18.0",
"@types/node": "^18.7.18",
"eslint": "^8.23.1",
"esno": "^0.16.3",
"typescript": "^4.8.3",
"unbuild": "^0.8.11",
"vite": "^3.1.2",
"vitest": "^0.23.4"
"@antfu/ni": "^0.18.8",
"@ocavue/eslint-config": "workspace:*",
"@types/node": "^18.11.9",
"eslint": "^8.28.0",
"prettier": "^2.8.0",
"typescript": "~4.8.0"
}
}
169 changes: 169 additions & 0 deletions packages/eslint-config-basic/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
// @ts-check

const { defineConfig } = require('eslint-define-config')

module.exports = defineConfig({
env: {
browser: true,
node: true,
commonjs: true,
},

plugins: [
'eslint-plugin-unicorn',
'eslint-plugin-no-only-tests',
'@typescript-eslint',
],

extends: [
'eslint:recommended',
'plugin:jsonc/recommended-with-jsonc',
'plugin:yml/standard',
'plugin:markdown/recommended',

// https://typescript-eslint.io/docs/linting/configs
'plugin:@typescript-eslint/recommended',
],

ignorePatterns: [
'*.min.*',
'*.d.ts',
'CHANGELOG.md',
'LICENSE*',
'dist',
'out',
'output',
'coverage',
'public',
'tmp',
'temp',
'package-lock.json',
'pnpm-lock.yaml',
'yarn.lock',
'__snapshots__',
'!.github',
'!.vscode',
],

rules: {
// unicorn
// Enforce passing a message value when creating a built-in error
'unicorn/error-message': 'error',
// Require `Array.isArray()` instead of `instanceof Array`.
'unicorn/no-instanceof-array': 'error',

// typescript
'@typescript-eslint/no-explicit-any': 'off',

// yml
'yml/quotes': 'off',
},

overrides: [
{
files: ['*.json', '*.json5'],
parser: 'jsonc-eslint-parser',
rules: {
'jsonc/array-bracket-spacing': ['error', 'never'],
'jsonc/comma-dangle': ['error', 'never'],
'jsonc/comma-style': ['error', 'last'],
'jsonc/indent': ['error', 2],
'jsonc/key-spacing': [
'error',
{ beforeColon: false, afterColon: true },
],
'jsonc/no-octal-escape': 'error',
'jsonc/object-curly-newline': [
'error',
{ multiline: true, consistent: true },
],
'jsonc/object-curly-spacing': ['error', 'always'],
'jsonc/object-property-newline': [
'error',
{ allowMultiplePropertiesPerLine: true },
],
},
},
{
files: ['package.json'],
parser: 'jsonc-eslint-parser',
rules: {
'jsonc/sort-keys': [
'error',
{
pathPattern: '^$',
order: [
'name',
'displayName',
'publisher',
'type',
'version',
'private',
'packageManager',
'description',
'author',
'license',
'funding',
'homepage',
'repository',
'bugs',
'contributes',
'keywords',
'categories',
'sideEffects',
'main',
'module',
'types',
'exports',
'typesVersions',
'bin',
'icon',
'files',
'engines',
'scripts',
'dependencies',
'peerDependencies',
'peerDependenciesMeta',
'optionalDependencies',
'devDependencies',
'publishConfig',
'overrides',
'resolutions',
],
},
{
pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$',
order: { type: 'asc' },
},
{
pathPattern: '^exports.*$',
order: ['types', 'require', 'import', 'default'],
},
],
},
},
{
files: ['*.yaml', '*.yml'],
parser: 'yaml-eslint-parser',
},
{
// Code blocks in markdown file
files: ['**/*.md/*.*'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['*.test.*', '*.spec.*'],
rules: {
'no-only-tests/no-only-tests': 'error',
},
},
{
files: ['*.js', '*.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
})
23 changes: 23 additions & 0 deletions packages/eslint-config-basic/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@ocavue/eslint-config-basic",
"version": "0.2.1",
"main": "index.js",
"dependencies": {
"eslint-define-config": "^1.12.0",
"eslint-plugin-jsonc": "^2.5.0",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-unicorn": "^45.0.0",
"eslint-plugin-yml": "^1.2.0",
"yaml-eslint-parser": "^1.1.0"
},
"peerDependencies": {
"eslint": ">=8.0.0"
},
"devDependencies": {
"eslint": "^8.28.0"
},
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit 247817b

Please sign in to comment.