Skip to content

Commit

Permalink
chore: Use @layerzerolabs/prettier-config-next
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Nov 23, 2023
1 parent 8b6922d commit 3790bf2
Show file tree
Hide file tree
Showing 71 changed files with 1,789 additions and 1,610 deletions.
18 changes: 9 additions & 9 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "origin/main",
"updateInternalDependencies": "patch",
"ignore": []
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "origin/main",
"updateInternalDependencies": "patch",
"ignore": []
}
62 changes: 33 additions & 29 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
{
"root": true,
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"mocha": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "mocha", "prettier"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 8
},
"ignorePatterns": ["node_modules/", "dist/", ".turbo/"],
"rules": {
"mocha/no-skipped-tests": "error",
"mocha/no-exclusive-tests": "error",
"prettier/prettier": "error",
"root": true,
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"mocha": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "mocha", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": 8
},
"ignorePatterns": ["node_modules/", "dist/", ".turbo/"],
"rules": {
"mocha/no-skipped-tests": "error",
"mocha/no-exclusive-tests": "error",
"prettier/prettier": "error",

// Intermediate deescalation to warnings
//
// FIXME Slowly remove these problems, then remove these overrides
"no-undef": "warn",
"no-constant-condition": "warn",
// Intermediate deescalation to warnings
//
// FIXME Slowly remove these problems, then remove these overrides
"no-undef": "warn",
"no-constant-condition": "warn",

"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-var-requires": "warn"
}
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-var-requires": "warn"
}
}
18 changes: 9 additions & 9 deletions .github/workflows/on-develop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
name: Check code submission

on:
push:
# We have package publishing workflow running on main so this one is redundant
branches-ignore:
- "main"
push:
# We have package publishing workflow running on main so this one is redundant
branches-ignore:
- "main"

# We want the workflow to stop and yield to a new run if new code is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
uses: ./.github/workflows/reusable-test.yaml
secrets: inherit
check:
uses: ./.github/workflows/reusable-test.yaml
secrets: inherit
24 changes: 12 additions & 12 deletions .github/workflows/on-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
name: Check & publish

on:
push:
branches:
- main
push:
branches:
- main

# We only want one workflow to run at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
check:
uses: ./.github/workflows/reusable-test.yaml
secrets: inherit
check:
uses: ./.github/workflows/reusable-test.yaml
secrets: inherit

publish:
needs: check
uses: ./.github/workflows/reusable-publish.yaml
secrets: inherit
publish:
needs: check
uses: ./.github/workflows/reusable-publish.yaml
secrets: inherit
122 changes: 61 additions & 61 deletions .github/workflows/reusable-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,77 +10,77 @@
name: Publish packages

on:
workflow_call:
workflow_call:

# We'll default the NPM_TOKEN to an empty value since we use it
# in .npmrc file and if undefined, the node setup would fail
env:
NPM_TOKEN: ""
NPM_TOKEN: ""

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"

# Install the dependencies without running the post-install scripts
- name: Install Dependencies
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Install the dependencies without running the post-install scripts
- name: Install Dependencies
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# Run the post-install scripts
- name: Build Dependencies
run: yarn install --frozen-lockfile --offline
# Run the post-install scripts
- name: Build Dependencies
run: yarn install --frozen-lockfile --offline

# Cache build artifacts from turbo
#
# This step will speed up workflow runs that don't touch the whole codebase
# (or the ones that don't touch the codebase at all)
- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-turbo-
# Cache build artifacts from turbo
#
# This step will speed up workflow runs that don't touch the whole codebase
# (or the ones that don't touch the codebase at all)
- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Build
run: yarn build
env:
NODE_ENV: production
- name: Build
run: yarn build
env:
NODE_ENV: production

# This step uses the changesets CLI to bump the package versions and/or publish the unpublished packages
#
# How this works is:
#
# - If there are any changesets (markdown files in the .changeset directory),
# changesets CLI will bump the package versions according to the bumps specified in the markdown files.
#
# - A PR is created containing these version bumps and with the changeset markdowns deleted
#
# - Once this PR is merged, this workflow kicks in again and this time checks
# whether there is anything that needs to be published
- name: Publish packages / create version bump PRs
uses: changesets/action@v1
with:
version: yarn changeset version
publish: yarn changeset publish
title: "🚀 Version packages"
# This step uses the changesets CLI to bump the package versions and/or publish the unpublished packages
#
# How this works is:
#
# - If there are any changesets (markdown files in the .changeset directory),
# changesets CLI will bump the package versions according to the bumps specified in the markdown files.
#
# - A PR is created containing these version bumps and with the changeset markdowns deleted
#
# - Once this PR is merged, this workflow kicks in again and this time checks
# whether there is anything that needs to be published
- name: Publish packages / create version bump PRs
uses: changesets/action@v1
with:
version: yarn changeset version
publish: yarn changeset publish
title: "🚀 Version packages"

env:
# This is here because changesets/action will look for the .npmrc
# in HOME folder and if it doesn't find one there it will create one
#
# Since we want to make sure it uses our .npmrc we'll just point it
# to our workspace root
HOME: ${{ github.workspace }}
GITHUB_TOKEN: ${{ secrets.LAYERZERO_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISHER }}
env:
# This is here because changesets/action will look for the .npmrc
# in HOME folder and if it doesn't find one there it will create one
#
# Since we want to make sure it uses our .npmrc we'll just point it
# to our workspace root
HOME: ${{ github.workspace }}
GITHUB_TOKEN: ${{ secrets.LAYERZERO_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISHER }}
82 changes: 41 additions & 41 deletions .github/workflows/reusable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,57 @@
name: Vape Tests

on:
workflow_call:
workflow_call:

# We'll default the NPM_TOKEN to an empty value since we use it
# in .npmrc file and if undefined, the node setup would fail
env:
NPM_TOKEN: ""
NPM_TOKEN: ""

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"

# Install the dependencies without running the post-install scripts
- name: Install Dependencies
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Install the dependencies without running the post-install scripts
- name: Install Dependencies
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

# Run the post-install scripts
- name: Build Dependencies
run: yarn install --frozen-lockfile --offline
# Run the post-install scripts
- name: Build Dependencies
run: yarn install --frozen-lockfile --offline

# Cache build artifacts from turbo
#
# This step will speed up workflow runs that don't touch the whole codebase
# (or the ones that don't touch the codebase at all)
- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-turbo-
# Cache build artifacts from turbo
#
# This step will speed up workflow runs that don't touch the whole codebase
# (or the ones that don't touch the codebase at all)
- name: Cache turbo build setup
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key: ${{ runner.os }}-turbo-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Lint
run: yarn lint
- name: Lint
run: yarn lint

- name: Build
run: yarn build
- name: Build
run: yarn build

- name: Test
run: yarn test
# Since we're running the E2E tests in docker, we'll need to reinstall
# the node modules. This is a temporary solution to bridge us between
# non-containerized and containerized development
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Test
run: yarn test
# Since we're running the E2E tests in docker, we'll need to reinstall
# the node modules. This is a temporary solution to bridge us between
# non-containerized and containerized development
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 2 additions & 6 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
module.exports = {
printWidth: 145,
tabWidth: 4,
useTabs: false,
semi: false,
trailingComma: "es5",
}
...require('@layerzerolabs/prettier-config-next'),
};
Loading

0 comments on commit 3790bf2

Please sign in to comment.