Skip to content

Commit

Permalink
Improve Effect imports (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxwell Brown <[email protected]>
Co-authored-by: Sebastian Lorenz <[email protected]>
  • Loading branch information
3 people authored Dec 8, 2023
1 parent 9cd2129 commit 9bb0011
Show file tree
Hide file tree
Showing 78 changed files with 4,589 additions and 5,247 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.

5 changes: 5 additions & 0 deletions .changeset/lucky-bags-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/language-service": minor
---

Improve Effect imports to work with current effect npm package
8 changes: 8 additions & 0 deletions .changeset/violet-donkeys-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@effect/language-service": minor
---

Modernise build setup.
Fix asyncWaitToGen problem for TS5.
Refactor asyncWaitToGen to work with current Effect API.
Add config option `preferredEffectGenAdapterName`.
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", "examples", "*.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
}
}
}
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,5 @@
"editor.suggestSelection": "recentlyUsed",
"editor.wordBasedSuggestions": true,
"editor.parameterHints.enabled": true,
"files.watcherExclude": {
"**/target": true
},
"files.insertFinalNewline": true
}
Loading

0 comments on commit 9bb0011

Please sign in to comment.