Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metalsmith build #279

Merged
merged 35 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f435192
Add TypeScript project structure
razor-x Jul 22, 2024
e1c082c
Add metalsmith
razor-x Jul 22, 2024
47ac595
Add blueprint and types
razor-x Jul 22, 2024
3f95e93
Add code-sample
razor-x Jul 23, 2024
f40e085
Add blueprint plugin
razor-x Jul 23, 2024
765b8c4
Add codeSampleDefinitions
razor-x Jul 23, 2024
63ee125
Add pages from endpoints
razor-x Jul 23, 2024
dbf42cc
Only format src
razor-x Jul 23, 2024
a70b367
Add metalsmith layouts plugin
razor-x Jul 23, 2024
61a1fe8
Add empty layouts
razor-x Jul 23, 2024
83435dc
Add .nvmrc
razor-x Jul 23, 2024
9025cda
Generate files for sdk and api
razor-x Jul 23, 2024
b3d4af7
Move metalsmith items to dependencies
razor-x Jul 23, 2024
1c8aded
Setup layouts
razor-x Jul 23, 2024
a7645f3
Remove empty yaml
razor-x Jul 23, 2024
e3f1203
Move output
razor-x Jul 23, 2024
d5286fb
Add workflows
razor-x Jul 23, 2024
6a598d5
ci: Format code
seambot Jul 23, 2024
dcaf496
Only lint src
razor-x Jul 23, 2024
e91a38b
Add .prettierignore
razor-x Jul 23, 2024
5e5393e
Set skipLibCheck
razor-x Jul 23, 2024
c1569b8
Remove matrix in workflows
razor-x Jul 23, 2024
64c7af7
Update blueprint
razor-x Jul 23, 2024
e7fcaa1
Update blueprint
razor-x Jul 23, 2024
eea639f
Update output path
razor-x Jul 23, 2024
6edaa51
Add README for development
razor-x Jul 23, 2024
830f0f2
Update package.json
razor-x Jul 23, 2024
da279a7
Run format
razor-x Jul 23, 2024
4fef6f5
ci: Generate code
seambot Jul 23, 2024
fa96a5f
Use list
razor-x Jul 23, 2024
88593da
Do not link to Dependabot
razor-x Jul 23, 2024
e89ebb5
Add doc gen step to generate
razor-x Jul 23, 2024
ee2ff92
Format after build
razor-x Jul 23, 2024
54de7e5
ci: Generate docs
seambot Jul 23, 2024
d478be1
Update types
razor-x Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
63 changes: 63 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"root": true,
"plugins": ["simple-import-sort", "unused-imports"],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
},
"rules": {
"no-console": "error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"import/extensions": ["error", "ignorePackages"],
"import/no-duplicates": ["error", { "prefer-inline": true }],
"import/no-relative-parent-imports": "error",
"simple-import-sort/imports": [
"error",
{
"groups": [
["^\\u0000"],
["^node:"],
["^@?\\w"],
["@seamapi/makenew-tsmodule"],
["^lib/"],
["^"],
["^\\."]
]
}
],
"simple-import-sort/exports": "error"
},
"overrides": [
{
"files": ["*.js", "*.mjs", "*.cjs"],
"extends": ["standard", "prettier"]
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["standard-with-typescript", "prettier"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}
38 changes: 38 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Setup
description: Setup Node.js and install dependencies.

inputs:
node_version:
description: The Node.js version.
required: false
default: '20'
registry_url:
description: The Node.js package registry URL.
required: false
default: https://registry.npmjs.org
install_dependencies:
description: Install dependencies.
required: false
default: 'true'

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
if: inputs.install_dependencies == 'true'
with:
cache: npm
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Setup Node.js without cache
uses: actions/setup-node@v4
if: inputs.install_dependencies == 'false'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Install dependencies
if: inputs.install_dependencies == 'true'
shell: bash
run: npm ci
34 changes: 34 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Check

on:
push:
branches:
- main
pull_request:
branches:
- '**'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Lint
run: npm run lint
typecheck:
name: Typecheck
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Typecheck
run: npm run typecheck
41 changes: 41 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Format

on:
push:
branches-ignore:
- main
workflow_dispatch: {}

jobs:
commit:
name: Format code
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
- name: Format
run: npm run format
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
if: always()
with:
commit_message: 'ci: Format code'
commit_user_name: ${{ secrets.GIT_USER_NAME }}
commit_user_email: ${{ secrets.GIT_USER_EMAIL }}
commit_author: ${{ secrets.GIT_USER_NAME }} <${{ secrets.GIT_USER_EMAIL }}>
44 changes: 44 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Generate

on:
push:
branches-ignore:
- main
workflow_dispatch: {}

jobs:
commit:
name: Generate code
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
with:
install_dependencies: 'false'
- name: Normalize package-lock.json
run: npm install
- name: Generate docs
run: npm run build
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'ci: Generate docs'
commit_user_name: ${{ secrets.GIT_USER_NAME }}
commit_user_email: ${{ secrets.GIT_USER_EMAIL }}
commit_author: ${{ secrets.GIT_USER_NAME }} <${{ secrets.GIT_USER_EMAIL }}>
Loading