Skip to content

Commit

Permalink
Merge pull request #8 from matheuslenke/develop
Browse files Browse the repository at this point in the history
Changing Tonto to modularized projects
  • Loading branch information
matheuslenke authored Dec 27, 2023
2 parents 18c6cde + 8ebc5e5 commit 7e00ef3
Show file tree
Hide file tree
Showing 294 changed files with 27,222 additions and 14,692 deletions.
110 changes: 53 additions & 57 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,58 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
"env": {
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"ignorePatterns": ["**/{node_modules,lib,bin}"],
"rules": {
"max-len": [
"error",
{
"ignoreStrings": true,
"code": 120,
"tabWidth": 2
}
],
"overrides": [
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"no-global-assign": "off",
// List of [@typescript-eslint rules](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules)
"@typescript-eslint/adjacent-overload-signatures": "error", // grouping same method names
"@typescript-eslint/array-type": [
"error",
{
// string[] instead of Array<string>
"default": "array-simple"
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
"@typescript-eslint/ban-types": "error", // bans types like String in favor of string
"@typescript-eslint/no-inferrable-types": "off", // don't blame decls like "index: number = 0", esp. in api signatures!
"@typescript-eslint/indent": "off", // consistent indentation
"@typescript-eslint/no-explicit-any": "off", // don't use :any type
"@typescript-eslint/no-misused-new": "error", // no constructors for interfaces or new for classes
"@typescript-eslint/no-namespace": "off", // disallow the use of custom TypeScript modules and namespaces
"@typescript-eslint/no-non-null-assertion": "off", // allow ! operator
"@typescript-eslint/no-parameter-properties": "error", // no property definitions in class constructors
"@typescript-eslint/no-unused-vars": [
"warn",
{
// disallow Unused Variables
"argsIgnorePattern": "^_"
}
],
"ignorePatterns": [
"**/{node_modules,lib,bin}"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
// List of [@typescript-eslint rules](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules)
"@typescript-eslint/adjacent-overload-signatures": "error", // grouping same method names
"@typescript-eslint/array-type": ["error", { // string[] instead of Array<string>
"default": "array-simple"
}],
"@typescript-eslint/ban-types": "error", // bans types like String in favor of string
"@typescript-eslint/no-inferrable-types": "off", // don't blame decls like "index: number = 0", esp. in api signatures!
"@typescript-eslint/indent": "off", // consistent indentation
"@typescript-eslint/no-explicit-any": "off", // don't use :any type
"@typescript-eslint/no-misused-new": "error", // no constructors for interfaces or new for classes
"@typescript-eslint/no-namespace": "off", // disallow the use of custom TypeScript modules and namespaces
"@typescript-eslint/no-non-null-assertion": "off", // allow ! operator
"@typescript-eslint/no-parameter-properties": "error", // no property definitions in class constructors
"@typescript-eslint/no-unused-vars": ["warn", { // disallow Unused Variables
"argsIgnorePattern": "^_"
}],
"@typescript-eslint/no-var-requires": "error", // use import instead of require
"@typescript-eslint/prefer-for-of": "error", // prefer for-of loop over arrays
"@typescript-eslint/prefer-namespace-keyword": "error", // prefer namespace over module in TypeScript
"@typescript-eslint/triple-slash-reference": "error", // ban /// <reference />, prefer imports
"@typescript-eslint/type-annotation-spacing": "error" // consistent space around colon ':'
}
"@typescript-eslint/no-var-requires": 0, // use import instead of require
"@typescript-eslint/prefer-for-of": "error", // prefer for-of loop over arrays
"@typescript-eslint/prefer-namespace-keyword": "error", // prefer namespace over module in TypeScript
"@typescript-eslint/triple-slash-reference": "error", // ban /// <reference />, prefer imports
"@typescript-eslint/type-annotation-spacing": "error" // consistent space around colon ':'
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ coverage
**/generated/*.json

.yarn

packages/tonto-vscode/data/tonto-tmLanguage.json

**/tonto_dependencies
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*/**/out
*/**/lib
node_modules
*/**/node_modules
docs
examples
.vscode
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"plugins": ["prettier-plugin-eslint"],
"printWidth": 120
}
14 changes: 14 additions & 0 deletions .vscode/Tonto.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"folders": [
{
"path": "../packages/tonto"
},
{
"path": "../packages/tonto-vscode"
},
{
"path": "../packages/tonto-package-manager"
}
],
"settings": {}
}
128 changes: 120 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,101 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "CLI: GenerateModular",
"program": "${workspaceFolder}/packages/tonto/bin/cli.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"args": [
"generate",
"${workspaceFolder}/examples/fixingErrors"
]
},
{
"name": "CLI: Import Modular",
"program": "${workspaceFolder}/packages/tonto/bin/cli",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"args": [
"import",
"${workspaceFolder}/examples/library/ontology.json"
]
},
{
"name": "CLI: Validate Model",
"program": "${workspaceFolder}/packages/tonto/bin/cli",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"args": [
"validate",
"${workspaceFolder}/examples/fixingErrors"
]
},
{
"name": "CLI: Transform to GUFO",
"program": "${workspaceFolder}/packages/tonto/bin/cli",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"args": [
"transform",
"${workspaceFolder}/examples/fixingErrors"
]
},
{
"name": "TPM: Install",
"program": "${workspaceFolder}/packages/tonto-package-manager/bin/cli",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"args": [
"install"
],
"cwd": "${workspaceFolder}/examples/ontouml-models/Aguiar2019ooco"
},
{
"name": "TPM: Add dependency",
"program": "${workspaceFolder}/packages/tonto-package-manager/bin/cli",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"args": [
"add",
"-n Test",
"-u https://github.com/matheuslenke/tonto-example-models.git",
"-v 1.0.0",
"-d SWO"
],
"cwd": "${workspaceFolder}/examples/ontouml-models/Aguiar2019ooco"
},
{
"name": "Run Extension",
"type": "extensionHost",
"sourceMaps": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
// "${workspaceFolder}/../tonto-example-models/Library",
"${workspaceFolder}/examples/",
"--extensionDevelopmentPath=${workspaceFolder}/packages/tonto-vscode"
],
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
]
// "env": {
// "DEBUG_BREAK": "true"
// }
},
{
"name": "Attach to Language Server",
Expand All @@ -27,9 +111,37 @@
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/node_modules/langium"
"${workspaceFolder}/packages/tonto/lib/**/*.js",
"${workspaceFolder}/packages/tonto/lib/cli/**/*.js",
"${workspaceFolder}/packages/tonto-vscode/out/**/*.js"
]
},
{
"name": "Attach to CLI",
"type": "node",
"port": 6009,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"sourceMaps": true,
}
],
"compounds": [
{
"name": "Run extension and Debug",
"configurations": [
"Run Extension",
"Attach to Language Server"
],
"stopAll": true
},
{
"name": "Run CLI and Debug",
"configurations": [
"CLI: GenerateModular",
"Attach to Language Server"
],
}
]
}
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier.prettierPath": "./node_modules/prettier"
}
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<h1><summary>Table of Contents</summary></h1>
<ol>
<li><a href="#about-the-project">About The Project</a></li>
<li><a href="#packages">Packages separation</a></li>
<li><a href="#built-with">Built With</a></li>
<li><a href="#getting-started">Getting Started</a></li>
<li><a href="#prerequisites">Prerequisites</a></li>
Expand All @@ -47,19 +48,10 @@ Tonto is an acronym with the words Textual and Ontology, because it is a written
Tonto was designed as a friendly textual syntax for ontologies. It offers specialized support for constructs reflecting the UFO foundational ontology, which makes it possible to identify errors in the ontology that would otherwise pass unnoticed. The language was designed to allow transformation to a number of languages including UML (more specifically OntoUML), OWL (for gUFO-based ontologies), Alloy, Common Logic, and the TPTP syntax.

### The language supports:

- UFO-based annotations to facilitate error checking and meaning negotiation

- Declaration of OntoUML constructs in a easy-to-read syntax
- Enumerations and custom datatypes
- High-order types for multi-level taxomies

- Structured comments for documentation generation

- Constraints specification when extra precision is required

- Ontology testing/verification directives



As a textual syntax, the language can benefit from source control tools such as git, and ontologies can be viewed and edited without special tools. This VS Code extension is provided with support for syntax verification, syntax highlight, content assist and ontology visualization preview. The extension is integrated with the [OntoUML](https://github.com/OntoUML/OntoUML) server, to benefit from services designed for the language, such as transformation to OWL and generation of database schemas.

<p align="right">(<a href="#top">back to top</a>)</p>
Expand All @@ -79,6 +71,23 @@ Here are some of the languages, frameworks, tools and libraries used in developm

<div id="getting-started"> </div>

<!-- PACKAGES -->
## Packages

This project is divided in 3 packages, each of them responsible for a different part of Tonto.

### [Tonto Grammar and CLI](packages/tonto/)
- This package is where Tonto Grammar, the Language Server Protocol and the CLI is defined. All elements and commands are available in this package, and you can read more about it here:

### [Tonto Extension](packages/tonto-vscode/)
- This package is responsible for the [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=Lenke.tonto)

### [Tonto Package Manager](packages/tonto-package-manager/)
- This package is responsible for the TPM responsible for managing

<p align="right">(<a href="#top">back to top</a>)</p>


<!-- GETTING STARTED -->
## ⌨️ Getting Started

Expand Down
3 changes: 0 additions & 3 deletions bin/cli

This file was deleted.

Loading

0 comments on commit 7e00ef3

Please sign in to comment.