Skip to content

Commit

Permalink
Initialize repo
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Apr 28, 2022
0 parents commit 4ac6cea
Show file tree
Hide file tree
Showing 59 changed files with 13,301 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .componentsjs-generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"source": "lib",
"ignorePackagePaths": [
"engines/query-sparql-mapping"
],
"ignoreComponents": [
"Headers",
"RDF.Stream"
],
"modulePrefix": {}
}
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
coverage

**/*.js
**/*.d.ts
**/*.js.map
183 changes: 183 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname, // this is the reason this is a .js file
project: ['./tsconfig.eslint.json'],
},
plugins: [
'eslint-plugin-tsdoc',
'eslint-plugin-import',
'eslint-plugin-jest',
'eslint-plugin-unused-imports'
],
extends: [
'es/node',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript'
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
'typescript': {
'alwaysTryTypes': true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/rdf-js`
},
}
},
globals: {
window: false,
fetch: false,
Headers: false,
Request: false,
XMLHttpRequest: false,
},
rules: {
// Default
'class-methods-use-this': 'off', // Conflicts with functions from interfaces that sometimes don't require `this`
'comma-dangle': ['error', 'always-multiline'],
'dot-location': ['error', 'property'],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'no-underscore-dangle': 'off', // Conflicts with external libraries
'padding-line-between-statements': 'off',
'no-param-reassign': 'off',
'func-style': 'off',
'new-cap': 'off',
'lines-around-comment': ['error', {
beforeBlockComment: false,
afterBlockComment: false,
beforeLineComment: false,
afterLineComment: false,
}],
'no-multi-assign': 'off',
'no-plusplus': 'off',
'guard-for-in': 'off',
'sort-imports': 'off', // Disabled in favor of eslint-plugin-import
'prefer-named-capture-group': 'off',
'max-len': ['error', {
code: 120,
ignoreTemplateLiterals: true,
}],
'unicorn/consistent-function-scoping': 'off',
'no-warning-comments': 'off',
'no-mixed-operators': 'off',
'prefer-destructuring': 'off',
'default-case': 'off', // TSC already takes care of these checks
'no-loop-func': 'off',
'unicorn/no-fn-reference-in-iterator': 'off',
'extended/consistent-err-names': 'off',
'unicorn/prefer-replace-all': 'off',
'unicorn/catch-error-name': ['error', { name: 'error' }],
'unicorn/no-reduce': 'off',
'no-duplicate-imports': 'off', // Incompatible with type imports
'unicorn/consistent-destructuring': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-new-array': 'off',

// TS
'@typescript-eslint/lines-between-class-members': ['error', { exceptAfterSingleLine: true }],
'@typescript-eslint/no-invalid-void-type': 'off', // breaks with default void in Asynchandler 2nd generic
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'@typescript-eslint/generic-type-naming': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off', // Problems with optional parameters
'@typescript-eslint/space-before-function-paren': ['error', 'never'],
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'angle-bracket' }],
'@typescript-eslint/member-naming': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
'selector': 'interface',
'format': ['PascalCase'],
'custom': {
'regex': '^I[A-Z]',
'match': true
}
}
],
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/explicit-function-return-type': ['error', {
allowExpressions: true,
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: true,
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
}],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],

// Import
'import/order': ['error', {
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}],
'import/no-unused-modules': 'off',
'unused-imports/no-unused-imports-ts': 'error',
'import/no-extraneous-dependencies': 'error',

// TODO: Try to re-enable the following rules in the future
'global-require': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'tsdoc/syntax': 'off',
'unicorn/expiring-todo-comments': 'off',
'unicorn/import-style': 'off',
'unicorn/prefer-array-flat': 'off',
'unicorn/prefer-spread': 'off',
},
overrides: [
{
// Specific rules for bin files
files: ['**/bin/*.ts'],
rules: {
'unicorn/filename-case': ['error', {
'case': 'kebabCase'
}],
'no-process-env': 'off',
}
},
{
// Specific rules for test files
files: ['**/test/**/*.ts'],
env: {
'jest/globals': true,
},
globals: {
'spyOn': false,
'fail': false,
},
rules: {
'mocha/no-synchronous-tests': 'off',
'mocha/valid-test-description': 'off',
'mocha/no-sibling-hooks': 'off',

'max-statements-per-line': 'off',
'id-length': 'off',
'arrow-body-style': 'off',
'line-comment-position': 'off',
'no-inline-comments': 'off',
'unicorn/filename-case': 'off',
'no-new': 'off',
'unicorn/no-nested-ternary': 'off',
'no-return-assign': 'off',
'no-useless-call': 'off',
'no-sync': 'off',

'@typescript-eslint/brace-style': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'import/no-extraneous-dependencies': 'off',
}
}
],
};
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#### Issue type:

_Only keep the issue types that are applicable._

- :bug: Bug
- :heavy_plus_sign: Feature request
- :snail: Performance issue
- :question: Question

#### Description:

____
#### Environment:

_Exact versions of the software in your environment, not just *latest*. Only needed for :bug: and :snail:._

| software | version(s)
| ------------------- | -------
| Comunica Init Actor | <!-- In most cases, this will be the version of `@comunica/actor-init-sparql` -->
| Comunica | <!-- Only needed if you installed Comunica by cloning this repo -->
| node |
| npm | <!-- Only if installed using npm -->
| yarn | <!-- Only if installed using yarn -->
| Operating System |
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: "🐛 Bug report"
about: If something is not working as expected or crashes

---

#### Issue type:

- :bug: Bug <!--Don't change this issue type!-->

____
#### Description:

<!--A clear and concise description of what the bug is.-->

____
#### Environment:

<!--Output of the `comunica-sparql -v` command.-->
<!--If running in a development environment, this must be the output of `node ./packages/actor-init-sparql/bin/query.js -v`-->

#### Crash log:

<!--Only required for crashes.-->
<!--Don't paste contents here directly, but use something like http://pastebin.com/-->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "➕ Feature request"
about: Suggest an idea for this project

---

#### Issue type:

- :heavy_plus_sign: Feature request <!--Don't change this issue type!-->

____
#### Description:

<!--A clear and concise description of what you want to happen.-->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/Performance_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "🐌 Performance issue"
about: An issue with the performance, such as abnormally slow queries.

---

#### Issue type:

- :snail: Performance issue <!--Don't change this issue type!-->

____
#### Description:

<!--A clear and concise description of what the issue is.-->

____
#### Environment:

<!--Output of the `comunica-sparql -v` command.-->
<!--If running in a development environment, this must be the output of `node ./packages/actor-init-sparql/bin/query.js -v`-->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/Question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "❓ Question"
about: A general question

---

#### Issue type:

- :question: Question <!--Don't change this issue type!-->

____
#### Question:

<!--A clear and concisely formulated question.-->
6 changes: 6 additions & 0 deletions .github/get-next-alpha-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Obtain the next alpha version id of Comunica
latest=$(yarn tag list @comunica/query-sparql-mapping | grep "next:" | sed "s/^.*next: \(.*\)$/\1/")
latest_id=$(echo $latest | sed "s/^.*-alpha\.\(.*\)\.0$/\1/")
next_id=$(($latest_id+1))
echo $next_id
21 changes: 21 additions & 0 deletions .github/issue-commenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
labels:
- name: "bug 🐛"
labeled:
issue:
body: Thanks for reporting!
- name: "feature ➕"
labeled:
issue:
body: Thanks for the suggestion!
- name: "performance 🐌"
labeled:
issue:
body: Thanks for reporting!
- name: "question ❓"
labeled:
issue:
body: Someone will answer your question soon. In the meantime, you might be able to get help more quickly on our [Gitter channel](https://gitter.im/comunica/Lobby).
- name: invalid-template
labeled:
issue:
body: '@{{ issue.user.login }} Your issue appears to be not following one of the allowed issue templates, which breaks our automation tools. Please update your issue to the proper template.'
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bug 🐛:
- '- :bug: Bug'
feature ➕:
- '- :heavy_plus_sign: Feature request'
performance 🐌:
- '- :snail: Performance issue'
question ❓:
- '- :question: Question'
Loading

0 comments on commit 4ac6cea

Please sign in to comment.