Skip to content

Commit

Permalink
modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
IMax153 committed Dec 2, 2023
1 parent 26af935 commit 554570c
Show file tree
Hide file tree
Showing 56 changed files with 2,498 additions and 3,185 deletions.
3 changes: 0 additions & 3 deletions .babel.cjs.json

This file was deleted.

3 changes: 0 additions & 3 deletions .babel.mjs.json

This file was deleted.

1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
42 changes: 27 additions & 15 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef */
module.exports = {
ignorePatterns: ["build", "examples", "dist", "dtslint", "*.mjs", "docs", "*.md"],
ignorePatterns: ["dist", "build", "*.md"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
Expand All @@ -20,9 +20,15 @@ module.exports = {
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@repo-tooling/dprint/recommended"
"plugin:@effect/recommended"
],
plugins: [
"deprecation",
"import",
"sort-destructure-keys",
"simple-import-sort",
"codegen"
],
plugins: ["deprecation", "import", "sort-destructure-keys", "simple-import-sort", "codegen"],
rules: {
"codegen/codegen": "error",
"no-fallthrough": "off",
Expand All @@ -42,17 +48,23 @@ module.exports = {
"simple-import-sort/imports": "off",
"sort-destructure-keys/sort-destructure-keys": "error",
"deprecation/deprecation": "off",
"@typescript-eslint/array-type": ["warn", { "default": "generic", "readonly": "generic" }],
"@typescript-eslint/array-type": [
"warn",
{ default: "generic", readonly: "generic" }
],
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/no-unused-vars": ["error", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
Expand All @@ -61,16 +73,16 @@ module.exports = {
"@typescript-eslint/no-array-constructor": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-namespace": "off",
"@repo-tooling/dprint/dprint": [
"@effect/dprint": [
"error",
{
config: {
"indentWidth": 2,
"lineWidth": 120,
"semiColons": "asi",
"quoteStyle": "alwaysDouble",
"trailingCommas": "never",
"operatorPosition": "maintain",
indentWidth: 2,
lineWidth: 100,
semiColons: "asi",
quoteStyle: "alwaysDouble",
trailingCommas: "never",
operatorPosition: "maintain",
"arrowFunction.useParentheses": "force"
}
}
Expand Down
42 changes: 42 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Setup
description: Perform standard setup and install dependencies.
inputs:
cachixAuthToken:
description: The cachix auth token
required: true

runs:
using: composite
steps:
- name: Install nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
auto-optimise-store = true
keep-outputs = true
keep-derivations = true
- name: Cache nix
uses: cachix/cachix-action@v12
with:
name: effect-ts
authToken: ${{ inputs.cachixAuthToken }}
- name: Setup direnv
uses: HatsuneMiku3939/direnv-action@v1
with:
direnvVersion: 2.32.2
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Cache pnpm
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install --ignore-scripts
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
uses: ./.github/actions/setup
with:
cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: pnpm build
- name: Check source state
run: git add src && git diff-index --cached HEAD --exit-code src
- run: pnpm circular
- name: Create Release Pull Request or Publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: changesets/action@v1
with:
publish: pnpm changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check

on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: pnpm check
- run: pnpm lint
56 changes: 0 additions & 56 deletions .github/workflows/main.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/pr.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test

on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/setup
with:
cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: pnpm test
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
coverage/
*.tsbuildinfo
node_modules/
yarn-error.log
.ultra.cache.json
.DS_Store
tmp/
build/
dist/
docs/modules
build/
docs/examples/
.direnv/
8 changes: 0 additions & 8 deletions .gitpod.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .madgerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"detectiveOptions": {
"ts": {
"skipTypeImports": true
}
}
}
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-present The Contributors
Copyright (c) 2023 Effectful Technologies Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 3 additions & 0 deletions docgen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"exclude": ["src/{refactors,utils}/**/*.ts"]
}
4 changes: 0 additions & 4 deletions docs-ts.json

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_config.yml

This file was deleted.

9 changes: 0 additions & 9 deletions docs/index.md

This file was deleted.

Loading

0 comments on commit 554570c

Please sign in to comment.