Skip to content

Commit

Permalink
Add yarn berry, publish and docs workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Lefkowitz committed Apr 30, 2024
1 parent ace5c6f commit c76b9d0
Show file tree
Hide file tree
Showing 23 changed files with 6,390 additions and 97 deletions.
1 change: 1 addition & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ current_version = 1.5.0
[bumpversion:file:package.json]
search = "version": "{current_version}"
replace = "version": "{new_version}"

28 changes: 16 additions & 12 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"language": "en",
"ignorePaths": [
".git",
".gitignore",
".husky",
"coverage",
"dist",
"yarn-error.log"
],
"dictionaries": [
"aws",
"bash",
"en-gb",
"fullstack",
"misc",
"node",
"softwareTerms",
"typescript"
"softwareTerms"
],
"words": ["autofix", "bumpversion", "codacy", "lefkowitz", "xlink"]
"ignorePaths": [".git"],
"words": [
"autofix",
"bumpversion",
"cliui",
"codacy",
"corepack",
"giphy",
"jsdoc",
"lefkowitz",
"trufflehog",
"xlink"
]
}
27 changes: 11 additions & 16 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,22 @@ runs:
using: composite
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Fetch yarn's cache directory path
id: yarn-cache-dir-path
- name: Enable corepack
shell: bash
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> $GITHUB_ENV

- name: Set up yarn package caching
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ env.YARN_CACHE_DIR }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
run: corepack enable

- name: Set the node version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: yarn

- name: Install yarn dependencies
shell: bash
run: yarn install --immutable

- name: Install node dependencies
- name: Install trufflehog3
shell: bash
run: yarn install --frozen-lockfile
run: pip install trufflehog3
13 changes: 6 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ on:
tags:
- "*.*.*"

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false
Expand All @@ -19,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install
Expand All @@ -36,11 +31,15 @@ jobs:
path: "docs/dist"

deploy:
permissions:
pages: write
id-token: write

runs-on: ubuntu-latest
needs: build

environment:
name: github-pages
name: Pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install

- name: Build the package
run: npm run build

- uses: JS-DevTools/npm-publish@v1
- name: Publish the package
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install
Expand All @@ -22,4 +22,4 @@ jobs:
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage/lcov.info
coverage-reports: coverage/clover.xml
30 changes: 3 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
.spago/
bower_components/
node_modules/
venv/

build/
.DS_Store
.yarn/
coverage/
dist/
generated-docs/
output/
tests_output/

__pycache__/
.mypy_cache/
.nx/
.pytest_cache/
.terraform/

*.coverage
*.dblite
*.egg-info/
*.env*
*.o
*.pyc
*.types

.DS_Store
.psc-ide-port
.terraform.lock.hcl
node_modules/
yarn-error.log
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["prettier-plugin-jsdoc"],
"jsdocCapitalizeDescription": true,
"jsdocVerticalAlignment": true,
"overrides": [
{
"files": "*.md",
"options": { "printWidth": 120 }
}
]
}
18 changes: 18 additions & 0 deletions .trufflehog3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
severity: low
exclude:
- message: Giphy links
pattern: media\.giphy\.com

- message: Shield links
pattern: img\.shields\.io

- message: Dependencies
paths:
- node_modules

- message: Tooling outputs
paths:
- docs/dist
- package-lock.json
- yarn-error.log
- yarn.lock
32 changes: 32 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Start",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/ts-node",
"runtimeArgs": ["--transpile-only"],
"program": "${file}",
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Test",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": [
"--verbose",
"-i",
"--no-cache",
"--testPathPattern",
"${fileBasename}"
],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,34 @@ Counts and displays the number of syllables per line in the active document.
![Review](https://img.shields.io/github/actions/workflow/status/JoelLefkowitz/syllable-counter/review.yml)
![Version](https://img.shields.io/npm/v/syllable-counter)
![Downloads](https://img.shields.io/npm/dw/syllable-counter)
![Size](https://img.shields.io/bundlephobia/min/syllable-counter)
![Quality](https://img.shields.io/codacy/grade/f5f5ce45a1594391abde33a206f53d84)
![Coverage](https://img.shields.io/codacy/coverage/f5f5ce45a1594391abde33a206f53d84)

## Example

![Example](docs/example.gif)

## Installing

```bash
npm install syllable-counter
```

## Documentation

Documentation and more detailed examples are hosted on [Github Pages](https://joellefkowitz.github.io/syllable-counter).

## Tooling

### Dependencies

To install dependencies:

```bash
yarn install
```

### Tests

To run tests:
Expand Down Expand Up @@ -72,8 +87,8 @@ bump2version patch

Lots of love to the open source community!

<p align='center'>
<div align='center'>
<img width=200 height=200 src='https://media.giphy.com/media/osAcIGTSyeovPq6Xph/giphy.gif' alt='Be kind to your mind' />
<img width=200 height=200 src='https://media.giphy.com/media/KEAAbQ5clGWJwuJuZB/giphy.gif' alt='Love each other' />
<img width=200 height=200 src='https://media.giphy.com/media/WRWykrFkxJA6JJuTvc/giphy.gif' alt="It's ok to have a bad day" />
</p>
</div>
Empty file added docs/images/.gitkeep
Empty file.
File renamed without changes
11 changes: 11 additions & 0 deletions docs/typedoc/assets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as fs from "fs";
import * as path from "path";
import { GlobSync } from "glob";

const cwd = path.resolve(__dirname, "../..");

[{ src: "docs/images", rel: "images" }]
.concat(new GlobSync("*.md", { cwd }).found.map((src) => ({ src, rel: src })))
.forEach(({ src, rel }) => {
fs.cpSync(src, `docs/dist/${rel}`, { recursive: true });
});
File renamed without changes.
15 changes: 15 additions & 0 deletions docs/typedoc/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"entryPoints": ["../../src"],
"out": "../dist",
"customCss": "./styles.css",
"cleanOutputDir": true,
"plugin": ["typedoc-material-theme"],
"themeColor": "#BA16B5",
"categorizeByGroup": true,
"groupOrder": ["Functions"],
"categoryOrder": ["Factories", "Aliases", "Validators"],
"navigation": {
"includeGroups": true,
"includeCategories": true
}
}
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "syllable-counter",
"description": "Syllable counter tree view VSCode extension.",
"version": "1.5.0",
"private": false,
"license": "MIT",
"author": "Joel Lefkowitz",
"repository": "https://github.com/joellefkowitz/syllable-counter",
Expand All @@ -15,6 +14,7 @@
"syllable",
"counter"
],
"packageManager": "[email protected]",
"metadata": {
"publisher": "npm",
"languages": [
Expand All @@ -27,18 +27,23 @@
"lifecycle": "Alpha"
},
"scripts": {
"prepare": "husky",
"lint": "cspell . --dot && eslint . --fix && tsc --noEmit",
"postinstall": "husky",
"lint": "cspell . --dot --gitignore && eslint . --fix && tsc --noEmit && trufflehog3",
"format": "prettier . --write",
"build": "tsc",
"test": "jest",
"docs": "typedoc"
"docs": "typedoc --options docs/typedoc/typedoc.json && ts-node ./docs/typedoc/assets.ts"
},
"resolutions": {
"cliui": "^8.0.1",
"strip-ansi": "^6.0.1"
},
"dependencies": {
"syllable": "^5.0.1",
"vscode": "^1.1.37"
},
"devDependencies": {
"@types/glob": "^8.1.0",
"@types/jest": "29.0.0",
"@types/node": "^18.11.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
Expand All @@ -50,11 +55,12 @@
"husky": "^9.0.0",
"jest": "^29.0.0",
"prettier": "^3.0.0",
"prettier-plugin-jsdoc": "^1.3.0",
"ts-jest": "^29.0.0",
"ts-node": "^10.9.2",
"tslib": "^2.3.0",
"typedoc": "^0.25.7",
"typedoc-material-theme": "^1.0.2",
"typescript": "^5.3.0"
"typescript": "~5.3.0"
}
}
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from "./arrays";
export * from "./main";
export * from "./TreeDataProvider";
export * from "./TreeItem";
export { activate, deactivate } from "./main";
export { TreeDataProvider } from "./TreeDataProvider";
export { TreeItem } from "./TreeItem";
3 changes: 0 additions & 3 deletions src/syllable.d.ts

This file was deleted.

Loading

0 comments on commit c76b9d0

Please sign in to comment.