Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
haltcase committed Apr 2, 2024
1 parent fab51d6 commit f71c0c4
Show file tree
Hide file tree
Showing 21 changed files with 5,084 additions and 722 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
@@ -0,0 +1,15 @@
root = true

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

[*.md]
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_size = 2
indent_style = space
62 changes: 27 additions & 35 deletions .eslintrc.cjs
@@ -1,38 +1,30 @@
"use strict"
"use strict";

const [, , error] = ["off", "warn", "error"]
const { resolve } = require("node:path");

module.exports = {
extends: ["./node_modules/ts-standardx/.eslintrc.js"],
ignorePatterns: ["dist"],
rules: {
"no-unused-vars": [
error,
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
],
quotes: [error, "double"],
const project = [
resolve(__dirname, "tsconfig.json"),
resolve(__dirname, "./tests/tsconfig.json")
];

"prettier/prettier": [
error,
{
semi: false,
singleQuote: false,
trailingComma: "none",
bracketSameLine: true,
arrowParens: "avoid"
}
]
},
overrides: [
{
files: ["**/*.{ts,tsx}"],
rules: {
"@typescript-eslint/quotes": [error, "double"]
}
}
]
}
module.exports = {
env: {
node: true,
es2023: true
},
extends: [
require.resolve("@haltcase/style/eslint/node"),
require.resolve("@haltcase/style/eslint/typescript")
],
parserOptions: {
ecmaVersion: 2023,
project: true
},
settings: {
"import/resolver": {
typescript: {
project
}
}
}
};
36 changes: 36 additions & 0 deletions .github/workflows/quality.yml
@@ -0,0 +1,36 @@
name: Quality

on:
pull_request:
push:
branches:
- "canary"
- "main"

jobs:
code-quality:
name: Code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
check-latest: true
cache: "pnpm"

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
run_install: true

- name: Check linting (ESLint)
run: pnpm eslint:check

- name: Check formatting (Prettier)
run: pnpm prettier:check

- name: Check linting (ESLint)
run: pnpm typescript:check
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Expand Up @@ -7,11 +7,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 14]
node: [18, 20]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- name: Install Node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: yarn && yarn test
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm test
22 changes: 17 additions & 5 deletions .gitignore
@@ -1,13 +1,25 @@
# ide configurations
.c9
.idea
.vscode
# https://help.github.com/articles/ignoring-files/

# dependencies
/node_modules
/.pnp
/.pnpm-store
.pnp.js

# lock files
npm-shrinkwrap.json
package-lock.json
yarn.lock

node_modules
# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

tsconfig.tsbuildinfo

/dist
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

15 changes: 15 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,15 @@
{
"search.exclude": {
"package-lock.json": true,
"pnpm-lock.yaml": true
},
"prettier.arrowParens": "always",
"prettier.bracketSpacing": true,
"prettier.bracketSameLine": true,
"prettier.printWidth": 80,
"prettier.semi": true,
"prettier.singleQuote": false,
"prettier.trailingComma": "none",
"prettier.useTabs": true,
"typescript.tsdk": "node_modules\\typescript\\lib"
}
10 changes: 0 additions & 10 deletions ava.config.js

This file was deleted.

112 changes: 63 additions & 49 deletions package.json
@@ -1,51 +1,65 @@
{
"name": "tablemark",
"version": "3.1.0",
"description": "Generate markdown tables from a list of objects or JSON data.",
"author": "Bo Lingen <bo@haltcase.dev> (https://github.com/haltcase)",
"license": "MIT",
"repository": "https://github.com/haltcase/tablemark",
"homepage": "https://github.com/haltcase/tablemark",
"bugs": "https://github.com/haltcase/tablemark/issues",
"engines": {
"node": ">=14.16"
},
"type": "module",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"sideEffects": false,
"keywords": [
"markdown",
"table",
"tables",
"json",
"convert",
"generate",
"ghfm",
"tableify",
"typescript"
],
"files": [
"dist"
],
"scripts": {
"lint": "ts-standardx src && cd tests && ts-standardx .",
"build": "tsc",
"pretest": "npm run build",
"test": "ava",
"changelog": "changelog",
"prepublishOnly": "npm run lint && npm test"
},
"devDependencies": {
"@citycide/changelog": "^2.0.0",
"@types/node": "^14.17.27",
"ava": "^3.15.0",
"ts-node": "^10.3.0",
"ts-standardx": "^0.8.4",
"typescript": "^4.4.4"
},
"dependencies": {
"sentence-case": "^3.0.4",
"split-text-to-chunks": "^1.0.0"
}
"name": "tablemark",
"version": "3.1.0",
"description": "Generate markdown tables from a list of objects or JSON data.",
"keywords": [
"markdown",
"table",
"tables",
"json",
"convert",
"generate",
"ghfm",
"tableify",
"typescript"
],
"homepage": "https://github.com/haltcase/tablemark",
"bugs": "https://github.com/haltcase/tablemark/issues",
"repository": "https://github.com/haltcase/tablemark",
"license": "MIT",
"author": "Bo Lingen <bo@haltcase.dev> (https://github.com/haltcase)",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"changelog": "changelog",
"eslint:check": "eslint src tests",
"format": "eslint --fix src tests && prettier --write src tests",
"prepublishOnly": "pnpm format && pnpm test",
"prettier:check": "prettier --check src tests",
"test": "glob \"**/*.test.ts\" --cmd \"node --import tsx --test\"",
"typescript:check": "tsc --noEmit && echo \"No errors reported by tsc.\""
},
"prettier": "@haltcase/style/prettier",
"dependencies": {
"sentence-case": "^3.0.4",
"split-text-to-chunks": "^1.0.0"
},
"devDependencies": {
"@citycide/changelog": "^2.0.0",
"@haltcase/style": "^6.1.0",
"@types/node": "^20.12.2",
"eslint": "^8.57.0",
"glob": "^10.3.12",
"prettier": "^3.2.5",
"tsx": "^4.7.1",
"typescript": "^5.3.3"
},
"packageManager": "pnpm@8.11.0",
"engines": {
"node": ">=18"
},
"publishConfig": {
"access": "public"
}
}

0 comments on commit f71c0c4

Please sign in to comment.