Skip to content

Commit

Permalink
Merge pull request #101 from frouriojs/develop
Browse files Browse the repository at this point in the history
Support ESM
  • Loading branch information
solufa authored Jul 11, 2024
2 parents 6e4a78e + d5c5700 commit 9f48fc9
Show file tree
Hide file tree
Showing 33 changed files with 4,805 additions and 2,789 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

57 changes: 0 additions & 57 deletions .eslintrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions .github/CODEOWNERS

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
${{ runner.os }}-
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
run_install: |
- recursive: true
args: [--frozen-lockfile, --prefer-offline]
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 20
- name: Cache pnpm modules
uses: actions/cache@v2
with:
Expand All @@ -44,7 +44,7 @@ jobs:
${{ runner.os }}-
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
run_install: |
- recursive: true
args: [--frozen-lockfile, --prefer-offline]
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.DS_Store
.vscode/
.idea/
node_modules/
*.local
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules/
*.local
build/
.pnpm-debug.log*
coverage/
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"yoavbls.pretty-ts-errors"
]
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"eslint.run": "onSave",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.referencesCodeLens.enabled": true,
"files.eol": "\n",
"editor.tabSize": 2,
"stylelint.validate": ["css"],
"explorer.fileNesting.enabled": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
}
2 changes: 1 addition & 1 deletion bin/notios
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../build/main.js')
import('../build/main.mjs');
2 changes: 1 addition & 1 deletion bin/npm-run-all
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../build/npm-run-all.js');
import('../build/npm-run-all.mjs');
2 changes: 1 addition & 1 deletion bin/run-p
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../build/run-p.js');
import('../build/run-p.mjs');
2 changes: 1 addition & 1 deletion bin/run-s
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('../build/run-s.js');
import('../build/run-s.mjs');
71 changes: 71 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import js from '@eslint/js';
import reactPlugin from 'eslint-plugin-react';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import tseslint from 'typescript-eslint';
import globals from 'globals';

export default tseslint.config(
{ files: ['**/*.(ts,js,tsx)'] },
{
ignores: [
'.DS_Store',
'.vscode',
'.idea',
'node_modules',
'*.local',
'**/build/**',
'**/coverage/**',
'.pnpm-debug.log*',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2020,
},
},
plugins: {
react: reactPlugin,
import: importPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/no-anonymous-default-export': 'error',
'import/no-dynamic-require': 'off',
'no-empty-pattern': 'off',
'no-empty': 'off',
'no-constant-condition': 'off',
},
},
{
files: ['*.tsx'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
'react/prop-types': ['off', {}],
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
},
},
prettierConfig,
);
2 changes: 1 addition & 1 deletion examples/foo/colorful.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const delay = (ms) => new Promise((r) => setTimeout(r, ms));
// const delay = (ms) => new Promise((r) => setTimeout(r, ms));
const main = async () => {
console.log('starting colorful1!');
console.log('starting colorful2!');
Expand Down
2 changes: 1 addition & 1 deletion libs/ansi-parser/interfaces/ansi-action.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnsiActionControll } from './ansi-controll-action';
import { AnsiActionControll } from './ansi-controll-action.d.ts';

export type AnsiAction =
| AnsiActionNoop
Expand Down
3 changes: 2 additions & 1 deletion libs/ansi-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "ansi-parser",
"version": "0.0.0",
"type": "module",
"description": "",
"private": true,
"keywords": [
Expand Down Expand Up @@ -47,7 +48,7 @@
"prettier": "^2.5.1",
"prettier-plugin-organize-imports": "^2.3.4",
"ts-node": "^10.7.0",
"typescript": "~4.6",
"typescript": "^5.5.3",
"vitest": "^0.6.0"
}
}
13 changes: 0 additions & 13 deletions libs/ansi-parser/test/tsconfig.json

This file was deleted.

9 changes: 2 additions & 7 deletions libs/ansi-parser/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
"outDir": "build",
"declaration": true
},
"exclude": [
"node_modules"
],
"include": [
"src/**/*.ts",
"src/**/*.tsx"
]
"exclude": ["node_modules"],
"include": ["src/**/*.mts", "src/**/*.ts"]
}
15 changes: 4 additions & 11 deletions libs/ansi-parser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"compilerOptions": {
"esModuleInterop": true,
"module": "CommonJS",
"moduleResolution": "Node",
"module": "ES2020",
"moduleResolution": "Bundler",
"skipLibCheck": true,
"strict": true,
"target": "ES2015",
"target": "ES2020",
"incremental": true
},
"exclude": [
"node_modules",
"test"
],
"include": [
"**/*.ts",
"**/*.tsx"
]
"exclude": ["node_modules", "test"]
}
3 changes: 2 additions & 1 deletion libs/notios-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@notios/config",
"version": "0.2.0",
"type": "module",
"description": "Notios configuration tools",
"keywords": [
"notios",
Expand Down Expand Up @@ -44,7 +45,7 @@
"prettier": "^2.5.1",
"prettier-plugin-organize-imports": "^2.3.4",
"ts-node": "^10.7.0",
"typescript": "~4.6",
"typescript": "^5.5.3",
"vitest": "^0.6.0"
}
}
16 changes: 4 additions & 12 deletions libs/notios-config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{
"compilerOptions": {
"esModuleInterop": true,
"module": "CommonJS",
"moduleResolution": "Node",
"module": "ES2020",
"moduleResolution": "Bundler",
"skipLibCheck": true,
"strict": true,
"target": "ES2015",
"target": "ES2020",
"incremental": true
},
"exclude": [
"node_modules",
"test"
],
"include": [
"**/*.ts",
"**/*.tsx"
]
}
}
Loading

0 comments on commit 9f48fc9

Please sign in to comment.