diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9c30a70..911da2f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,14 +1,11 @@ name: Bug report description: Create a report to help us improve ---- -title: '' labels: - bug assignees: - nekofar ---- body: - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index f69ed1f..61f8e9a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,14 +1,11 @@ name: Feature request description: Suggest an idea for this project ---- -title: '' labels: - enhancement assignees: - nekofar ---- body: - type: textarea attributes: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac19368..b570f46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,11 +25,24 @@ on: workflow_dispatch: jobs: + guard: + name: Usage guard + runs-on: ubuntu-latest + steps: + # Uses the action-usage-guard action + - name: Run Action Usage Guard + uses: nekofar/action-usage-guard@develop + with: + # GitHub access token for authentication. + token: ${{ secrets.ACCESS_TOKEN }} + # Defines the threshold for the usage guard. + threshold: 70 # Prepare environment and build the plugin build: name: Build runs-on: ubuntu-latest + needs: [ guard ] outputs: version: ${{ steps.properties.outputs.version }} changelog: ${{ steps.changelog.outputs.changelog }} @@ -51,9 +64,16 @@ jobs: - name: Gradle Wrapper Validation uses: gradle/wrapper-validation-action@v1.1.0 + # Setup Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v3.12.0 + with: + distribution: zulu + java-version: 17 + # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2.6.1 + uses: gradle/gradle-build-action@v2.7.0 # Set environment variables - name: Export Properties @@ -67,7 +87,7 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "name=$NAME" >> $GITHUB_OUTPUT echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT - + ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier # Extract changelog information @@ -106,11 +126,79 @@ jobs: with: name: ${{ steps.artifact.outputs.filename }} path: ./build/distributions/content/*/* - + + # Run tests and upload a code coverage report + test: + name: Test + needs: [ build ] + runs-on: ubuntu-latest + steps: + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v3.5.3 + + # Setup Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v3.12.0 + with: + distribution: zulu + java-version: 17 + + # Setup Gradle + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.7.0 + + # Run tests + - name: Run Tests + run: ./gradlew check + + # Collect Tests Result of failed tests + - name: Collect Tests Result + if: ${{ failure() }} + uses: actions/upload-artifact@v3.1.2 + with: + name: tests-result + path: ${{ github.workspace }}/build/reports/tests + + # Upload Kover report to CodeCov + - name: Upload Code Coverage Report + uses: codecov/codecov-action@v3.1.4 + with: + files: ${{ github.workspace }}/build/reports/kover/xml/report.xml + + # Run Qodana inspections and provide report + inspectCode: + name: Inspect code + needs: [ build ] + runs-on: ubuntu-latest + permissions: + contents: write + checks: write + pull-requests: write + steps: + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v3.5.3 + + # Setup Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v3.12.0 + with: + distribution: zulu + java-version: 17 + + # Run Qodana inspections + - name: Qodana - Code Inspection + uses: JetBrains/qodana-action@v2023.2.1 + with: + cache-default-branch-only: true + # Run plugin structure verification along with IntelliJ Plugin Verifier verify: name: Verify plugin - needs: build + needs: [ build, test, inspectCode ] runs-on: ubuntu-latest steps: # Remove files to save space @@ -123,9 +211,16 @@ jobs: - name: Fetch Sources uses: actions/checkout@v3.5.3 + # Setup Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v3.12.0 + with: + distribution: zulu + java-version: 17 + # Setup Gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2.6.1 + uses: gradle/gradle-build-action@v2.7.0 # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache @@ -146,34 +241,12 @@ jobs: name: pluginVerifier-result path: ${{ github.workspace }}/build/reports/pluginVerifier - # Run Qodana inspections and provide report - inspectCode: - name: Inspect code - needs: build - runs-on: ubuntu-latest - permissions: - contents: write - checks: write - pull-requests: write - steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v3.5.3 - - # Run Qodana inspections - - name: Qodana - Code Inspection - if: ${{ github.actor != 'dependabot[bot]' }} - uses: JetBrains/qodana-action@v2023.2.1 - with: - cache-default-branch-only: true - # Prepare a draft release for GitHub Releases page for the manual verification # If accepted and published, release workflow would be triggered releaseDraft: name: Release draft if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/support/') - needs: [ build, verify, inspectCode ] + needs: [ build, verify ] runs-on: ubuntu-latest permissions: contents: write @@ -183,6 +256,13 @@ jobs: - name: Fetch Sources uses: actions/checkout@v3.5.3 + # Setup Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v3.12.0 + with: + distribution: zulu + java-version: 17 + # Remove old release drafts by using the curl request for the available releases with a draft flag - name: Remove Old Release Drafts env: @@ -194,16 +274,13 @@ jobs: # Create a new release draft which is not publicly visible and requires manual acceptance - name: Create Release Draft - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create v${{ needs.build.outputs.version }} \ - --draft \ - --title "v${{ needs.build.outputs.version }}" \ - --notes "$(cat << 'EOM' - ${{ needs.build.outputs.changelog }} - EOM - )" + uses: nekofar/create-github-release@v1.0.8 + with: + tag: v${{ needs.build.outputs.version }} # The name of the tag to be released + title: v${{ needs.build.outputs.version }} # The title for the release + notes: ${{ needs.build.outputs.changelog }} # The release notes generated in the previous step + draft: true # The release will be created as a draft + prerelease: ${{ contains(needs.build.outputs.version, '-rc') || contains(needs.build.outputs.version, '-beta') || contains(needs.build.outputs.version, '-alpha') }} # Conditions to mark the release as a pre-release concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5e16e8..a9d6ecc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,11 +26,14 @@ jobs: # Setup Java environment for the next steps - name: Setup Java - uses: actions/setup-java@v3.11.0 + uses: actions/setup-java@v3.12.0 with: distribution: zulu java-version: 17 - cache: gradle + + # Setup Gradle + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.7.0 # Publish the plugin to the Marketplace - name: Publish Plugin diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index 64ffa88..24bc971 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -33,15 +33,18 @@ jobs: # Check out current repository - name: Fetch Sources - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v3.5.3 # Setup Java environment for the next steps - name: Setup Java - uses: actions/setup-java@v3.11.9 + uses: actions/setup-java@v3.12.0 with: distribution: zulu java-version: 17 - cache: gradle + + # Setup Gradle + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.7.0 # Run IDEA prepared for UI testing - name: Run IDE diff --git a/CHANGELOG.md b/CHANGELOG.md index eef5196..196041e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [1.0.7] - 2023-07-27 + +### Security + +- Upgraded gradle version from 8.1.1 to 8.2.1 + ## [1.0.6] - 2023-07-22 ### Bug Fixes diff --git a/README.md b/README.md index 1712881..7f3d4e8 100644 --- a/README.md +++ b/README.md @@ -16,5 +16,5 @@ Whether you're a seasoned pro or just starting out, makes it easy to speed up th ## Installation -To install plugin open `Preferences > Plugins > Marketplace`, and search for Redwood. +For plugin installation, navigate to `Preferences`, then `Plugins`, and finally `Marketplace`. In the search bar, enter `Redwood`. diff --git a/gradle.properties b/gradle.properties index dd97962..57d1140 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ pluginName = IntelliJ Redwood Plugin pluginRepositoryUrl = https://github.com/KartanHQ/intellij-redwood # SemVer format -> https://semver.org -pluginVersion = 1.0.6 +pluginVersion = 1.0.7 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 222 @@ -23,7 +23,7 @@ platformPlugins = JavaScript javaVersion = 17 # Gradle Releases -> https://github.com/gradle/gradle/releases -gradleVersion = 8.1.1 +gradleVersion = 8.2.1 # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib kotlin.stdlib.default.dependency = false @@ -36,6 +36,3 @@ org.gradle.caching = true # Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment systemProp.org.gradle.unsafe.kotlin.assignment = true - -# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom -kotlin.incremental.useClasspathSnapshot = false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6ffe770..c974082 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,6 @@ annotations = "24.0.1" # plugins -dokka = "1.8.20" kotlin = "1.9.0" changelog = "2.1.2" gradleIntelliJPlugin = "1.15.0" @@ -15,7 +14,6 @@ annotations = { group = "org.jetbrains", name = "annotations", version.ref = "an [plugins] changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } -dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" } kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..033e24c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..9f4197d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cb..fcb6fca 100755 --- a/gradlew +++ b/gradlew @@ -130,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. diff --git a/settings.gradle.kts b/settings.gradle.kts index e7bbe5f..9a43e61 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "intellij-redwood" \ No newline at end of file +rootProject.name = "intellij-redwood" diff --git a/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodCliProjectGenerator.kt b/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodCliProjectGenerator.kt index 14114c0..634fb0b 100644 --- a/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodCliProjectGenerator.kt +++ b/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodCliProjectGenerator.kt @@ -6,33 +6,30 @@ import com.intellij.lang.javascript.boilerplate.NpxPackageDescriptor import com.intellij.openapi.project.Project import com.intellij.openapi.roots.ContentEntry import com.intellij.openapi.vfs.VirtualFile -import com.nekofar.milad.intellij.redwood.RedwoodBundle +import com.nekofar.milad.intellij.redwood.RedwoodBundle.message import com.nekofar.milad.intellij.redwood.RedwoodIcons -import javax.swing.Icon class RedwoodCliProjectGenerator : NpmPackageProjectGenerator() { private val packageName = "create-redwood-app" private val npxCommand = "create-redwood-app" - override fun getName(): String = RedwoodBundle.message("redwood.project.generator.name") + override fun getName() = message("redwood.project.generator.name") - override fun getDescription(): String = RedwoodBundle.message("redwood.project.generator.description") + override fun getDescription() = message("redwood.project.generator.description") - override fun filters(project: Project, baseDir: VirtualFile): Array = emptyArray() + override fun filters(project: Project, baseDir: VirtualFile) = emptyArray() override fun customizeModule(virtualFile: VirtualFile, contentEntry: ContentEntry?) {} - override fun packageName(): String = packageName + override fun packageName() = packageName - override fun presentablePackageName(): String = - RedwoodBundle.message("redwood.project.generator.presentable.package.name") + override fun presentablePackageName() = message("redwood.project.generator.presentable.package.name") override fun getNpxCommands() = listOf(NpxPackageDescriptor.NpxCommand(packageName, npxCommand)) - override fun generateInTemp(): Boolean = true + override fun generateInTemp() = true - override fun generatorArgs(project: Project?, dir: VirtualFile?, settings: Settings?): Array = - arrayOf(project?.name.toString()) + override fun generatorArgs(project: Project, baseDir: VirtualFile) = arrayOf(project.name) - override fun getIcon(): Icon = RedwoodIcons.ProjectGenerator + override fun getIcon() = RedwoodIcons.ProjectGenerator } diff --git a/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodProjectTemplateFactory.kt b/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodProjectTemplateFactory.kt index 5dd0453..fb548e5 100644 --- a/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodProjectTemplateFactory.kt +++ b/src/main/kotlin/com/nekofar/milad/intellij/redwood/cli/RedwoodProjectTemplateFactory.kt @@ -5,5 +5,7 @@ import com.intellij.lang.javascript.boilerplate.JavaScriptNewTemplatesFactoryBas import com.intellij.platform.ProjectTemplate class RedwoodProjectTemplateFactory : JavaScriptNewTemplatesFactoryBase() { - override fun createTemplates(context: WizardContext?): Array = arrayOf(RedwoodCliProjectGenerator()) + override fun createTemplates(context: WizardContext?): Array = arrayOf( + RedwoodCliProjectGenerator() + ) } diff --git a/src/main/resources/META-INF/pluginIcon.svg b/src/main/resources/META-INF/pluginIcon.svg index 5961d23..52f52e1 100644 --- a/src/main/resources/META-INF/pluginIcon.svg +++ b/src/main/resources/META-INF/pluginIcon.svg @@ -1,9 +1,3 @@ - - - - - - - + + diff --git a/src/main/resources/icons/redwood.svg b/src/main/resources/icons/redwood.svg index 9a7a76b..f1a6e42 100644 --- a/src/main/resources/icons/redwood.svg +++ b/src/main/resources/icons/redwood.svg @@ -1,9 +1,3 @@ - - - - - - - + + diff --git a/src/main/resources/icons/type.svg b/src/main/resources/icons/type.svg index 9a7a76b..f1a6e42 100644 --- a/src/main/resources/icons/type.svg +++ b/src/main/resources/icons/type.svg @@ -1,9 +1,3 @@ - - - - - - - + +