-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
387 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
build/ | ||
dist/ | ||
node_modules/ | ||
*.tsbuildinfo | ||
scratchpad/* | ||
!scratchpad/tsconfig.json | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
coverage/ | ||
*.tsbuildinfo | ||
node_modules/ | ||
.DS_Store | ||
tmp/ | ||
dist/ | ||
build/ | ||
docs/ | ||
scratchpad/* | ||
!scratchpad/tsconfig.json | ||
.direnv/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"detectiveOptions": { | ||
"ts": { | ||
"skipTypeImports": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.js | ||
*.ts | ||
*.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Effect Basic Package Template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"unstable": ["byonm"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import { fixupPluginRules } from "@eslint/compat" | ||
import { FlatCompat } from "@eslint/eslintrc" | ||
import js from "@eslint/js" | ||
import tsParser from "@typescript-eslint/parser" | ||
import codegen from "eslint-plugin-codegen" | ||
import deprecation from "eslint-plugin-deprecation" | ||
import _import from "eslint-plugin-import" | ||
import simpleImportSort from "eslint-plugin-simple-import-sort" | ||
import sortDestructureKeys from "eslint-plugin-sort-destructure-keys" | ||
import path from "node:path" | ||
import { fileURLToPath } from "node:url" | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}) | ||
|
||
export default [ | ||
{ | ||
ignores: ["**/dist", "**/build", "**/docs", "**/*.md"] | ||
}, | ||
...compat.extends( | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@effect/recommended" | ||
), | ||
{ | ||
plugins: { | ||
deprecation, | ||
import: fixupPluginRules(_import), | ||
"sort-destructure-keys": sortDestructureKeys, | ||
"simple-import-sort": simpleImportSort, | ||
codegen | ||
}, | ||
|
||
languageOptions: { | ||
parser: tsParser, | ||
ecmaVersion: 2018, | ||
sourceType: "module" | ||
}, | ||
|
||
settings: { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".tsx"] | ||
}, | ||
|
||
"import/resolver": { | ||
typescript: { | ||
alwaysTryTypes: true | ||
} | ||
} | ||
}, | ||
|
||
rules: { | ||
"codegen/codegen": "error", | ||
"no-fallthrough": "off", | ||
"no-irregular-whitespace": "off", | ||
"object-shorthand": "error", | ||
"prefer-destructuring": "off", | ||
"sort-imports": "off", | ||
|
||
"no-restricted-syntax": ["error", { | ||
selector: "CallExpression[callee.property.name='push'] > SpreadElement.arguments", | ||
message: "Do not use spread arguments in Array.push" | ||
}], | ||
|
||
"no-unused-vars": "off", | ||
"prefer-rest-params": "off", | ||
"prefer-spread": "off", | ||
"import/first": "error", | ||
"import/newline-after-import": "error", | ||
"import/no-duplicates": "error", | ||
"import/no-unresolved": "off", | ||
"import/order": "off", | ||
"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/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/ban-ts-comment": "off", | ||
"@typescript-eslint/camelcase": "off", | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/interface-name-prefix": "off", | ||
"@typescript-eslint/no-array-constructor": "off", | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-namespace": "off", | ||
|
||
"@effect/dprint": ["error", { | ||
config: { | ||
indentWidth: 2, | ||
lineWidth: 120, | ||
semiColons: "asi", | ||
quoteStyle: "alwaysDouble", | ||
trailingCommas: "never", | ||
operatorPosition: "maintain", | ||
"arrowFunction.useParentheses": "force" | ||
} | ||
}] | ||
} | ||
} | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
}; | ||
outputs = {nixpkgs, ...}: let | ||
forAllSystems = function: | ||
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed | ||
(system: function nixpkgs.legacyPackages.${system}); | ||
in { | ||
formatter = forAllSystems (pkgs: pkgs.alejandra); | ||
devShells = forAllSystems (pkgs: { | ||
default = pkgs.mkShell { | ||
packages = with pkgs; [ | ||
bun | ||
corepack | ||
deno | ||
nodejs | ||
python3 | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@template/basic", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"codegen": "build-utils prepare-v2", | ||
"build": "pnpm build-esm && pnpm build-annotate && pnpm build-cjs && build-utils pack-v2", | ||
"build-esm": "tsc -b tsconfig.build.json", | ||
"build-cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps", | ||
"build-annotate": "babel build/esm --plugins annotate-pure-calls --out-dir build/esm --source-maps", | ||
"check": "tsc -b tsconfig.json", | ||
"test": "vitest", | ||
"coverage": "vitest --coverage" | ||
}, | ||
"devDependencies": {}, | ||
"effect": { | ||
"generateExports": { | ||
"include": [ | ||
"**/*.ts" | ||
] | ||
}, | ||
"generateIndex": { | ||
"include": [ | ||
"**/*.ts" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/lib/index.js b/lib/index.js | ||
index 2182884e21874ebb37261e2375eec08ad956fc9a..ef5630199121c2830756e00c7cc48cf1078c8207 100644 | ||
--- a/lib/index.js | ||
+++ b/lib/index.js | ||
@@ -78,7 +78,7 @@ const isInAssignmentContext = path => { | ||
|
||
parentPath = _ref.parentPath; | ||
|
||
- if (parentPath.isVariableDeclaration() || parentPath.isAssignmentExpression()) { | ||
+ if (parentPath.isVariableDeclaration() || parentPath.isAssignmentExpression() || parentPath.isClassDeclaration()) { | ||
return true; | ||
} | ||
} while (parentPath !== statement); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"declaration": false, | ||
"declarationMap": false, | ||
"composite": false, | ||
"incremental": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as it from "@effect/vitest" | ||
|
||
it.addEqualityTesters() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as Effect from "effect/Effect" | ||
|
||
Effect.runPromise(Effect.log("Hello, World!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { describe, expect, it } from "@effect/vitest" | ||
|
||
describe("Dummy", () => { | ||
it("should pass", () => { | ||
expect(true).toBe(true) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"exactOptionalPropertyTypes": true, | ||
"moduleDetection": "force", | ||
"composite": true, | ||
"downlevelIteration": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": false, | ||
"declaration": true, | ||
"skipLibCheck": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"moduleResolution": "NodeNext", | ||
"lib": ["ES2022", "DOM", "DOM.Iterable"], | ||
"types": [], | ||
"isolatedModules": true, | ||
"sourceMap": true, | ||
"declarationMap": true, | ||
"noImplicitReturns": false, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": false, | ||
"noFallthroughCasesInSwitch": true, | ||
"noEmitOnError": false, | ||
"noErrorTruncation": false, | ||
"allowJs": false, | ||
"checkJs": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"noUncheckedIndexedAccess": false, | ||
"strictNullChecks": true, | ||
"baseUrl": ".", | ||
"target": "ES2022", | ||
"module": "NodeNext", | ||
"incremental": true, | ||
"removeComments": false, | ||
"plugins": [{ "name": "@effect/language-service" }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.src.json", | ||
"compilerOptions": { | ||
"types": ["node"], | ||
"tsBuildInfoFile": ".tsbuildinfo/build.tsbuildinfo", | ||
"outDir": "build/esm", | ||
"declarationDir": "build/dts", | ||
"stripInternal": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": [], | ||
"references": [ | ||
{ "path": "tsconfig.src.json" }, | ||
{ "path": "tsconfig.test.json" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": ["src"], | ||
"compilerOptions": { | ||
"types": ["node"], | ||
"outDir": "build/src", | ||
"tsBuildInfoFile": ".tsbuildinfo/src.tsbuildinfo", | ||
"rootDir": "src" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": ["test"], | ||
"references": [ | ||
{ "path": "tsconfig.src.json" } | ||
], | ||
"compilerOptions": { | ||
"types": ["node"], | ||
"tsBuildInfoFile": ".tsbuildinfo/test.tsbuildinfo", | ||
"rootDir": "test", | ||
"noEmit": true | ||
} | ||
} |
Oops, something went wrong.