Skip to content

Commit

Permalink
Merge pull request #185 from FormidableLabs/v2
Browse files Browse the repository at this point in the history
v2 with TypeScript, `tsup`, and `pnpm` workspace
  • Loading branch information
carloskelly13 committed Apr 18, 2023
2 parents d307f34 + a24f373 commit c914fde
Show file tree
Hide file tree
Showing 101 changed files with 9,678 additions and 16,529 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{
"repo": "FormidableLabs/prism-react-renderer"
}
],
"access": "public",
"baseBranch": "master"
}
53 changes: 53 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"extends": [
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:cypress/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime"
],
"env": {
"node": true,
"browser": true,
"jest": true
},
"settings": {
"react": {
"version": "detect"
}
},
"globals": {
"page": true
},
"ignorePatterns": ["prism-langs.ts", "**/dist/**/*", "**/build/**/*", "**/node_modules/**/*", "**/public/**/*", "**/.docusaurus/**/*"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react", "react-hooks", "prettier", "@typescript-eslint"],
"rules": {
"max-params": 0,
"max-statements": 0,
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off",
"no-invalid-this": 0,
"no-magic-numbers": 0,
"no-unused-expressions": 0,
"prettier/prettier": "error",
"react/no-multi-comp": 0,
"react/prefer-es6-class": 0,
"react/prop-types": 0,
"react/sort-prop-types": 0,
"react/no-string-refs": 0,
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }],
"react/no-did-update-set-state": 0,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"@typescript-eslint/no-var-requires": 0
},
}
12 changes: 0 additions & 12 deletions .flowconfig

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: groqd Release Workflow

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/action-setup@v2
with:
version: 8.2.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm run build

- name: PR or Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm run version
publish: pnpm run changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Static Analysis

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
static-analysis:
name: 'Lint and Type-check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18

- uses: pnpm/action-setup@v2
with:
version: 8.2.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build library
run: pnpm run build
- name: Type Check
run: pnpm run typecheck
- name: Lint
run: pnpm run lint
44 changes: 44 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Unit Test

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
matrix:
name: 'Node ${{ matrix.node }}'
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- uses: pnpm/action-setup@v2
with:
version: 8.2.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Generate language definitions
run: pnpm run build:languages

- name: Unit Test
run: pnpm run test

7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
node_modules
/dist
/themes
/prism/*.js

dist
.DS_Store
.vscode
sandbox/node_modules
*.log
prism-langs.ts
.idea
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"arrowParens": "avoid",
"xmlWhitespaceSensitivity": "ignore",
"proseWrap": "always",
"singleQuote": false
}
Loading

0 comments on commit c914fde

Please sign in to comment.