-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#9): Module error when using Javascript
- Loading branch information
Showing
16 changed files
with
3,803 additions
and
2,504 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 |
---|---|---|
|
@@ -21,3 +21,4 @@ python/venv | |
### Javascript | ||
javascript/gradle.properties | ||
javascript/node_modules/* | ||
dist/ |
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 @@ | ||
lts/jod |
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,9 @@ | ||
{ | ||
"bracketSameLine": false, | ||
"bracketSpacing": true, | ||
"printWidth": 120, | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "es5" | ||
} |
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,50 @@ | ||
# Kestra JavaScript Libs | ||
|
||
This project includes the following tools: | ||
|
||
- [Prettier](https://prettier.io/): Formatting | ||
- [Eslint](https://eslint.org/): Linting | ||
- [Vitest](https://vitest.dev/): Testing | ||
- [Rollup](https://rollupjs.org/): Bundling | ||
|
||
--- | ||
|
||
### Development | ||
|
||
```bash | ||
# Install dependencies | ||
$ npm i | ||
``` | ||
|
||
--- | ||
|
||
### Testing | ||
|
||
```bash | ||
# Runs vitest | ||
$ npm run test | ||
|
||
# Runs vitest with GUI | ||
$ npm run test:ui | ||
``` | ||
|
||
You can test this library using npm symlinks before publishing to npm. | ||
|
||
This can be done using the following steps: | ||
|
||
```bash | ||
# Create a symlink for this project to global node_modules | ||
$ npm link | ||
|
||
# Lists all global symlinks. You can also use this command to check if your symlink worked. | ||
$ npm ls -g --depth=0 --link=true | ||
|
||
# Navigate to a different project and symlink this project. NOTE: that project must also be using npm as a package manager. | ||
$ npm link @kestra-io/libs | ||
|
||
# Once you are done with testing, you can remove the symlink. NOTE: this will also remove the dependency in package.json so you will need to reinstall the package again. | ||
$ npm unlink @kestra-io/libs | ||
|
||
# Unlink the package globally to remove the symlink | ||
$ npm unlink --global @kestra-io/libs | ||
``` |
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,69 @@ | ||
import prettier from 'eslint-plugin-prettier/recommended'; | ||
import globals from 'globals'; | ||
import tseslint from 'typescript-eslint'; | ||
import pluginJs from '@eslint/js'; | ||
|
||
export default [ | ||
{ | ||
ignores: ['.pnpm-store/**', 'coverage/**', '**/dist/**', '**/*.d.ts', 'node_modules/**'], | ||
}, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...globals.browser, | ||
...globals.jest, | ||
...globals.es2015, | ||
}, | ||
parserOptions: { | ||
parser: tseslint.parser, | ||
}, | ||
}, | ||
}, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
prettier, | ||
{ | ||
files: ['src/**/*.ts'], | ||
ignores: ['**/*.spec.ts'], | ||
languageOptions: { | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
'no-implicit-coercion': 'error', | ||
'no-warning-comments': [ | ||
'warn', | ||
{ | ||
terms: ['TODO', 'FIXME', 'XXX', 'BUG'], | ||
location: 'anywhere', | ||
}, | ||
], | ||
curly: ['error', 'all'], | ||
eqeqeq: ['error', 'always', { null: 'ignore' }], | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-parameter-properties': 'off', | ||
'@typescript-eslint/no-require-imports': 'warn', | ||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn', | ||
'@typescript-eslint/no-inferrable-types': 'warn', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'], leadingUnderscore: 'allow' }, | ||
{ selector: 'function', format: ['camelCase', 'PascalCase'] }, | ||
{ selector: 'interface', format: ['PascalCase'] }, | ||
{ selector: 'typeAlias', format: ['PascalCase'] }, | ||
], | ||
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }], | ||
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, caughtErrors: 'none' }], | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.