diff --git a/.github/CODE_OF_CONDUCT.MD b/.github/CODE_OF_CONDUCT.MD new file mode 100644 index 0000000..12507ab --- /dev/null +++ b/.github/CODE_OF_CONDUCT.MD @@ -0,0 +1,3 @@ +# Code of Conduct + +Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#code-of-conduct). diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..f057099 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,3 @@ +# Security Policy + +Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#security-vulnerabilities). diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 0000000..3bb8adb --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,3 @@ +# Support & Help + +Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#support-questions). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index cf42ff4..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: route-visualizer CI - -# Only on Development we build snapshots -on: - push: - branches: - - development - - master - -env: - MODULE_ID: route-visualizer - -jobs: - ############################################# - # Tests First baby! We fail, no build :( - ############################################# - tests: - uses: ./.github/workflows/tests.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - ############################################# - # Build ContentBox - ############################################# - build: - name: Build & Publish - needs: tests - runs-on: ubuntu-20.04 - steps: - - name: Checkout Repository - uses: actions/checkout@v3.2.0 - - - name: Setup Java - uses: actions/setup-java@v3.9.0 - with: - distribution: "temurin" - java-version: "11" - - - name: Setup CommandBox - uses: Ortus-Solutions/setup-commandbox@v2.0.1 - with: - forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }} - - - name: Setup Environment Variables For Build Process - id: current_version - run: | - echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV - box package set version=@build.version@+@build.number@ - # master or snapshot - echo "Github Ref is $GITHUB_REF" - echo "BRANCH=master" >> $GITHUB_ENV - if [ $GITHUB_REF == 'refs/heads/development' ] - then - echo "BRANCH=development" >> $GITHUB_ENV - fi - - name: Build ${{ env.MODULE_ID }} - run: | - box install commandbox-docbox - box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }} - - - name: Upload Build Artifacts - if: success() - uses: actions/upload-artifact@v3.1.1 - with: - name: ${{ env.MODULE_ID }} - path: | - .artifacts/**/* - - - name: Upload Binaries to S3 - uses: jakejarvis/s3-sync-action@master - with: - args: --acl public-read - env: - AWS_S3_BUCKET: "downloads.ortussolutions.com" - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} - SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}" - DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}" - - - name: Upload API Docs to S3 - uses: jakejarvis/s3-sync-action@master - with: - args: --acl public-read - env: - AWS_S3_BUCKET: "apidocs.ortussolutions.com" - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} - SOURCE_DIR: ".tmp/apidocs" - DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}" - - - name: Publish To ForgeBox - run: | - cd .tmp/${{ env.MODULE_ID }} - cat box.json - box forgebox publish - - - name: Inform Slack of Build - if: ${{ always() }} - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: coding - SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' - SLACK_ICON_EMOJI: ":bell:" - SLACK_MESSAGE: '${{ env.MODULE_ID }} Built with ${{ job.status }}!' - SLACK_TITLE: "${{ env.MODULE_ID }} Build" - SLACK_USERNAME: CI - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/gh-release.yml b/.github/workflows/gh-release.yml deleted file mode 100644 index 3de37b9..0000000 --- a/.github/workflows/gh-release.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Publish Github Release -name: Github Release - -on: - push: - tags: - - v[0-9]+.* - -jobs: - create-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.2.0 - - uses: taiki-e/create-gh-release-action@v1.6.1 - with: - # Produced by the build/Build.cfc - changelog: changelog.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b77d2c9..2971af2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,10 +6,10 @@ on: - "main" - "master" - "development" - - "v*" + - "releases/v*" pull_request: branches: - - "v*" + - "releases/v*" - development jobs: @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout Repository - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v4 - uses: Ortus-Solutions/commandbox-action@v1.0.2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..753120d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,175 @@ +name: Build a Release + +on: + # If you push to master|main this will trigger a stable release + push: + branches: + - master + - main + + # Reusable workflow : Usually called by a `snapshot` workflow + workflow_call: + inputs: + snapshot: + description: 'Is this a snapshot build?' + required: false + default: false + type: boolean + +env: + MODULE_ID: route-visualizer + SNAPSHOT: ${{ inputs.snapshot || false }} + +jobs: + ########################################################################################## + # Build & Publish + ########################################################################################## + build: + name: Build & Publish + runs-on: ubuntu-20.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup CommandBox + uses: Ortus-Solutions/setup-commandbox@v2.0.1 + with: + forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }} + + - name: "Setup Environment Variables For Build Process" + id: current_version + run: | + echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV + box package set version=@build.version@+@build.number@ + # master or snapshot + echo "Github Ref is $GITHUB_REF" + echo "BRANCH=master" >> $GITHUB_ENV + if [ $GITHUB_REF == 'refs/heads/development' ] + then + echo "BRANCH=development" >> $GITHUB_ENV + fi + + - name: Update changelog [unreleased] with latest version + uses: thomaseizinger/keep-a-changelog-new-release@1.3.0 + if: env.SNAPSHOT == 'false' + with: + changelogPath: ./changelog.md + tag: v${{ env.VERSION }} + + - name: Build ${{ env.MODULE_ID }} + run: | + npm install -g markdownlint-cli + markdownlint changelog.md --fix + box install commandbox-docbox + box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }} + + - name: Commit Changelog To Master + uses: EndBug/add-and-commit@v9.1.1 + if: env.SNAPSHOT == 'false' + with: + author_name: Github Actions + author_email: info@ortussolutions.com + message: 'Finalized changelog for v${{ env.VERSION }}' + add: changelog.md + + - name: Tag Version + uses: rickstaa/action-create-tag@v1.6.1 + if: env.SNAPSHOT == 'false' + with: + tag: "v${{ env.VERSION }}" + force_push_tag: true + message: "Latest Release v${{ env.VERSION }}" + + - name: Upload Build Artifacts + if: success() + uses: actions/upload-artifact@v4 + with: + name: ${{ env.MODULE_ID }} + path: | + .artifacts/**/* + changelog.md + + - name: Upload Binaries to S3 + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read + env: + AWS_S3_BUCKET: "downloads.ortussolutions.com" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} + SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}" + DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}" + + - name: Upload API Docs to S3 + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read + env: + AWS_S3_BUCKET: "apidocs.ortussolutions.com" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} + SOURCE_DIR: ".tmp/apidocs" + DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}" + + - name: Publish To ForgeBox + run: | + cd .tmp/${{ env.MODULE_ID }} + cat box.json + box forgebox publish --force + + - name: Create Github Release + uses: taiki-e/create-gh-release-action@v1.6.2 + continue-on-error: true + if: env.SNAPSHOT == 'false' + with: + title: ${{ env.VERSION }} + changelog: changelog.md + token: ${{ secrets.GITHUB_TOKEN }} + ref: refs/tags/v${{ env.VERSION }} + + ########################################################################################## + # Prep Next Release + ########################################################################################## + prep_next_release: + name: Prep Next Release + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + runs-on: ubuntu-20.04 + needs: [ build ] + steps: + # Checkout development + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: development + + - name: Setup CommandBox + uses: Ortus-Solutions/setup-commandbox@v2.0.1 + with: + forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }} + + - name: Download build artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.MODULE_ID }} + path: .tmp + + # Copy the changelog to the development branch + - name: Copy Changelog + run: | + cp .tmp/changelog.md changelog.md + + # Bump to next version + - name: Bump Version + run: | + box bump --minor --!TagVersion + + # Commit it back to development + - name: Commit Version Bump + uses: EndBug/add-and-commit@v9.1.1 + with: + author_name: Github Actions + author_email: info@ortussolutions.com + message: 'Version bump' + add: | + box.json + changelog.md diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..37e3183 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,43 @@ +name: Build Snapshot + +on: + push: + branches: + - 'development' + +jobs: + ########################################################################################## + # Module Tests + ########################################################################################## + tests: + secrets: inherit + uses: ./.github/workflows/tests.yml + + ########################################################################################## + # Format Source Code + ########################################################################################## + format: + name: Code Auto-Formatting + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + + - name: Auto-format + uses: Ortus-Solutions/commandbox-action@v1.0.2 + with: + cmd: run-script format + + - name: Commit Format Changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Apply cfformat changes + + ########################################################################################## + # Release it + ########################################################################################## + release: + uses: ./.github/workflows/release.yml + needs: [ tests, format ] + secrets: inherit + with: + snapshot: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8526c21..ce49645 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ on: workflow_call: secrets: SLACK_WEBHOOK_URL: - required: true + required: false jobs: tests: @@ -14,13 +14,32 @@ jobs: env: DB_USER: root DB_PASSWORD: root + continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false matrix: - cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ] + cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ] + coldboxVersion: [ "^6.0.0", "^7.0.0" ] + experimental: [ false ] + include: + - coldboxVersion: "^7.0.0" + cfengine: "lucee@6" + experimental: true + - coldboxVersion: "be" + cfengine: "lucee@5" + experimental: true + - coldboxVersion: "be" + cfengine: "adobe@2018" + experimental: true + - coldboxVersion: "be" + cfengine: "adobe@2021" + experimental: true + - coldboxVersion: "be" + cfengine: "adobe@2023" + experimental: true steps: - name: Checkout Repository - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v4 # Not Needed in this module #- name: Setup Database and Fixtures @@ -30,7 +49,7 @@ jobs: # mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql - name: Setup Java - uses: actions/setup-java@v3.9.0 + uses: actions/setup-java@v3 with: distribution: "temurin" java-version: "11" @@ -54,10 +73,12 @@ jobs: # printf "DB_BUNDLEVERSION=8.0.19\n" >> .env # printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env - - name: Install Test Harness Dependencies + - name: Install Test Harness with ColdBox ${{ matrix.coldboxVersion }} run: | box install - cd test-harness && box install + cd test-harness + box package set dependencies.coldbox=${{ matrix.coldboxVersion }} + box install - name: Start ${{ matrix.cfengine }} Server run: | @@ -74,13 +95,13 @@ jobs: if: always() with: junit_files: test-harness/tests/results/**/*.xml - check_name: "${{ matrix.cfengine }} Test Results" + check_name: "${{ matrix.cfengine }} ColdBox ${{ matrix.coldboxVersion }} Test Results" - name: Upload Test Results to Artifacts if: always() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: test-results-${{ matrix.cfengine }} + name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }} path: | test-harness/tests/results/**/* @@ -91,9 +112,9 @@ jobs: - name: Upload Debug Logs To Artifacts if: ${{ failure() }} - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: Failure Debugging Info - ${{ matrix.cfengine }} + name: Failure Debugging Info - ${{ matrix.cfengine }} - ${{ matrix.coldboxVersion }} path: | .engine/**/logs/* .engine/**/WEB-INF/cfusion/logs/* @@ -107,6 +128,6 @@ jobs: SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' SLACK_ICON_EMOJI: ":bell:" SLACK_MESSAGE: '${{ github.repository }} tests failed :cry:' - SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} failed + SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} with ColdBox ${{ matrix.coldboxVersion }} failed SLACK_USERNAME: CI SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.markdownlint.json b/.markdownlint.json index 3707fcb..8189ee3 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -8,6 +8,7 @@ "no-multiple-blanks": { "maximum": 2 }, + "no-duplicate-heading" : false, "no-duplicate-header" : { "siblings_only" : true }, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..bdd5dda --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,108 @@ +# Contributing Guide + +Hola amigo! I'm really excited that you are interested in contributing to route-visualizer. Before submitting your contribution, please make sure to take a moment and read through the following guidelines: + +- [Code Of Conduct](#code-of-conduct) +- [Bug Reporting](#bug-reporting) +- [Support Questions](#support-questions) +- [Pull Request Guidelines](#pull-request-guidelines) +- [Security Vulnerabilities](#security-vulnerabilities) +- [Development Setup](#development-setup) +- [Language Compatibility](#language-compatibility) +- [Coding Styles \& Formatting](#coding-styles--formatting) +- [CFC Docs With DocBox](#cfc-docs-with-docbox) +- [Financial Contributions](#financial-contributions) +- [Contributors](#contributors) + +## Code Of Conduct + +This project is open source, and as such, the maintainers give their free time to build and maintain the source code held within. They make the code freely available in the hope that it will be of use to other developers and/or businesses. Please be considerate towards maintainers when raising issues or presenting pull requests. **We all follow the Golden Rule: Do to others as you want them to do to you.** + +- As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. +- Participants will be tolerant of opposing views. +- Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. +- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. +- When interpreting the words and actions of others, participants should always assume good intentions. Emotions cannot be derived from textual representations. +- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. + + +## Bug Reporting + +Please make sure also that if you submit a pull request, you link it to the appropriate issue(s). + +If you file a bug report, your issue should contain a title, a clear description of the issue, a way to replicate the issue, and any support files that we might need to replicate your issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix for it. All issues that do not contain a way to replicate will not be addressed. + +## Support Questions + +If you have any questions on usage, professional support or just ideas to bounce off the maintainers, please do not create an issue. Leverage our support channels first. + +- Ortus Community Discourse: https://community.ortussolutions.com +- Box Slack Team: http://boxteam.ortussolutions.com/ +- Professional Support: https://www.ortussolutions.com/services/support + +## Pull Request Guidelines + +- The `(master|main)` branch is just a snapshot of the latest stable release. All development should be done in dedicated branches. Do not submit PRs against the master branch. They will be closed. +- All pull requests should be sent to the `development` branch or the appropriate LTS branch (`releases/v{version}`). +- It's OK to have multiple small commits as you work on the PR - GitHub will automatically squash it before merging. +- Make sure all local tests pass before submitting the merge. +- Please make sure all your pull requests have companion tests. +- Please link the Jira issue in your PR title when sending the final PR + +## Security Vulnerabilities + +If you discover a security vulnerability, please send an email to the Ortus security team at [security@ortussolutions.com](mailto:security@ortussolutions.com?subject=security) and make sure you report it to the `#security` channel in our Box Team Slack Channel. All security vulnerabilities will be promptly addressed. + +## Development Setup + +1. Fork and Star our project. +2. Make sure you have CommandBox installed: https://www.ortussolutions.com/products/commandbox#download +3. Start a CommandBox shell in the root of the project: `box` +4. Install the development dependencies: `run-script install:dependencies` +5. Hack away! Create tests under `/test-harness/specs` or wherever they are set in the project and run the tests! + +## Language Compatibility + +Please make sure your code runs on the following CFML Engines: + +- Lucee 5+ +- Adobe ColdFusion 2018+ + +## Coding Styles & Formatting + +We are big on coding styles and have included a `.cfformat.json` in the root of the project so that you can run the formatting tools and CommandBox scripts: + +```bash +# Format everything +box run-script format + +# Start a watcher, type away, save and auto-format for you +box run-script format:watch +``` + +We recommend that anytime you hack on the core you start the formatter watcher (`box run-script format:watch`). This will monitor your changes and auto-format your code for you. + +You can also see the Ortus Coding Standards you must follow here: https://github.com/Ortus-Solutions/coding-standards. + +## CFC Docs With DocBox + +All CFCs are self-documenting and we leverage [DocBox](https://docbox.ortusbooks.com/) to document the entire software. All functions must be properly documented using the DocBox syntax: https://docbox.ortusbooks.com/getting-started/annotating-your-code + + +## Financial Contributions + +You can support ColdBox and all of our Open Source initiatives at Ortus Solutions by becoming a patreon. You can also get lots of goodies and services depending on the level of contributions. + +- [Become a backer or sponsor on Patreon](https://www.patreon.com/ortussolutions) +- [One-time donations via PayPal](https://www.paypal.com/paypalme/ortussolutions) + +## Contributors + +Thank you to all the people who have already contributed to route-visualizer! We :heart: :heart: :heart: love you! + + + + + + +Made with [contributors-img](https://contrib.rocks) diff --git a/box.json b/box.json index d04c98e..b892434 100644 --- a/box.json +++ b/box.json @@ -1,7 +1,7 @@ { "name":"ColdBox Route Visualizer", "author":"Ortus Solutions.com ", - "version":"2.0.0", + "version":"2.2.0", "location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/route-visualizer/@build.version@/route-visualizer-@build.version@.zip", "slug":"route-visualizer", "type":"modules", @@ -22,21 +22,30 @@ "Brad Wood " ], "ignore":[ - "**/.*", + "**/.*", "test-harness", - "/server*.json" + "/server*.json" ], "scripts":{ - "setupTemplate": "task run taskFile=build/SetupTemplate.cfc", - "build:module":"task run taskFile=build/Build.cfc :projectName=`package show slug` :version=`package show version`", - "build:docs":"task run taskFile=build/Build.cfc target=docs :projectName=`package show slug` :version=`package show version`", + "setupTemplate":"task run taskFile=build/SetupTemplate.cfc", + "build:module":"task run taskFile=build/Build.cfc :projectName=`package show slug` :version=`package show version`", + "build:docs":"task run taskFile=build/Build.cfc target=docs :projectName=`package show slug` :version=`package show version`", "install:dependencies":"install && cd test-harness && install", - "release":"recipe build/release.boxr", - "format":"cfformat run handlers,models,test-harness/tests/,ModuleConfig.cfc --overwrite", - "format:watch":"cfformat watch handlers,models,test-harness/tests/,ModuleConfig.cfc ./.cfformat.json", - "format:check":"cfformat check handlers,models,test-harness/tests/,ModuleConfig.cfc ./.cfformat.json" + "release":"recipe build/release.boxr", + "format":"cfformat run helpers,models,test-harness/tests/,ModuleConfig.cfc --overwrite", + "format:watch":"cfformat watch helpers,models,test-harness/tests/,ModuleConfig.cfc ./.cfformat.json", + "format:check":"cfformat check helpers,models,test-harness/tests/,ModuleConfig.cfc ./.cfformat.json", + "start:lucee" : "server start serverConfigFile=server-lucee@5.json", + "start:2018" : "server start serverConfigFile=server-adobe@2018.json", + "start:2021" : "server start serverConfigFile=server-adobe@2021.json", + "stop:lucee" : "server stop serverConfigFile=server-lucee@5.json", + "stop:2018" : "server stop serverConfigFile=server-adobe@2018.json", + "stop:2021" : "server stop serverConfigFile=server-adobe@2021.json", + "logs:lucee" : "server log serverConfigFile=server-lucee@5.json --follow", + "logs:2018" : "server log serverConfigFile=server-adobe@2018.json --follow", + "logs:2021" : "server log serverConfigFile=server-adobe@2021.json --follow" }, - "testbox":{ + "testbox":{ "runner":"http://localhost:60299/tests/runner.cfm" } } diff --git a/build/Build.cfc b/build/Build.cfc index 8e6eb76..b15a671 100644 --- a/build/Build.cfc +++ b/build/Build.cfc @@ -12,6 +12,7 @@ component { variables.cwd = getCWD().reReplace( "\.$", "" ); variables.artifactsDir = cwd & "/.artifacts"; variables.buildDir = cwd & "/.tmp"; + variables.apidDocsDir = variables.buildDir & "/apidocs"; variables.apiDocsURL = "http://localhost:60299/apidocs/"; variables.testRunner = "http://localhost:60299/tests/runner.cfm"; @@ -31,7 +32,8 @@ component { // Cleanup + Init Build Directories [ variables.buildDir, - variables.artifactsDir + variables.artifactsDir, + variables.apidDocsDir ].each( function( item ){ if ( directoryExists( item ) ) { directoryDelete( item, true ); @@ -76,9 +78,6 @@ component { // checksums buildChecksums(); - // Build latest changelog - latestChangelog(); - // Finalize Message print .line() @@ -227,27 +226,6 @@ component { ); } - /** - * Build the latest changelog file: changelog-latest.md - */ - function latestChangelog(){ - print.blueLine( "Building latest changelog..." ).toConsole(); - - if ( !fileExists( variables.cwd & "changelog.md" ) ) { - return error( "Cannot continue building, changelog.md file doesn't exist!" ); - } - - fileWrite( - variables.cwd & "changelog-latest.md", - fileRead( variables.cwd & "changelog.md" ).split( "----" )[ 2 ].trim() & chr( 13 ) & chr( 10 ) - ); - - print - .greenLine( "Latest changelog file created at `changelog-latest.md`" ) - .line() - .line( fileRead( variables.cwd & "changelog-latest.md" ) ); - } - /********************************************* PRIVATE HELPERS *********************************************/ /** diff --git a/build/release.boxr b/build/release.boxr index e216f22..a63f2cc 100755 --- a/build/release.boxr +++ b/build/release.boxr @@ -7,19 +7,8 @@ # Merge development into it for release !git merge --no-ff development -# Tag the master repo with the version from box.json -!git tag v`box package show version` - # Push all branches back out to github !git push origin --all -# Push all tags -!git push origin --tags - # Check development again !git checkout -f development - -# Bump to prepare for a new release, do minor, change if needed and don't tag -bump --minor --!tagVersion -!git commit -a -m "version bump" -!git push origin development \ No newline at end of file diff --git a/changelog.md b/changelog.md index 9b23996..8cc8bf6 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Adobe 2023 Support +- Lucee 6 Support +- More testing coverage + +### Fixed + +- Update all `renderView()` calls to use `view()` instead + +## [2.1.0] + +### Added + +- Named route visualizations +- Bootsrap latest updates +- UI Updates + ## [2.0.0] ### Added diff --git a/layouts/Main.cfm b/layouts/Main.cfm index 820c071..0d07e3a 100644 --- a/layouts/Main.cfm +++ b/layouts/Main.cfm @@ -1,46 +1,62 @@ - - - - - - - - - - - ColdBox Route Visualizer - - - -
- #renderView()# -
- - - - - - - - - -
\ No newline at end of file + + + + + + + + + + + + + + + ColdBox Route Visualizer + + + +
+ #view()# +
+ + + + + + + + + + diff --git a/models/.gitkeep b/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/server-adobe@2023.json b/server-adobe@2023.json new file mode 100644 index 0000000..1991c28 --- /dev/null +++ b/server-adobe@2023.json @@ -0,0 +1,29 @@ +{ + "name":"route-visualizer-adobe@2023", + "app":{ + "serverHomeDirectory":".engine/adobe2023", + "cfengine":"adobe@2023" + }, + "web":{ + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot": "test-harness", + "aliases":{ + "/moduleroot/route-visualizer":"../" + } + }, + "jvm":{ + "heapSize":"1024" + }, + "openBrowser":"false", + "cfconfig": { + "file" : ".cfconfig.json" + }, + "scripts" : { + "onServerInstall":"cfpm install zip,debugger" + } +} diff --git a/server-lucee@6.json b/server-lucee@6.json new file mode 100644 index 0000000..f6e772f --- /dev/null +++ b/server-lucee@6.json @@ -0,0 +1,23 @@ +{ + "name":"route-visualizer-lucee@6", + "app":{ + "serverHomeDirectory":".engine/lucee6", + "cfengine":"lucee@6" + }, + "web":{ + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot":"test-harness", + "aliases":{ + "/moduleroot/route-visualizer":"../" + } + }, + "openBrowser":"false", + "cfconfig":{ + "file":".cfconfig.json" + } +} diff --git a/test-harness/box.json b/test-harness/box.json index b64ca02..f31d92c 100644 --- a/test-harness/box.json +++ b/test-harness/box.json @@ -5,7 +5,7 @@ "private":true, "description":"", "dependencies":{ - "coldbox":"^6.0.0" + "coldbox":"be" }, "devDependencies":{ "testbox":"^4.0.0" diff --git a/test-harness/tests/Application.cfc b/test-harness/tests/Application.cfc index c8a0b7f..4569877 100644 --- a/test-harness/tests/Application.cfc +++ b/test-harness/tests/Application.cfc @@ -1,9 +1,9 @@ /** -* Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp -* www.ortussolutions.com -* --- -*/ -component{ + * Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp + * www.ortussolutions.com + * --- + */ +component { // The name of the module used in cfmappings ,etc request.MODULE_NAME = "route-visualizer"; @@ -11,26 +11,30 @@ component{ request.MODULE_PATH = "route-visualizer"; // APPLICATION CFC PROPERTIES - this.name = "#request.MODULE_NAME# Testing Suite"; - this.sessionManagement = true; - this.sessionTimeout = createTimeSpan( 0, 0, 15, 0 ); - this.applicationTimeout = createTimeSpan( 0, 0, 15, 0 ); - this.setClientCookies = true; + this.name = "#request.MODULE_NAME# Testing Suite"; + this.sessionManagement = true; + this.sessionTimeout = createTimespan( 0, 0, 15, 0 ); + this.applicationTimeout = createTimespan( 0, 0, 15, 0 ); + this.setClientCookies = true; // Turn on/off white space management this.whiteSpaceManagement = "smart"; - this.enableNullSupport = shouldEnableFullNullSupport(); + this.enableNullSupport = shouldEnableFullNullSupport(); // Create testing mapping this.mappings[ "/tests" ] = getDirectoryFromPath( getCurrentTemplatePath() ); // The application root - rootPath = REReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" ); - this.mappings[ "/root" ] = rootPath; + rootPath = reReplaceNoCase( this.mappings[ "/tests" ], "tests(\\|/)", "" ); + this.mappings[ "/root" ] = rootPath; // The module root path - moduleRootPath = REReplaceNoCase( rootPath, "#request.MODULE_PATH#(\\|/)test-harness(\\|/)", "" ); - this.mappings[ "/moduleroot" ] = moduleRootPath; - this.mappings[ "/#request.MODULE_NAME#" ] = moduleRootPath & "#request.MODULE_PATH#"; + moduleRootPath = reReplaceNoCase( + rootPath, + "#request.MODULE_PATH#(\\|/)test-harness(\\|/)", + "" + ); + this.mappings[ "/moduleroot" ] = moduleRootPath; + this.mappings[ "/#request.MODULE_NAME#" ] = moduleRootPath & "#request.MODULE_PATH#"; // ORM Definitions /** @@ -50,11 +54,10 @@ component{ **/ function onRequestStart( required targetPage ){ - // Set a high timeout for long running tests - setting requestTimeout="9999"; + setting requestTimeout ="9999"; // New ColdBox Virtual Application Starter - request.coldBoxVirtualApp = new coldbox.system.testing.VirtualApp( appMapping = "/root" ); + request.coldBoxVirtualApp= new coldbox.system.testing.VirtualApp( appMapping = "/root" ); // If hitting the runner or specs, prep our virtual app if ( getBaseTemplatePath().replace( expandPath( "/tests" ), "" ).reFindNoCase( "(runner|specs)" ) ) { @@ -62,8 +65,8 @@ component{ } // ORM Reload for fresh results - if( structKeyExists( url, "fwreinit" ) ){ - if( structKeyExists( server, "lucee" ) ){ + if ( structKeyExists( url, "fwreinit" ) ) { + if ( structKeyExists( server, "lucee" ) ) { pagePoolClear(); } // ormReload(); @@ -73,13 +76,14 @@ component{ return true; } - public void function onRequestEnd( required targetPage ) { + public void function onRequestEnd( required targetPage ){ request.coldBoxVirtualApp.shutdown(); } - private boolean function shouldEnableFullNullSupport() { - var system = createObject( "java", "java.lang.System" ); - var value = system.getEnv( "FULL_NULL" ); - return isNull( value ) ? false : !!value; - } + private boolean function shouldEnableFullNullSupport(){ + var system = createObject( "java", "java.lang.System" ); + var value = system.getEnv( "FULL_NULL" ); + return isNull( value ) ? false : !!value; + } + } diff --git a/views/home/index.cfm b/views/home/index.cfm index e83ba07..f325c42 100644 --- a/views/home/index.cfm +++ b/views/home/index.cfm @@ -1,14 +1,26 @@ -

ColdBox Route Visualizer

+

+ + ColdBox Route Visualizer +

-

Routes as they are traversed for matching in specific order.

+

+ + Routes as they are traversed for matching in specific order. +

-
- -
+
+ +
-#view( - view = "home/routeTable", - args = { routes = prc.aRoutes, type = "root" } -)# -
+ #view( + view : "home/routeTable", + args : { routes = prc.aRoutes, type = "root" } + )# + diff --git a/views/home/routeTable.cfm b/views/home/routeTable.cfm index 729eb51..c2620d6 100644 --- a/views/home/routeTable.cfm +++ b/views/home/routeTable.cfm @@ -1,139 +1,179 @@ - - - - - - - - - - - - +
orderpattern+regexHTTP Verbsterminatormodulenamespaceactions
+ + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + Redirect: #thisRoute.statusCode ?: ''#: #thisRoute.redirect# + - - - - + + View: #thisRoute.view#
+ No Layout: #thisRoute.viewNoLayout#
+ Layout: #thisRoute.layout# +
- - - - - - + + Simple Response:
+

+							#htmlCodeFormat( thisRoute.response )#
+						
+
- - - - - - + + Lambda Response +
+ Look at the code +
+ + + + - - -
routeverb(s)terminatormoduleactions
- #index++# - class="pattern"> - #thisRoute.pattern#
- Regex: #thisRoute.regexpattern# - - Domain: #thisRoute.domain.len() ? thisRoute.domain : "all"# - -
- - #thisRoute.verbs.len() ? "#thisRoute.verbs#" : "any"# - - any - - - - Handler: #thisRoute.handler#
-
+
class="pattern"> - - Action: #serializeJSON( thisRoute.action )# - - Action: #thisRoute.action.toString()# - +
+ Pattern: #thisRoute.pattern# +
- - Event: #thisRoute.event.toString()# - + +
+ Name: #thisRoute.name# +
+
- - Redirect: #thisRoute.statusCode ?: ''#: #thisRoute.redirect# - + +
+ Domain: + #thisRoute.domain# +
+
+
+ + #thisRoute.verbs# + + any + + + + Handler: #thisRoute.handler#
+
- - View: #thisRoute.view#
- No Layout: #thisRoute.viewNoLayout#
- Layout: #thisRoute.layout# -
+ + Action: #serializeJSON( thisRoute.action )# + + Action: #thisRoute.action.toString()# + - - Simple Response:
-

-						#htmlCodeFormat( thisRoute.response )#
-					
-
+ + Event: #thisRoute.event.toString()# + - - Lambda Response:
- -
-
- #thisRoute.moduleRouting# - -
- -
-
- #thisRoute.namespaceRouting# - -
- -
-
- - Run -
+ +
+ +
+
+
+ + + + +
-
+ + + + +

Route Dump

+ + + + + + + + +
+ +
+

#thisRoute.moduleRouting#

+ #view( + view : "home/routeTable", + args : { routes = prc.aModuleRoutes[ thisRoute.moduleRouting ], type = "module" } + )# + + +
+ + + + + + +

#thisRoute.namespaceRouting#

+ #view( + view : "home/routeTable", + args : { routes = prc.aNamespaceRoutes[ thisRoute.namespaceRouting ], type = "namespace" } + )# + + +
+ + + + +