diff --git a/.eslintrc.cjs b/.eslintrc.cjs index da434649d..9df1667a5 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -9,6 +9,7 @@ const path = require('node:path'); // Allow the Codium ESLint plugin to find `tsconfig.json` from the repository root. const project = [ path.join(__dirname, 'tsconfig.json'), + path.join(__dirname, 'subprojects/docs/tsconfig.json'), path.join(__dirname, 'subprojects/frontend/tsconfig.json'), path.join(__dirname, 'subprojects/frontend/tsconfig.node.json'), path.join(__dirname, 'subprojects/frontend/tsconfig.shared.json'), @@ -48,8 +49,10 @@ module.exports = { ignorePatterns: [ 'build/**/*', 'subprojects/*/build/**/*', - 'subprojects/*/dev-dist/**/*', - 'subprojects/*/src/**/*.typegen.ts', + 'subprojects/docs/.docusaurus/**/*', + 'subprojects/docs/.yarn/**/*', + 'subprojects/frontend/dev-dist/**/*', + 'subprojects/frontend/src/**/*.typegen.ts', ], rules: { // In typescript, some class methods implementing an inderface do not use `this`: @@ -107,6 +110,13 @@ module.exports = { '@typescript-eslint/no-var-requires': 'off', }, }, + { + files: ['*.cts'], + rules: { + // Allow `import type` in CommonJS TypeScript modules. + 'import/no-import-module-exports': 'off', + }, + }, { files: [ '.eslintrc.cjs', @@ -132,5 +142,21 @@ module.exports = { 'no-process-env': 'off', }, }, + { + files: ['subprojects/docs/src/**/*'], + rules: { + 'import/no-unresolved': [ + 'error', + { + ignore: [ + // These imports are resolved by Docusaurus, not TypeScript. + '^@docusaurus/', + '^@theme/', + '^@theme-original/', + ], + }, + ], + }, + }, ], }; diff --git a/.gitattributes b/.gitattributes index 847ceced4..285a18353 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,11 @@ -# SPDX-FileCopyrightText: 2021-2023 The Refinery Authors +# SPDX-FileCopyrightText: 2021-2024 The Refinery Authors # # SPDX-License-Identifier: CC0-1.0 .yarn/releases/** binary .yarn/plugins/** binary *.cjs eol=lf +*.cts eol=lf *.css eol=lf *.js eol=lf *.json eol=lf diff --git a/.gitignore b/.gitignore index fcb4a271f..69876ddd8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,8 @@ !.yarn/versions bin/ build/ -dev-dist/ emf-gen/ node_modules/ -*.typegen.ts xtend-gen/ *.xtendbin xtext-gen/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index a5f1594a6..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,51 +0,0 @@ - - -# Contributing to Refinery - -## Setting up the development environment - -### With IntelliJ IDEA - -We prefer IntelliJ IDEA as a development environment. -No special preparations should be necessary for importing the project as a Gradle project into IDEA. - -However, you will need Eclipse to edit Xtext (`*.xtext`) and MWE2 (`*.mwe2`) files and Ecore class diagrams (`*.aird`, `*.ecore`, `*.genmodel`). -If you do not plan on making changes to such files, feel free to skip the Eclipse installation steps below. - -### With Eclipse IDE - -1. Download and install a _Java 21_ compatible JDK. For Windows, prefer OpenJDK builds from [Adoptium](https://adoptium.net/). - -2. Download and extract the [Eclipse IDE for Java and DSL Developers 2023-12](https://www.eclipse.org/downloads/packages/release/2023-12/r/eclipse-ide-java-and-dsl-developers) package. - -3. Launch Eclipse and create a new workspace. - -4. Open _Help > Eclipse Marketplace_ and install the following software: - * _EclEmma Java Code Coverage_ - * _EcoreTools : Ecore Diagram Editor_ - * _Sirius_ (ignore the warning during installation about the solution _Sirius_ not being available) - * _SonarLint_ - -5. Open _Window > Preferences_ and set the following preferences: - * _General > Workspace > Text file encoding_ should be _UTF-8_. - * _General > Workspace > New text file line delimiter_ should be _Unix_. - * Add the JDK 21 to _Java > Installed JREs_. - * Make sure JDK 21 is selected for _JavaSE-21_ at _Java > Installed JREs > Execution Environments_. - * Set _Gradle > Java home_ to the `JAVA_HOME` directory (the directory which contains the `bin` directory) of JDK 21. Here, Buildship will show a yellow warning sign, which can be safely ignored. - * Set _Java > Compiler > JDK Compliance > Compiler compliance level_ to _21_. - -6. Clone the project Git repository but do not import it into Eclipse yet. - -7. Open a new terminal an run `./gradlew prepareEclipse` (`.\gradlew prepareEclipse` on Windows) in the cloned repository. - * This should complete without any compilation errors. - * If you get any errors about the JVM version, check whether the `JAVA_HOME` environment variable is set to the location of JDK. You can query the variable with `echo $JAVA_HOME` on Linux and `echo $Env:JAVA_HOME` in PowerShell on Windows. To set it, use `export JAVA_HOME=/java/path/here` or `$Env:JAVA_HOME="C:\java\path\here"`, respectively. - * If the build fails with a `Host name must not be empty` error, you [might need to remove the empty proxy configuration from your global `gradle.properties` file](https://stackoverflow.com/a/62128323). - -8. Select _File > Import... > Gradle > Existing Gradle Project_ and import the cloned repository in Eclipse. - * Make sure to select the root of the repository (containing this file) as the _Project root directory_ and that the _Gradle distribution_ is _Gradle wrapper_. - * If you have previously imported the project into Eclipse, this step will likely fail. In that case, you should remove the projects from Eclipse, run `git clean -fxd` in the repository, and start over from step 8. - diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt new file mode 100644 index 000000000..13ca539f3 --- /dev/null +++ b/LICENSES/CC-BY-4.0.txt @@ -0,0 +1,156 @@ +Creative Commons Attribution 4.0 International + + Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. + +Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. + +Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. + +Section 1 – Definitions. + + a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + + d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. + + g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. + + i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + + 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. + + 5. Downstream recipients. + + A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + + B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. + + 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). + +b. Other rights. + + 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this Public License. + + 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified form), You must: + + A. retain the following if it is supplied by the Licensor with the Licensed Material: + + i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + + v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + + B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and + + C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + + 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; + + b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + + a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. + + b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. + + c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + + a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + + c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. + + d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. + +Section 8 – Interpretation. + + a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. + + c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. + + d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/README.md b/README.md index 1f9ecceeb..235748861 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ J. Object Technol. **19**(3): 3:1-22 (2020) [[doi](https://doi.org/10.5381/jot.2 ### Consitent graph generation techniques * O. Semeráth, A. Nagy, D. Varró: “A graph solver for the automated generation of consistent domain-specific models.” _ICSE 2018:_ 969-980 [[doi](https://doi.org/10.1145/3180155.3180186)] [[pdf](https://dl.acm.org/doi/pdf/10.1145/3180155.3180186)] -* K. Marussy, O. Semeráth, D. Varró: _Automated Generation of Consistent Graph Models With Multiplicity Reasoning._ IEEE Trans. Software Eng. **48**(5): 1610-1629 (2022) [[doi](https://doi.org/10.1109/TSE.2020.3025732)] [[pdf](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9201551)] -* A.. Babikian, O. Semeráth, A. Li, K. Marussy, D. Varró: _Automated generation of consistent models using qualitative abstractions and exploration strategies._ Softw. Syst. Model. **21**(5): 1763-1787 (2022) [[doi](https://doi.org/10.1007/s10270-021-00918-6)] [[pdf](https://link.springer.com/content/pdf/10.1007/s10270-021-00918-6.pdf?pdf=button)] +* K. Marussy, O. Semeráth, D. Varró: _Automated Generation of Consistent Graph Models With Multiplicity Reasoning._ IEEE Trans. Softw. Eng. **48**(5): 1610-1629 (2022) [[doi](https://doi.org/10.1109/TSE.2020.3025732)] [[pdf](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9201551)] +* A. Babikian, O. Semeráth, A. Li, K. Marussy, D. Varró: _Automated generation of consistent models using qualitative abstractions and exploration strategies._ Softw. Syst. Model. **21**(5): 1763-1787 (2022) [[doi](https://doi.org/10.1007/s10270-021-00918-6)] [[pdf](https://link.springer.com/content/pdf/10.1007/s10270-021-00918-6.pdf?pdf=button)] ### Diverse and realistic graph generation diff --git a/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts b/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts index e2bd9aecd..436d575dd 100644 --- a/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts +++ b/buildSrc/src/main/kotlin/tools/refinery/gradle/frontend-workspace.gradle.kts @@ -5,11 +5,17 @@ */ package tools.refinery.gradle +import org.siouan.frontendgradleplugin.domain.ExecutableType + plugins { id("tools.refinery.gradle.eclipse") id("tools.refinery.gradle.internal.frontend-conventions") } +frontend { + nodeDistributionProvided = true +} + tasks { installNode { dependsOn(rootProject.tasks.named("installNode")) @@ -18,6 +24,8 @@ tasks { resolvePackageManager { dependsOn(rootProject.tasks.named("resolvePackageManager")) + // We can't enable this task, because the package manager is declared in the worktree `package.json` instead of + // the `package.json` in this workspace (subproject). enabled = false } @@ -36,4 +44,13 @@ tasks { dependsOn(rootInstallFrontend) enabled = false } + + assembleFrontend { + // Workaround to enable this task even if we have disabled `installPackageManager`. See + // https://github.com/siouan/frontend-gradle-plugin/blob/2add49d3a74c927abc813d98787be116d0074afe/plugin/src/main/java/org/siouan/frontendgradleplugin/FrontendGradlePlugin.java#L514-L516 + setOnlyIf { frontend.assembleScript.isPresent } + // Workaround for disabled `resolvePackageManager`. See + // https://github.com/siouan/frontend-gradle-plugin/blob/2add49d3a74c927abc813d98787be116d0074afe/plugin/src/main/java/org/siouan/frontendgradleplugin/FrontendGradlePlugin.java#L513 + executableType.set(ExecutableType.YARN) + } } diff --git a/gradle.properties b/gradle.properties index 9c20dde8f..1fd811427 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ # SPDX-License-Identifier: EPL-2.0 file.encoding=UTF-8 -frontend.nodeVersion=20.12.1 +frontend.nodeVersion=20.12.2 group=tools.refinery # Set to true once tools.refinery.gradle.frontend-worktree supports the cache. org.gradle.configuration-cache=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9c4d686aa..fe22cc061 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,11 +6,11 @@ eclipseCollections = "12.0.0.M3" jetty = "12.0.8" jmh = "1.37" -junit = "5.10.2" +junit = "5.11.0-M1" mockito = "5.11.0" -mwe2 = "2.18.0.M1" -slf4j = "2.0.12" -xtext = "2.34.0" +mwe2 = "2.18.0.M2" +slf4j = "2.0.13" +xtext = "2.35.0.M0" [libraries] eclipseCollections = { group = "org.eclipse.collections", name = "eclipse-collections", version.ref = "eclipseCollections" } @@ -37,7 +37,7 @@ junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", ver junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" } mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" } mockito-junit = { group = "org.mockito", name = "mockito-junit-jupiter", version.ref = "mockito" } -mwe-utils = { group = "org.eclipse.emf", name = "org.eclipse.emf.mwe.utils", version = "1.12.0.M1" } +mwe-utils = { group = "org.eclipse.emf", name = "org.eclipse.emf.mwe.utils", version = "1.12.0.M2" } mwe2-launch = { group = "org.eclipse.emf", name = "org.eclipse.emf.mwe2.launch", version.ref = "mwe2" } mwe2-lib = { group = "org.eclipse.emf", name = "org.eclipse.emf.mwe2.lib", version.ref = "mwe2" } ortools = { group = "com.google.ortools", name = "ortools-java", version = "9.9.3963" } diff --git a/gradlew.bat b/gradlew.bat index 7101f8e46..6b1b6735b 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,92 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=.setlocal +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/package.json b/package.json index 78d16741c..f16ffe077 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,11 @@ }, "homepage": "https://refinery.tools", "workspaces": [ + "subprojects/docs", "subprojects/frontend" ], "scripts": { + "docs": "yarn workspace @refinery/docs", "frontend": "yarn workspace @refinery/frontend", "typecheck": "yarn run g:tsc -p tsconfig.json", "lint": "yarn run g:lint", @@ -30,15 +32,15 @@ }, "packageManager": "yarn@4.1.1", "dependencies": { - "react": "^18.2.0" + "react": "^18.3.1" }, "devDependencies": { - "@types/eslint": "^8.56.7", - "@types/node": "^20.12.5", - "@types/react": "^18.2.74", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", - "corepack": "^0.26.0", + "@types/eslint": "^8.56.10", + "@types/node": "^20.12.7", + "@types/react": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/parser": "^7.7.1", + "corepack": "^0.28.0", "eslint": "^8.57.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^18.0.0", @@ -49,9 +51,9 @@ "eslint-plugin-mobx": "^0.0.9", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-hooks": "^4.6.2", "prettier": "^3.2.5", - "typescript": "5.4.4" + "typescript": "5.4.5" }, "resolutions": { "d3-zoom@npm:^3.0.0": "patch:d3-zoom@npm%3A3.0.0#~/.yarn/patches/d3-zoom-npm-3.0.0-18f706a421.patch", diff --git a/settings.gradle.kts b/settings.gradle.kts index 50ca1f242..4a7cdfb9d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,6 +7,7 @@ rootProject.name = "refinery" include( + "docs", "frontend", "generator", "generator-cli", diff --git a/subprojects/docs/.gitignore b/subprojects/docs/.gitignore new file mode 100644 index 000000000..2d94aa21e --- /dev/null +++ b/subprojects/docs/.gitignore @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2024 The Refinery Authors +# +# SPDX-License-Identifier: CC0-1.0 + +.docusaurus +.yarn diff --git a/subprojects/docs/babel.config.cts b/subprojects/docs/babel.config.cts new file mode 100644 index 000000000..b1bc12810 --- /dev/null +++ b/subprojects/docs/babel.config.cts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * Copyright (c) 2024 The Refinery Authors + * + * SPDX-License-Identifier: MIT AND EPL-2.0 + */ + +import type { TransformOptions } from '@babel/core'; + +module.exports = { + presets: [require.resolve('@docusaurus/core/lib/babel/preset')], +} satisfies TransformOptions; diff --git a/subprojects/docs/build.gradle.kts b/subprojects/docs/build.gradle.kts new file mode 100644 index 000000000..e559ed3e6 --- /dev/null +++ b/subprojects/docs/build.gradle.kts @@ -0,0 +1,142 @@ +/* + * SPDX-FileCopyrightText: 2024 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import org.siouan.frontendgradleplugin.infrastructure.gradle.RunYarn +import tools.refinery.gradle.utils.SonarPropertiesUtils + +plugins { + id("tools.refinery.gradle.frontend-workspace") + id("tools.refinery.gradle.sonarqube") +} + +frontend { + assembleScript.set("run build") +} + +val javadocs: Configuration by configurations.creating { + isCanBeConsumed = false + isCanBeResolved = true +} + +dependencies { + javadocs(project(":refinery-generator", "javadocElements")) + javadocs(project(":refinery-generator-cli", "javadocElements")) + javadocs(project(":refinery-interpreter", "javadocElements")) + javadocs(project(":refinery-interpreter-localsearch", "javadocElements")) + javadocs(project(":refinery-interpreter-rete", "javadocElements")) + javadocs(project(":refinery-interpreter-rete-recipes", "javadocElements")) + javadocs(project(":refinery-language", "javadocElements")) + javadocs(project(":refinery-language-ide", "javadocElements")) + javadocs(project(":refinery-language-model", "javadocElements")) + javadocs(project(":refinery-language-semantics", "javadocElements")) + javadocs(project(":refinery-language-web", "javadocElements")) + javadocs(project(":refinery-logic", "javadocElements")) + javadocs(project(":refinery-store", "javadocElements")) + javadocs(project(":refinery-store-dse", "javadocElements")) + javadocs(project(":refinery-store-dse-visualization", "javadocElements")) + javadocs(project(":refinery-store-query", "javadocElements")) + javadocs(project(":refinery-store-query-interpreter", "javadocElements")) + javadocs(project(":refinery-store-reasoning", "javadocElements")) + javadocs(project(":refinery-store-reasoning-scope", "javadocElements")) + javadocs(project(":refinery-store-reasoning-smt", "javadocElements")) +} + +val srcDir = "src" + +val docusaurusOutputDir = layout.buildDirectory.dir("docusaurus") + +val javadocsDir = layout.buildDirectory.dir("javadocs") + +val javadocsDocsDir = javadocsDir.map { root -> root.dir("develop/javadoc") } + +val configFiles: FileCollection = files( + rootProject.file("yarn.lock"), + rootProject.file("package.json"), + "package.json", + rootProject.file("tsconfig.base.json"), + "tsconfig.json", + "babel.config.config.ts", + "docusaurus.config.ts", +) + +val lintConfigFiles: FileCollection = configFiles + files( + rootProject.file(".eslintrc.cjs"), + rootProject.file("prettier.config.cjs") +) + +tasks { + val extractJavadocs by registering { + dependsOn(javadocs) + outputs.dir(javadocsDir) + doFirst { + delete(javadocsDir) + } + doLast { + javadocs.resolvedConfiguration.resolvedArtifacts.forEach { artifact -> + copy { + from(zipTree(artifact.file)) + into(javadocsDocsDir.map { root -> root.dir(artifact.moduleVersion.id.name) }) + } + } + } + } + + assembleFrontend { + dependsOn(extractJavadocs) + inputs.dir(srcDir) + inputs.dir("static") + inputs.dir(javadocsDir) + inputs.files(configFiles) + outputs.dir(docusaurusOutputDir) + } + + val typeCheckFrontend by registering(RunYarn::class) { + dependsOn(installFrontend) + inputs.dir(srcDir) + inputs.files(configFiles) + outputs.dir(layout.buildDirectory.dir("typescript")) + script.set("run typecheck") + group = "verification" + description = "Check for TypeScript type errors." + } + + val lintFrontend by registering(RunYarn::class) { + dependsOn(installFrontend) + dependsOn(typeCheckFrontend) + inputs.dir(srcDir) + inputs.files(lintConfigFiles) + outputs.file(layout.buildDirectory.file("eslint.json")) + script.set("run lint") + group = "verification" + description = "Check for TypeScript lint errors and warnings." + } + + register("fixFrontend") { + dependsOn(installFrontend) + dependsOn(typeCheckFrontend) + inputs.dir(srcDir) + inputs.files(lintConfigFiles) + script.set("run lint:fix") + group = "verification" + description = "Check for TypeScript lint errors and warnings." + } + + check { + dependsOn(typeCheckFrontend) + dependsOn(lintFrontend) + } + + clean { + delete(".docusaurus") + delete(".yarn") + } +} + +sonarqube.properties { + SonarPropertiesUtils.addToList(properties, "sonar.sources", srcDir) + property("sonar.nodejs.executable", "${frontend.nodeInstallDirectory.get()}/bin/node") + property("sonar.eslint.reportPaths", "${layout.buildDirectory.get()}/eslint.json") +} diff --git a/subprojects/docs/docusaurus.config.ts b/subprojects/docs/docusaurus.config.ts new file mode 100644 index 000000000..5245e4152 --- /dev/null +++ b/subprojects/docs/docusaurus.config.ts @@ -0,0 +1,297 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * Copyright (c) 2024 The Refinery Authors + * + * SPDX-License-Identifier: MIT AND EPL-2.0 + */ + +import type { MDXOptions } from '@docusaurus/mdx-loader'; +import type { Options as DocsOptions } from '@docusaurus/plugin-content-docs'; +import type { Options as PagesOptions } from '@docusaurus/plugin-content-pages'; +import type { Options as ClassicThemeOptions } from '@docusaurus/theme-classic'; +import type { UserThemeConfig } from '@docusaurus/theme-common'; +import type { UserThemeConfig as AlgoliaConfig } from '@docusaurus/theme-search-algolia'; +import type { Config } from '@docusaurus/types'; +import { Config as SwcConfig } from '@swc/core'; +import { themes } from 'prism-react-renderer'; +import smartypants from 'remark-smartypants'; + +import remarkPosix2Windows from './src/plugins/remarkPosix2Windows'; + +const markdownOptions: Partial = { + remarkPlugins: [[smartypants, { dashes: 'oldschool' }], remarkPosix2Windows], +}; + +const docsOptions = { + ...markdownOptions, + sidebarPath: undefined, + editUrl: + 'https://github.com/graphs4value/refinery/edit/main/subprojects/docs', +} satisfies DocsOptions; + +export default { + title: 'Refinery', + tagline: 'An efficient graph solver for generating well-formed models', + url: 'https://refinery.tools', + baseUrl: '/', + baseUrlIssueBanner: false, + trailingSlash: true, + staticDirectories: ['static', 'build/javadocs'], + plugins: [ + [ + '@docusaurus/plugin-content-docs', + { + id: 'learn', + path: 'src/learn', + routeBasePath: '/learn', + ...docsOptions, + } satisfies DocsOptions, + ], + [ + '@docusaurus/plugin-content-docs', + { + id: 'develop', + path: 'src/develop', + routeBasePath: '/develop', + ...docsOptions, + } satisfies DocsOptions, + ], + [ + '@docusaurus/plugin-content-pages', + markdownOptions satisfies PagesOptions, + ], + '@docusaurus/plugin-sitemap', + './src/plugins/loadersPlugin.ts', + './src/plugins/swcMinifyPlugin.ts', + ], + themes: [ + [ + '@docusaurus/theme-classic', + { + customCss: [require.resolve('./src/css/custom.css')], + } satisfies ClassicThemeOptions, + ], + '@docusaurus/theme-search-algolia', + ], + themeConfig: { + colorMode: { + respectPrefersColorScheme: true, + }, + prism: { + additionalLanguages: ['bash', 'java'], + theme: themes.oneLight, + darkTheme: themes.oneDark, + }, + navbar: { + title: 'Refinery', + logo: { + src: '/logo.svg', + srcDark: '/logo-dark.svg', + }, + hideOnScroll: true, + items: [ + { + label: 'Learn', + to: '/learn', + }, + { + label: 'Develop', + to: '/develop', + }, + { + label: 'GitHub', + position: 'right', + href: 'https://github.com/graphs4value/refinery', + }, + { + label: 'Try now', + position: 'right', + href: 'https://refinery.services/', + className: 'navbar__link--try-now', + }, + ], + }, + footer: { + links: [ + { + title: 'Learn', + items: [ + { + label: 'Introduction', + to: '/learn', + }, + { + label: 'Tutorials', + to: '/learn/tutorials', + }, + { + label: 'Langauge reference', + to: '/learn/language', + }, + { + label: 'Run in Docker', + to: '/learn/docker', + }, + ], + }, + { + title: 'Develop', + items: [ + { + label: 'Programming guide', + to: '/develop', + }, + { + label: 'Contributing', + to: '/develop/contributing', + }, + { + label: 'Javadoc', + to: '/develop/javadoc', + }, + ], + }, + { + title: 'More', + items: [ + { + label: 'Try now', + href: 'https://refinery.services/', + }, + { + label: 'GitHub', + href: 'https://github.com/graphs4value/refinery', + }, + { + label: 'License', + to: '/license', + }, + ], + }, + { + title: 'Supporters', + items: [ + { + label: 'BME MIT FTSRG', + href: 'https://ftsrg.mit.bme.hu/en/', + }, + { + label: 'McGill ECE', + href: 'https://www.mcgill.ca/', + }, + { + label: '2022 Amazon Research Awards', + href: 'https://www.amazon.science/research-awards/recipients/daniel-varro-fall-2021', + }, + { + label: 'LiU Software and Systems', + href: 'https://liu.se/en/organisation/liu/ida/sas', + }, + { + label: 'WASP', + href: 'https://wasp-sweden.org/', + }, + ], + }, + ], + copyright: ` + Copyright © 2021-2024 + The Refinery Authors. + Available under the + Eclipse Public License - v 2.0. + `, + }, + algolia: { + appId: 'KYHOYEO80F', + apiKey: '152acfb8d1ad9e10f29f083a6b017a69', + indexName: 'refinery', + }, + } satisfies UserThemeConfig & AlgoliaConfig, + webpack: { + // Speed up builds by using a native Javascript loader. + // See: https://github.com/facebook/docusaurus/issues/4765#issuecomment-841135926 + // But we follow the Docusaurus upstream from + // https://github.com/facebook/docusaurus/blob/791da2e4a1a53aa6309887059e3f112fcb35bec4/website/docusaurus.config.ts#L152-L171 + // and use swc instead of esbuild. + jsLoader: (isServer) => ({ + loader: require.resolve('swc-loader'), + options: { + jsc: { + parser: { + syntax: 'typescript', + tsx: true, + }, + transform: { + react: { + runtime: 'automatic', + }, + }, + target: 'es2022', + }, + module: { + type: isServer ? 'commonjs' : 'es6', + }, + } satisfies SwcConfig, + }), + }, + headTags: [ + { + tagName: 'link', + attributes: { + rel: 'icon', + href: '/favicon.svg', + type: 'image/svg+xml', + }, + }, + { + tagName: 'link', + attributes: { + rel: 'icon', + href: '/favicon.png', + type: 'image/png', + sizes: '32x32', + }, + }, + { + tagName: 'link', + attributes: { + rel: 'icon', + href: '/favicon-96x96.png', + type: 'image/png', + sizes: '96x96', + }, + }, + { + tagName: 'link', + attributes: { + rel: 'apple-touch-icon', + href: '/apple-touch-icon.png', + type: 'image/png', + sizes: '180x180', + }, + }, + { + tagName: 'link', + attributes: { + rel: 'manifest', + href: '/manifest.webmanifest', + }, + }, + { + tagName: 'meta', + attributes: { + name: 'theme-color', + media: '(prefers-color-scheme:light)', + content: '#f5f5f5', + }, + }, + { + tagName: 'meta', + attributes: { + name: 'theme-color', + media: '(prefers-color-scheme:dark)', + content: '#282c34', + }, + }, + ], +} satisfies Config; diff --git a/subprojects/docs/package.json b/subprojects/docs/package.json new file mode 100644 index 000000000..15c129c29 --- /dev/null +++ b/subprojects/docs/package.json @@ -0,0 +1,71 @@ +{ + "//": [ + "SPDX-FileCopyrightText: 2024 The Refinery Authors ", + "", + "SPDX-License-Identifier: EPL-2.0" + ], + "name": "@refinery/docs", + "version": "0.0.0", + "description": "Documentation for Refinery", + "private": true, + "scripts": { + "build": "WEBPACK_URL_LOADER_LIMIT=0 docusaurus build --out-dir build/docusaurus", + "serve": "docusaurus serve --dir build/docusaurus --no-open", + "dev": "WEBPACK_URL_LOADER_LIMIT=0 docusaurus start --no-open", + "docusaurus": "docusaurus", + "write-translations": "docusaurus write-translations", + "write-heading-ids": "docusaurus write-heading-ids", + "typecheck": "yarn run g:tsc -p subprojects/docs/tsconfig.json", + "lint": "yarn run g:lint subprojects/docs", + "lint:fix": "yarn run lint --fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/graphs4value/refinery.git" + }, + "author": "The Refinery Authors ", + "license": "EPL-2.0", + "bugs": { + "url": "https://github.com/graphs4value/refinery/issues" + }, + "homepage": "https://refinery.tools", + "dependencies": { + "@docusaurus/core": "^3.2.1", + "@docusaurus/plugin-content-docs": "^3.2.1", + "@docusaurus/plugin-content-pages": "^3.2.1", + "@docusaurus/plugin-sitemap": "^3.2.1", + "@docusaurus/theme-classic": "^3.2.1", + "@docusaurus/theme-common": "^3.2.1", + "@docusaurus/theme-search-algolia": "^3.2.1", + "@fontsource-variable/jetbrains-mono": "^5.0.21", + "@fontsource-variable/open-sans": "^5.0.29", + "@fontsource/open-sans": "^5.0.28", + "@material-icons/svg": "^1.0.33", + "@mdx-js/react": "^3.0.1", + "@swc/core": "^1.5.0", + "clsx": "^2.1.1", + "mdast-util-mdx": "^3.0.0", + "prism-react-renderer": "^2.3.1", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "remark-smartypants": "^3.0.1", + "responsive-loader": "^3.1.2", + "sharp": "^0.33.3", + "swc-loader": "^0.2.6", + "terser-webpack-plugin": "^5.3.10", + "unified": "^11.0.4", + "unist-util-visit": "^5.0.0", + "webpack": "^5.91.0" + }, + "devDependencies": { + "@docusaurus/mdx-loader": "^3.2.1", + "@docusaurus/module-type-aliases": "^3.2.1", + "@docusaurus/types": "^3.2.1", + "@types/babel__core": "^7.20.5", + "@types/mdast": "^4.0.3", + "@types/node": "^20.12.7", + "@types/react": "^18.3.0", + "@types/react-dom": "^18.3.0", + "@types/unist": "^3.0.2" + } +} diff --git a/subprojects/docs/src/components/Features/fi1.svg b/subprojects/docs/src/components/Features/fi1.svg new file mode 100644 index 000000000..0acaf3f02 --- /dev/null +++ b/subprojects/docs/src/components/Features/fi1.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/Features/fi1.svg.license b/subprojects/docs/src/components/Features/fi1.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/Features/fi1.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/Features/fi2.svg b/subprojects/docs/src/components/Features/fi2.svg new file mode 100644 index 000000000..c1cba58d3 --- /dev/null +++ b/subprojects/docs/src/components/Features/fi2.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/Features/fi2.svg.license b/subprojects/docs/src/components/Features/fi2.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/Features/fi2.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/Features/fi3.svg b/subprojects/docs/src/components/Features/fi3.svg new file mode 100644 index 000000000..a901aa56a --- /dev/null +++ b/subprojects/docs/src/components/Features/fi3.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/Features/fi3.svg.license b/subprojects/docs/src/components/Features/fi3.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/Features/fi3.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/Features/fi4.svg b/subprojects/docs/src/components/Features/fi4.svg new file mode 100644 index 000000000..b7ad5a1d7 --- /dev/null +++ b/subprojects/docs/src/components/Features/fi4.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/Features/fi4.svg.license b/subprojects/docs/src/components/Features/fi4.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/Features/fi4.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/Features/fi5.svg b/subprojects/docs/src/components/Features/fi5.svg new file mode 100644 index 000000000..65d61c3c9 --- /dev/null +++ b/subprojects/docs/src/components/Features/fi5.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/Features/fi5.svg.license b/subprojects/docs/src/components/Features/fi5.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/Features/fi5.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/Features/index.module.css b/subprojects/docs/src/components/Features/index.module.css new file mode 100644 index 000000000..20ad300be --- /dev/null +++ b/subprojects/docs/src/components/Features/index.module.css @@ -0,0 +1,130 @@ +/* + * SPDX-FileCopyrightText: 2024 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +:global(.fibackground) { + fill: url(#fi-lg); +} + +:global(.fiforeground) { + fill: #303846; +} + +:global(.fiempty) { + fill: #fff; +} + +[data-theme='dark'] :global(.fiforeground) { + fill: var(--ifm-font-color-base); +} + +[data-theme='dark'] :global(.fiempty) { + fill: var(--ifm-background-color); +} + +.lg { + position: absolute; + visibility: hidden; + top: 0; + left: 0; + width: 0; + height: 0; +} + +.lg__start { + stop-color: var(--ifm-color-primary-lighter); +} + +.lg__end { + stop-color: var(--ifm-color-primary); +} + +[data-theme='dark'] .lg__start { + stop-color: var(--ifm-color-primary-light); +} + +[data-theme='dark'] .lg__end { + stop-color: var(--ifm-color-primary-darker); +} + +.feature__container { + display: flex; + flex-direction: column; + container-type: inline-size; + justify-content: stretch; +} + +.feature { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: var(--ifm-leading); + gap: 1rem; +} + +.feature__icon { + display: flex; + width: 100%; + max-width: 220px; + height: auto; + aspect-ratio: 1/1; +} + +.feature__icon svg { + width: 100%; + height: 100%; +} + +.feature__contents { + display: flex; + flex-direction: column; + align-items: center; + gap: 1rem; +} + +.feature__title { + margin: 0; +} + +.feature__text { + margin: 0; + text-align: center; +} + +@container (min-width: 660px) { + .feature { + flex-direction: row; + } + + .feature--even { + flex-direction: row-reverse; + } + + .feature__icon { + flex-shrink: 0; + } + + .feature__contents { + align-items: flex-start; + } + + .feature--even .feature__contents { + align-items: flex-end; + } + + .feature__title, + .feature__text { + text-align: left; + } + + .feature--even .feature__title, + .feature--even .feature__text { + text-align: right; + } +} + +.row--last { + margin-bottom: calc(-1 * var(--ifm-leading)); +} diff --git a/subprojects/docs/src/components/Features/index.tsx b/subprojects/docs/src/components/Features/index.tsx new file mode 100644 index 000000000..36fab14ab --- /dev/null +++ b/subprojects/docs/src/components/Features/index.tsx @@ -0,0 +1,114 @@ +/* + * SPDX-FileCopyrightText: 2024 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import clsx from 'clsx'; + +import Fi1 from './fi1.svg'; +import Fi2 from './fi2.svg'; +import Fi3 from './fi3.svg'; +import Fi4 from './fi4.svg'; +import Fi5 from './fi5.svg'; +import styles from './index.module.css'; + +function Feature({ + icon, + title, + offset, + even, + children, +}: { + icon: React.ReactNode; + title: string; + offset?: number; + even?: boolean; + children: React.ReactNode; +}) { + return ( +
+
+
{icon}
+
+

{title}

+

{children}

+
+
+
+ ); +} + +Feature.defaultProps = { + offset: undefined, + even: false, +}; + +export default function Features() { + return ( +
+ + + + + + + + +

Features

+
+ } title="Diverse graph generation"> + Refinery provides a framework for the automated generation of graphs. + + } title="Model with uncertainty" even> + Partial modeling allows us to explicitly represent unknown or + uncertain knowledge in our models. The Refinery framework enables us + to explore design alternatives systematically. + + } title="Formal logic reasoning"> + Refinery combines the mathematical precision of formal logic + structures with the expressiveness of graph-based models. Underlying + solver algorithms ensure formal correctness and completeness of + generation processes. + +
+
+ } + title="Advanced web-based editor" + offset={2} + even + > + Designers are supported with state-of-the-art web-based editors with + advanced IDE features and visualization techniques. The framework can + be applied as a simple command-line interface program or deployed on + the cloud. + + } title="Powerful graph algorithms"> + Refinery is equipped with powerful algorithms such as incremental + query evaluation, efficient graph isomorphism checking, and + version-controlled data structures to solve various modeling and graph + processing problems. + +
+
+ ); +} diff --git a/subprojects/docs/src/components/UseCases/index.module.css b/subprojects/docs/src/components/UseCases/index.module.css new file mode 100644 index 000000000..c8ffc0af7 --- /dev/null +++ b/subprojects/docs/src/components/UseCases/index.module.css @@ -0,0 +1,104 @@ +/* + * SPDX-FileCopyrightText: 2024 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +:global(.uchighlight) { + fill: var(--refinery-highlight); +} + +:global(.ucdraw) { + fill: #303846; +} + +:global(.ucstroke) { + stroke: #303846; +} + +[data-theme='dark'] :global(.ucdraw) { + fill: var(--ifm-color-emphasis-700); +} + +[data-theme='dark'] :global(.ucstroke) { + stroke: var(--ifm-color-emphasis-700); +} + +.use-case { + position: relative; + display: flex; + overflow: hidden; + flex-direction: column-reverse; + align-content: justify; + width: 100%; + background: var(--ifm-card-background-color); + box-shadow: 0 1.5px 3px 0 rgb(0 0 0 / 15%); + border: 1px solid var(--ifm-color-emphasis-200); + border-radius: var(--ifm-card-border-radius); + margin-bottom: 2rem; + transition: all var(--ifm-transition-fast) ease; + transition-property: border, box-shadow; + --ifm-link-color: var(--ifm-color-emphasis-800); + --ifm-link-hover-color: var(--ifm-color-emphasis-700); +} + +.use-case:hover, +.use-case:focus-within { + border-color: var(--ifm-color-primary); + box-shadow: 0 3px 6px 0 rgb(0 0 0 / 20%); +} + +.use-case__content { + display: flex; + overflow: hidden; + flex-direction: column; + align-items: center; + padding: 1rem; +} + +.use-case__content svg { + width: 100%; + max-width: 600px; + height: auto; + transform: scale(1); + transition: transform var(--ifm-transition-fast) ease; +} + +.use-case:hover svg, +.use-case:focus-within svg { + transform: scale(1.414); +} + +.use-case__title { + margin: 0; + padding: 1rem; + background: var(--ifm-background-surface-color); + font-weight: 400; +} + +.use-case__title b, +.use-case__title span { + display: inline-block; +} + +[data-theme='dark'] .use-case__title { + background: var(--ifm-color-emphasis-200); +} + +.use-case__link:hover > * { + text-decoration: underline; +} + +.use-case__link::before { + content: ' '; + position: absolute; + top: 0; + left: 0; + z-index: 99; + width: 100%; + height: 100%; +} + +.row--bottom { + margin-bottom: -2rem; +} diff --git a/subprojects/docs/src/components/UseCases/index.tsx b/subprojects/docs/src/components/UseCases/index.tsx new file mode 100644 index 000000000..c9570cc66 --- /dev/null +++ b/subprojects/docs/src/components/UseCases/index.tsx @@ -0,0 +1,106 @@ +/* + * SPDX-FileCopyrightText: 2024 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import Link from '@docusaurus/Link'; +import clsx from 'clsx'; + +import styles from './index.module.css'; +import Uc1 from './uc1.svg'; +import Uc2 from './uc2.svg'; +import Uc3 from './uc3.svg'; +import Uc4 from './uc4.svg'; +import Uc5 from './uc5.svg'; +import Uc6 from './uc6.svg'; + +function UseCase({ + icon, + title, + href, +}: { + icon: React.ReactNode; + title: React.ReactNode; + href: string; +}) { + return ( +
+
+

+ + {title} + +

+
{icon}
+
+
+ ); +} + +export default function UseCases() { + return ( + <> +
+ } + title={ + <> + Scenario generation for testing autonomous vechicles + + } + href="https://doi.org/10.1007/s10270-021-00884-z" + /> + } + title={ + <> + Conformance checking of modeling toolchains + + } + href="https://doi.org/10.1007/s10009-019-00530-6" + /> + } + title={ + <> + Synthesize distributed communication networks + + } + href="https://doi.org/10.1109/TSE.2020.3025732" + /> +
+
+ } + title={ + <> + Execution time analysis for data-driven{' '} + critical systems + + } + href="https://doi.org/10.1145/3471904" + /> + } + title={ + <> + Generative architectures with assured resilience + + } + href="https://doi.org/10.1145/3550355.3552448" + /> + } + title={ + <> + Video game map generator with model-based{' '} + techniques + + } + href="https://doi.org/10.1145/3417990.3422001" + /> +
+ + ); +} diff --git a/subprojects/docs/src/components/UseCases/uc1.svg b/subprojects/docs/src/components/UseCases/uc1.svg new file mode 100644 index 000000000..2b5504e58 --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc1.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/UseCases/uc1.svg.license b/subprojects/docs/src/components/UseCases/uc1.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc1.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/UseCases/uc2.svg b/subprojects/docs/src/components/UseCases/uc2.svg new file mode 100644 index 000000000..8aec8169f --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc2.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/UseCases/uc2.svg.license b/subprojects/docs/src/components/UseCases/uc2.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc2.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/UseCases/uc3.svg b/subprojects/docs/src/components/UseCases/uc3.svg new file mode 100644 index 000000000..cd4633173 --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc3.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/UseCases/uc3.svg.license b/subprojects/docs/src/components/UseCases/uc3.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc3.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/UseCases/uc4.svg b/subprojects/docs/src/components/UseCases/uc4.svg new file mode 100644 index 000000000..fa647e00a --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc4.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/UseCases/uc4.svg.license b/subprojects/docs/src/components/UseCases/uc4.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc4.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/UseCases/uc5.svg b/subprojects/docs/src/components/UseCases/uc5.svg new file mode 100644 index 000000000..1b7d769d2 --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc5.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/UseCases/uc5.svg.license b/subprojects/docs/src/components/UseCases/uc5.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc5.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/UseCases/uc6.svg b/subprojects/docs/src/components/UseCases/uc6.svg new file mode 100644 index 000000000..063d89a83 --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc6.svg @@ -0,0 +1 @@ + diff --git a/subprojects/docs/src/components/UseCases/uc6.svg.license b/subprojects/docs/src/components/UseCases/uc6.svg.license new file mode 100644 index 000000000..15aca74df --- /dev/null +++ b/subprojects/docs/src/components/UseCases/uc6.svg.license @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + diff --git a/subprojects/docs/src/components/Video/cover-background.png b/subprojects/docs/src/components/Video/cover-background.png new file mode 100644 index 000000000..11369ae37 Binary files /dev/null and b/subprojects/docs/src/components/Video/cover-background.png differ diff --git a/subprojects/docs/src/components/Video/cover-background.png.license b/subprojects/docs/src/components/Video/cover-background.png.license new file mode 100644 index 000000000..50ad65f2c --- /dev/null +++ b/subprojects/docs/src/components/Video/cover-background.png.license @@ -0,0 +1,9 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 + +Modified image based on "Low Angle Shot of Manufacturing Plant under Blue Sky" +available under the CC-1.0 license at +https://www.pexels.com/photo/low-angle-shot-of-manufacturing-plant-under-blue-sky-257700/ +Original image "Bulgaria, Vratsa, Abandoned image. Free for use." by "2427999" also available at +https://pixabay.com/photos/bulgaria-vratsa-abandoned-industry-1351947/ diff --git a/subprojects/docs/src/components/Video/cover.svg b/subprojects/docs/src/components/Video/cover.svg new file mode 100644 index 000000000..632175d9c --- /dev/null +++ b/subprojects/docs/src/components/Video/cover.svg @@ -0,0 +1 @@ +Videointroduction diff --git a/subprojects/docs/src/components/Video/cover.svg.license b/subprojects/docs/src/components/Video/cover.svg.license new file mode 100644 index 000000000..b80566a0e --- /dev/null +++ b/subprojects/docs/src/components/Video/cover.svg.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 The Refinery Authors + +SPDX-License-Identifier: EPL-2.0 diff --git a/subprojects/docs/src/components/Video/index.module.css b/subprojects/docs/src/components/Video/index.module.css new file mode 100644 index 000000000..4fbd1b80c --- /dev/null +++ b/subprojects/docs/src/components/Video/index.module.css @@ -0,0 +1,79 @@ +/* + * SPDX-FileCopyrightText: 2024 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +:global(.videocolor) { + fill: var(--ifm-color-primary); +} + +:global(.videohighlight) { + fill: var(--refinery-highlight); +} + +[data-theme='dark'] :global(.videocolor) { + fill: var(--ifm-color-primary-darker); +} + +.video__container { + position: relative; + width: 100%; + height: auto; + aspect-ratio: 560/315; + box-shadow: var(--ifm-global-shadow-lw); + transition: box-shadow var(--ifm-button-transition-duration) var(--ifm-transition-timing-default); +} + +.video__container:hover, +.video__container:focus-within { + box-shadow: var(--ifm-global-shadow-md); +} + +.video, +.video__button, +.video__image, +.video__svg, +.video__svg > svg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.video__svg text { + font-family: var(--ifm-font-family-base); +} + +.video__button { + margin: 0; + padding: 0; + border: none; + cursor: pointer; + background-size: cover; +} + +.video__cover { + z-index: 1; +} + +:global(.videoplay) { + fill: rgb(255 255 255 / 40%); + transition: fill var(--ifm-button-transition-duration) var(--ifm-transition-timing-default); +} + +.video__container:hover :global(.videoplay), +.video__container:focus-within :global(.videoplay) { + fill: rgb(255 255 255 / 70%); +} + +:global(.videotitle) * { + fill: #303846; + transition: fill var(--ifm-button-transition-duration) var(--ifm-transition-timing-default); +} + +.video__container:hover :global(.videotitle) *, +.video__container:focus-within :global(.videotitle) * { + fill: #21252b; +} diff --git a/subprojects/docs/src/components/Video/index.tsx b/subprojects/docs/src/components/Video/index.tsx new file mode 100644 index 000000000..bd36eaa42 --- /dev/null +++ b/subprojects/docs/src/components/Video/index.tsx @@ -0,0 +1,62 @@ +/* + * SPDX-FileCopyrightText: 2024 The Refinery Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +import { useState } from 'react'; + +import coverBackground from './cover-background.png?sizes[]=1920&sizes[]=1288&sizes[]=1108&&sizes[]=644&sizes[]=322&placeholder=true&rl'; +import Cover from './cover.svg'; +import styles from './index.module.css'; + +export default function Video() { + const [started, setStarted] = useState(false); + return ( + <> +

Check out the intro video

+
+
+ {started ? ( +