Skip to content

Commit c914fde

Browse files
Merge pull request #185 from FormidableLabs/v2
v2 with TypeScript, `tsup`, and `pnpm` workspace
2 parents d307f34 + a24f373 commit c914fde

File tree

101 files changed

+9678
-16529
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+9678
-16529
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{
6+
"repo": "FormidableLabs/prism-react-renderer"
7+
}
8+
],
9+
"access": "public",
10+
"baseBranch": "master"
11+
}

.eslintrc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"prettier",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:prettier/recommended",
7+
"plugin:cypress/recommended",
8+
"plugin:react/recommended",
9+
"plugin:react/jsx-runtime"
10+
],
11+
"env": {
12+
"node": true,
13+
"browser": true,
14+
"jest": true
15+
},
16+
"settings": {
17+
"react": {
18+
"version": "detect"
19+
}
20+
},
21+
"globals": {
22+
"page": true
23+
},
24+
"ignorePatterns": ["prism-langs.ts", "**/dist/**/*", "**/build/**/*", "**/node_modules/**/*", "**/public/**/*", "**/.docusaurus/**/*"],
25+
"parser": "@typescript-eslint/parser",
26+
"parserOptions": {
27+
"ecmaVersion": 12,
28+
"ecmaFeatures": {
29+
"jsx": true
30+
}
31+
},
32+
"plugins": ["react", "react-hooks", "prettier", "@typescript-eslint"],
33+
"rules": {
34+
"max-params": 0,
35+
"max-statements": 0,
36+
"react/react-in-jsx-scope": "off",
37+
"react/jsx-uses-react": "off",
38+
"no-invalid-this": 0,
39+
"no-magic-numbers": 0,
40+
"no-unused-expressions": 0,
41+
"prettier/prettier": "error",
42+
"react/no-multi-comp": 0,
43+
"react/prefer-es6-class": 0,
44+
"react/prop-types": 0,
45+
"react/sort-prop-types": 0,
46+
"react/no-string-refs": 0,
47+
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }],
48+
"react/no-did-update-set-state": 0,
49+
"react-hooks/rules-of-hooks": "error",
50+
"react-hooks/exhaustive-deps": "error",
51+
"@typescript-eslint/no-var-requires": 0
52+
},
53+
}

.flowconfig

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: groqd Release Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
18+
- uses: pnpm/action-setup@v2
19+
with:
20+
version: 8.2.0
21+
- name: Get pnpm store directory
22+
id: pnpm-cache
23+
shell: bash
24+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
25+
- uses: actions/cache@v3
26+
name: Setup pnpm cache
27+
with:
28+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
29+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: ${{ runner.os }}-pnpm-store-
31+
- name: Install dependencies
32+
run: pnpm install
33+
34+
- name: Build packages
35+
run: pnpm run build
36+
37+
- name: PR or Publish
38+
id: changesets
39+
uses: changesets/action@v1
40+
with:
41+
version: pnpm run version
42+
publish: pnpm run changeset publish
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Static Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
static-analysis:
12+
name: 'Lint and Type-check'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
20+
- uses: pnpm/action-setup@v2
21+
with:
22+
version: 8.2.0
23+
- name: Get pnpm store directory
24+
id: pnpm-cache
25+
shell: bash
26+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
27+
- uses: actions/cache@v3
28+
name: Setup pnpm cache
29+
with:
30+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
31+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
32+
restore-keys: ${{ runner.os }}-pnpm-store-
33+
- name: Install dependencies
34+
run: pnpm install
35+
36+
- name: Build library
37+
run: pnpm run build
38+
- name: Type Check
39+
run: pnpm run typecheck
40+
- name: Lint
41+
run: pnpm run lint

.github/workflows/unit-test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Unit Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
matrix:
12+
name: 'Node ${{ matrix.node }}'
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
node: [16, 18]
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node }}
22+
23+
- uses: pnpm/action-setup@v2
24+
with:
25+
version: 8.2.0
26+
- name: Get pnpm store directory
27+
id: pnpm-cache
28+
shell: bash
29+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
30+
- uses: actions/cache@v3
31+
name: Setup pnpm cache
32+
with:
33+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: ${{ runner.os }}-pnpm-store-
36+
- name: Install dependencies
37+
run: pnpm install
38+
39+
- name: Generate language definitions
40+
run: pnpm run build:languages
41+
42+
- name: Unit Test
43+
run: pnpm run test
44+

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
node_modules
2-
/dist
3-
/themes
4-
/prism/*.js
5-
2+
dist
63
.DS_Store
74
.vscode
85
sandbox/node_modules
96
*.log
7+
prism-langs.ts
8+
.idea

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"arrowParens": "avoid",
4+
"xmlWhitespaceSensitivity": "ignore",
5+
"proseWrap": "always",
6+
"singleQuote": false
7+
}

0 commit comments

Comments
 (0)