diff --git a/.github/workflows/publish-workflow-ui.yml b/.github/workflows/publish-workflow-ui.yml deleted file mode 100644 index fc4778167..000000000 --- a/.github/workflows/publish-workflow-ui.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish Workflow UI -on: - workflow_dispatch: - push: - branches: - - main - paths: - - site/plugins.json - pull_request: - types: [opened, synchronize, reopened] - branches-ignore: - - 'publish_workflow_ui_**' -jobs: - sync-to-repo: - runs-on: ubuntu-latest - steps: - - name: Git checkout - uses: actions/checkout@v3 - - name: Using Node.js - uses: actions/setup-node@v3 - with: - node-version: '*' - cache: 'npm' - check-latest: true - - name: Install dependencies - run: npm install - - name: Setup git config - run: | - git config user.name 'token-generator-app[bot]' - git config user.email '82042599+token-generator-app[bot]@users.noreply.github.com' - - name: Generate GitHub token - uses: navikt/github-app-token-generator@v1.2.1 - id: get-token - with: - private-key: ${{ secrets.TOKENS_PRIVATE_KEY }} - app-id: ${{ secrets.TOKENS_APP_ID }} - - name: Upload Workflow UI files - env: - GITHUB_TOKEN: ${{ steps.get-token.outputs.token }} - run: bin/publish_workflow_ui.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index decf2c8e3..9bd7b9297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [6.78.1](https://github.com/netlify/plugins/compare/v6.78.0...v6.78.1) (2024-05-17) + + +### Bug Fixes + +* update Angular runtime to 2.0.7 ([#1340](https://github.com/netlify/plugins/issues/1340)) ([e8100ba](https://github.com/netlify/plugins/commit/e8100badc8f9cc7a22807776f4742982ac4919ac)) +* update Next.js flagged version to 5.2.2 ([#1335](https://github.com/netlify/plugins/issues/1335)) ([0b53aa7](https://github.com/netlify/plugins/commit/0b53aa78282f7966f93d8ab9b3fdf12805ddb182)) +* **wfui cleanup:** cleanup workflow-ui workflows ([#1341](https://github.com/netlify/plugins/issues/1341)) ([6aad2d4](https://github.com/netlify/plugins/commit/6aad2d4332748c2f3fa7fed0daf42c5a4d671560)) + ## [6.78.0](https://github.com/netlify/plugins/compare/v6.77.0...v6.78.0) (2024-05-03) diff --git a/bin/combined_workflow_files.ts b/bin/combined_workflow_files.ts deleted file mode 100644 index 0735131f8..000000000 --- a/bin/combined_workflow_files.ts +++ /dev/null @@ -1,78 +0,0 @@ - -/* eslint-disable n/no-sync */ -import fs from 'fs' -import path from 'path' - -interface Surface { - surfaceName: string - surfaceScripts: string[] - basePath: string -} - -interface Workflow { - package: string - packageId?: string - surfaces: Surface[] -} - -const getFiles = async function* (dir: string): AsyncGenerator { - const dirents = await fs.promises.readdir(dir, { withFileTypes: true }); - for (const dirent of dirents) { - const res = path.resolve(dir, dirent.name); - if (dirent.isDirectory()) { - yield* getFiles(res); - } else { - yield res; - } - } -} - -// read all workflow-ui.json files from `site/**/workflow-ui.json` -const workflowFiles = []; -for await (const file of getFiles('site')) { - const normalizedFileName = file?.toLowerCase() || ''; - if (normalizedFileName.endsWith('/workflow-ui.json')){ - workflowFiles.push(file); - } -} - -const workflows = workflowFiles.map((file) => { - const content = fs.readFileSync(file) - return JSON.parse(content.toString()) as Workflow -}) - - -console.log(`processing ${workflows.length} workflows - ${workflows.map((workflow) => workflow.package).join(', ')}`) - -const surfaces = workflows.reduce>((acc, workflow) => { - const newAcc = { ...acc } - workflow.surfaces.forEach((surface) => { - const filteredWorkflow = { - ...workflow, - surfaces: workflow.surfaces.filter(({ surfaceName }) => surfaceName === surface.surfaceName), - } - - newAcc[surface.surfaceName] = [...(acc[surface.surfaceName] ?? []), filteredWorkflow] - }) - - return newAcc -}, {}) - -Object.entries(surfaces).forEach(([surfaceName, surfaceWorkflows]) => { - const surfaceRoot = `site/surfaces/${surfaceName}` - if (!fs.existsSync(surfaceRoot)) { - fs.mkdirSync(surfaceRoot, { recursive: true }) - } - - fs.writeFileSync(`${surfaceRoot}/index.json`, JSON.stringify(surfaceWorkflows, null, 2)) - - surfaceWorkflows.forEach((surfaceWorkflow) => { - const normalizedPackage = (surfaceWorkflow.packageId || surfaceWorkflow.package).toLowerCase() - - const surfacePackageRoot = `${surfaceRoot}/${normalizedPackage}` - if (!fs.existsSync(surfacePackageRoot)) { - fs.mkdirSync(surfacePackageRoot, { recursive: true }) - } - fs.writeFileSync(`${surfacePackageRoot}/index.json`, JSON.stringify(surfaceWorkflow, null, 2)) - }) -}) diff --git a/bin/publish_workflow_ui.sh b/bin/publish_workflow_ui.sh deleted file mode 100755 index a94ca2b6b..000000000 --- a/bin/publish_workflow_ui.sh +++ /dev/null @@ -1,55 +0,0 @@ -PR_TITLE="chore: publish workflow-ui files" -BRANCH_NAME="publish_workflow_ui_$(date +%s)" - -git switch -c $BRANCH_NAME - -# install jq -sudo apt-get install jq - -# Loop through each package, install from npm and copy the workflow-ui.json from root of the package if it exists -cat site/plugins.json | jq ".[] | select(.workflow == true) | .package" | while read PACKAGE -do - PACKAGE=$(echo $PACKAGE | tr -d '"') - echo "Downloading workflow-ui for $PACKAGE" - npm pack $PACKAGE - tar -xzf *.tgz - - if [ -f package/workflow-ui.json ]; then - echo "Copying workflow-ui.json for $PACKAGE" - - PACKAGE_ID=$(cat package/workflow-ui.json | jq -r ".packageId // .package") - DEST="site/$PACKAGE_ID" - - mkdir -p $DEST - cp package/workflow-ui.json $DEST/workflow-ui.json - - cat $DEST/workflow-ui.json | jq ".surfaces | .[] | .surfaceScripts | .[]?" | while read SCRIPT - do - # strip quotes and leading ./ from script path - SCRIPT=$(echo $SCRIPT | tr -d '"' | sed 's/^\.\///') - echo "Copying $SCRIPT for $PACKAGE" - cp package/$SCRIPT $DEST/$SCRIPT - done - - ls $DEST - fi - - - rm -rf ./package -done - -npx tsx bin/combined_workflow_files.ts - -# Add all files to git in the site directory -git add site - -# See if we have any changes. We should. We should only push on main branch -if [[ -n "$(git status --porcelain)" && "$GITHUB_REF_NAME" == "main" ]]; then - echo "Creating PR \"$PR_TITLE\" for branch $BRANCH_NAME" - git commit -m "$PR_TITLE" - git push origin $BRANCH_NAME - gh pr create --title "$PR_TITLE" --body "This is an automated PR to publish workflow-ui" --label "workflow_ui" --label "automerge" -else - # Shouldn't end up here, but log that there was nothing to sync - echo "Skipping PR." -fi diff --git a/netlify.toml b/netlify.toml index 4c4a773d7..392a8cbc6 100644 --- a/netlify.toml +++ b/netlify.toml @@ -6,18 +6,3 @@ for = "/plugins.json" [headers.values] Access-Control-Allow-Origin = "*" - -[[redirects]] - from = "/workflow-ui/surfaces/:surface/" - to = "/surfaces/:surface/index.json" - status = 200 - -[[redirects]] - from = "/workflow-ui/surfaces/:surface/*" - to = "/surfaces/:surface/:splat/index.json" - status = 200 - -[[redirects]] - from = "/workflow-ui/package/:package/*" - to = "/:package/:splat" - status = 200 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c9e88f0dc..e60286f85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@netlify/plugins-list", - "version": "6.78.0", + "version": "6.78.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@netlify/plugins-list", - "version": "6.78.0", + "version": "6.78.1", "license": "MIT", "devDependencies": { "@netlify/eslint-config-node": "^7.0.1", @@ -4051,15 +4051,15 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "dev": true, "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/eastasianwidth": { @@ -10153,13 +10153,10 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -14403,9 +14400,9 @@ } }, "dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "dev": true }, "eastasianwidth": { @@ -18884,13 +18881,10 @@ "dev": true }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true }, "serialize-error": { "version": "7.0.1", diff --git a/package.json b/package.json index 12bdc8cb6..e7c5b864d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netlify/plugins-list", - "version": "6.78.0", + "version": "6.78.1", "description": "List of Netlify plugins", "type": "module", "exports": "./index.js", diff --git a/site/feature-pilot/site-settings.js b/site/feature-pilot/site-settings.js deleted file mode 100644 index d4ae64a21..000000000 --- a/site/feature-pilot/site-settings.js +++ /dev/null @@ -1,10 +0,0 @@ -console.log('surface script is running') - -/* eslint-disable no-console, no-undef */ -netlifyContext.on('WFUI_SAVE', async (uiState) => { - console.log('save called') -}); - -netlifyContext.on('WFUI_LOAD', async (uiState) => { - console.log('load called') -}); diff --git a/site/feature-pilot/workflow-ui.json b/site/feature-pilot/workflow-ui.json deleted file mode 100644 index 195df08fd..000000000 --- a/site/feature-pilot/workflow-ui.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "package": "@netlify/feature-package-pilot", - "packageId": "feature-pilot", - "packageName": "", - "friendlyName": "WorkflowUI Pilot", - "surfaces": [ - { - "surfaceName": "site-settings", - "surfaceScripts": ["site-settings.js"], - "routes": { - "/": [ - { - "type": "section", - "title": "Overview", - "description": "General information about your emails integration", - "display": "hidden", - "if": { - "truthy": "$PKG.enabled", - "then": { - "display": "visible" - } - }, - "contents": [ - { - "type": "form", - "title": "Email Integration configuration", - "contents": [ - { - "type": "select", - "label": "Emails provider", - "id": "NETLIFY_EMAILS_PROVIDER", - "required": true, - "value": [ - { - "label": "Postmark", - "value": "postmark" - }, - { - "label": "SendGrid", - "value": "sendgrid" - }, - { - "label": "Mailgun", - "value": "mailgun" - } - ] - }, - { - "type": "input-password", - "label": "Emails provider API key", - "id": "NETLIFY_EMAILS_PROVIDER_API_KEY", - "required": true - }, - { - "type": "input-text", - "label": "Mailgun domain", - "id": "NETLIFY_EMAILS_MAILGUN_DOMAIN", - "required": false, - "display": "hidden", - "if": { - "equals": [ - "$EL.NETLIFY_EMAILS_PROVIDER", - "mailgun" - ], - "then": { - "display": "visible", - "required": true - } - } - }, - { - "type": "select", - "label": "Mailgun host region", - "id": "NETLIFY_EMAILS_MAILGUN_HOST_REGION", - "required": false, - "value": [ - { - "label": "US", - "value": "US" - }, - { - "label": "EU", - "value": "EU" - } - ], - "display": "hidden", - "if": { - "equals": [ - "$EL.NETLIFY_EMAILS_PROVIDER", - "mailgun" - ], - "then": { - "display": "visible", - "required": true - } - } - }, - { - "type": "input-text", - "label": "Emails directory", - "id": "NETLIFY_EMAILS_DIRECTORY", - "required": true, - "value": "./emails" - }, - { - "type": "text", - "value": "" - } - ] - } - ] - - }, - { - "type": "enablement", - "title": "Pilot", - "description": "Manage sending emails and editing templates - all without rolling your own email service\\n\\nWithin a few clicks, enable emails on your web application by choosing your preferred email provider and configuring your settings.\\n\\n", - "illustration": "/6625c10d771150915a28.svg", - "if": { - "truthy": "$PKG.enabled", - "then": { - "description": "Disabling emails will stop emails handlers from working on any subsequent deployments. All configuration values will be lost." - } - } - } - ] - } - } - ] -} \ No newline at end of file diff --git a/site/plugins.json b/site/plugins.json index b723c2f8f..57485102f 100644 --- a/site/plugins.json +++ b/site/plugins.json @@ -618,7 +618,7 @@ "version": "4.41.3", "compatibility": [ { - "version": "5.2.1", + "version": "5.2.2", "featureFlag": "project_ceruledge_ui", "overridePinnedVersion": ">=4.0.0", "nodeVersion": ">=18.0.0", @@ -670,7 +670,7 @@ "name": "Angular Runtime", "package": "@netlify/angular-runtime", "repo": "https://github.com/netlify/angular-runtime", - "version": "2.0.6" + "version": "2.0.7" }, { "author": "netlify", diff --git a/site/surfaces/site-settings/feature-pilot/index.json b/site/surfaces/site-settings/feature-pilot/index.json deleted file mode 100644 index a57c7c60a..000000000 --- a/site/surfaces/site-settings/feature-pilot/index.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "package": "@netlify/feature-package-pilot", - "packageId": "feature-pilot", - "packageName": "", - "friendlyName": "WorkflowUI Pilot", - "surfaces": [ - { - "surfaceName": "site-settings", - "surfaceScripts": [ - "site-settings.js" - ], - "routes": { - "/": [ - { - "type": "section", - "title": "Overview", - "description": "General information about your emails integration", - "display": "hidden", - "if": { - "truthy": "$PKG.enabled", - "then": { - "display": "visible" - } - }, - "contents": [ - { - "type": "form", - "title": "Email Integration configuration", - "contents": [ - { - "type": "select", - "label": "Emails provider", - "id": "NETLIFY_EMAILS_PROVIDER", - "required": true, - "value": [ - { - "label": "Postmark", - "value": "postmark" - }, - { - "label": "SendGrid", - "value": "sendgrid" - }, - { - "label": "Mailgun", - "value": "mailgun" - } - ] - }, - { - "type": "input-password", - "label": "Emails provider API key", - "id": "NETLIFY_EMAILS_PROVIDER_API_KEY", - "required": true - }, - { - "type": "input-text", - "label": "Mailgun domain", - "id": "NETLIFY_EMAILS_MAILGUN_DOMAIN", - "required": false, - "display": "hidden", - "if": { - "equals": [ - "$EL.NETLIFY_EMAILS_PROVIDER", - "mailgun" - ], - "then": { - "display": "visible", - "required": true - } - } - }, - { - "type": "select", - "label": "Mailgun host region", - "id": "NETLIFY_EMAILS_MAILGUN_HOST_REGION", - "required": false, - "value": [ - { - "label": "US", - "value": "US" - }, - { - "label": "EU", - "value": "EU" - } - ], - "display": "hidden", - "if": { - "equals": [ - "$EL.NETLIFY_EMAILS_PROVIDER", - "mailgun" - ], - "then": { - "display": "visible", - "required": true - } - } - }, - { - "type": "input-text", - "label": "Emails directory", - "id": "NETLIFY_EMAILS_DIRECTORY", - "required": true, - "value": "./emails" - }, - { - "type": "text", - "value": "" - } - ] - } - ] - }, - { - "type": "enablement", - "title": "Pilot", - "description": "Manage sending emails and editing templates - all without rolling your own email service\\n\\nWithin a few clicks, enable emails on your web application by choosing your preferred email provider and configuring your settings.\\n\\n", - "illustration": "/6625c10d771150915a28.svg", - "if": { - "truthy": "$PKG.enabled", - "then": { - "description": "Disabling emails will stop emails handlers from working on any subsequent deployments. All configuration values will be lost." - } - } - } - ] - } - } - ] -} \ No newline at end of file diff --git a/site/surfaces/site-settings/index.json b/site/surfaces/site-settings/index.json deleted file mode 100644 index 5c70e9818..000000000 --- a/site/surfaces/site-settings/index.json +++ /dev/null @@ -1,133 +0,0 @@ -[ - { - "package": "@netlify/feature-package-pilot", - "packageId": "feature-pilot", - "packageName": "", - "friendlyName": "WorkflowUI Pilot", - "surfaces": [ - { - "surfaceName": "site-settings", - "surfaceScripts": [ - "site-settings.js" - ], - "routes": { - "/": [ - { - "type": "section", - "title": "Overview", - "description": "General information about your emails integration", - "display": "hidden", - "if": { - "truthy": "$PKG.enabled", - "then": { - "display": "visible" - } - }, - "contents": [ - { - "type": "form", - "title": "Email Integration configuration", - "contents": [ - { - "type": "select", - "label": "Emails provider", - "id": "NETLIFY_EMAILS_PROVIDER", - "required": true, - "value": [ - { - "label": "Postmark", - "value": "postmark" - }, - { - "label": "SendGrid", - "value": "sendgrid" - }, - { - "label": "Mailgun", - "value": "mailgun" - } - ] - }, - { - "type": "input-password", - "label": "Emails provider API key", - "id": "NETLIFY_EMAILS_PROVIDER_API_KEY", - "required": true - }, - { - "type": "input-text", - "label": "Mailgun domain", - "id": "NETLIFY_EMAILS_MAILGUN_DOMAIN", - "required": false, - "display": "hidden", - "if": { - "equals": [ - "$EL.NETLIFY_EMAILS_PROVIDER", - "mailgun" - ], - "then": { - "display": "visible", - "required": true - } - } - }, - { - "type": "select", - "label": "Mailgun host region", - "id": "NETLIFY_EMAILS_MAILGUN_HOST_REGION", - "required": false, - "value": [ - { - "label": "US", - "value": "US" - }, - { - "label": "EU", - "value": "EU" - } - ], - "display": "hidden", - "if": { - "equals": [ - "$EL.NETLIFY_EMAILS_PROVIDER", - "mailgun" - ], - "then": { - "display": "visible", - "required": true - } - } - }, - { - "type": "input-text", - "label": "Emails directory", - "id": "NETLIFY_EMAILS_DIRECTORY", - "required": true, - "value": "./emails" - }, - { - "type": "text", - "value": "" - } - ] - } - ] - }, - { - "type": "enablement", - "title": "Pilot", - "description": "Manage sending emails and editing templates - all without rolling your own email service\\n\\nWithin a few clicks, enable emails on your web application by choosing your preferred email provider and configuring your settings.\\n\\n", - "illustration": "/6625c10d771150915a28.svg", - "if": { - "truthy": "$PKG.enabled", - "then": { - "description": "Disabling emails will stop emails handlers from working on any subsequent deployments. All configuration values will be lost." - } - } - } - ] - } - } - ] - } -] \ No newline at end of file diff --git a/test/main.js b/test/main.js index 715ef6968..22431ae76 100644 --- a/test/main.js +++ b/test/main.js @@ -59,7 +59,7 @@ const getMajorVersion = function (version) { /* eslint-disable max-nested-callbacks */ // eslint-disable-next-line max-lines-per-function, max-statements pluginsList.forEach((plugin) => { - const { package: packageName, repo, version, name, compatibility, variables, workflow, status } = plugin + const { package: packageName, repo, version, name, compatibility, variables, status } = plugin Object.entries(plugin).forEach(([attribute, value]) => { test(`Plugin attribute "${attribute}" should have a proper shape: ${packageName}`, (t) => { @@ -110,12 +110,6 @@ pluginsList.forEach((plugin) => { }) } - if (workflow !== undefined) { - test(`Plugin Workflow should be a boolean`, (t) => { - t.true(typeof workflow === 'boolean') - }) - } - if (compatibility === undefined) { return }