From 1cb3248a324582441009409cf5b44a9cc9b00210 Mon Sep 17 00:00:00 2001 From: navya9singh <108360753+navya9singh@users.noreply.github.com> Date: Tue, 16 Apr 2024 19:16:53 +0000 Subject: [PATCH] Removing staging code --- .github/workflows/v2-merged-staging.yml | 75 ------------------- README.md | 6 +- docs/Converting Twoslash Code Samples.md | 2 - docs/Something Went Wrong.md | 1 - .../template/CONTRIBUTING.md | 4 +- .../template/scripts/getDTS.js | 2 +- packages/ts-twoslasher/CHANGELOG.md | 2 +- packages/typescriptlang-org/package.json | 1 - .../scripts/createLighthouseJSON.js | 2 +- .../scripts/makeMarkdownForAppInsights.js | 2 +- .../scripts/setupStaging.mjs | 8 -- 11 files changed, 8 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/v2-merged-staging.yml delete mode 100644 packages/typescriptlang-org/scripts/setupStaging.mjs diff --git a/.github/workflows/v2-merged-staging.yml b/.github/workflows/v2-merged-staging.yml deleted file mode 100644 index aa6a078f5347..000000000000 --- a/.github/workflows/v2-merged-staging.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Build Website To Staging - -on: - push: - branches: [v2] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - # Check out, and set up the node/ruby infra - - uses: actions/checkout@v2 - with: - # Fetch the full history, to build attribution.json - fetch-depth: 0 - - uses: actions/setup-node@v2 - with: - node-version: "16.x" - registry-url: "https://registry.npmjs.org/" - cache: yarn - - # For Azure uploads - - run: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - - - name: Prepare website v2 - run: | - yarn install - yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1 - yarn bootstrap - yarn workspace typescriptlang-org setup-playground-cache-bust - yarn workspace typescriptlang-org setup-staging - yarn build - env: - YARN_CHECKSUM_BEHAVIOR: ignore - - - name: Build website v2 - run: | - yarn build-site - cp -r packages/typescriptlang-org/public site - - - name: Deploy + Publish to CDN - # You can find these keys here: - # https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/57bfeeed-c34a-4ffd-a06b-ccff27ac91b8/resourcegroups/typescriptlang-org/providers/Microsoft.Storage/storageAccounts/typescriptorgstaging/keys - env: - AZURE_STORAGE_ACCOUNT: "typescriptorgstaging" - AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CDN_STAGING_CONNECTION_STRING }} - run: az storage blob upload-batch --overwrite -s ./site -d \$web - - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_MEADOW_0C9756810 }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - action: "upload" - app_location: "site" - skip_app_build: true - - # Deploy - - name: Deploy npm Packages - run: | - yarn pleb publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - - - name: Send a message to Microsoft Teams - if: ${{ failure() }} - uses: aliencube/microsoft-teams-actions@v0.8.0 - with: - webhook_uri: ${{ secrets.TEAMS_WEB_BOT_INCOMING_URL }} - title: Staging deploy failed - summary: Could not build the site for staging - actions: '[{ "@type": "OpenUri", "name": "View Logs", "targets": [{ "os": "default", "uri": "https://github.com/microsoft/TypeScript-Website/actions/runs/${{ github.run_id }}?check_suite_focus=true" }] }]' diff --git a/README.md b/README.md index 0f34b32219dc..f6325dfd72ca 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ ### Meta -- **URLs:** [production](https://www.typescriptlang.org), [staging](http://www.staging-typescript.org/) - **Admin:** Prod: [Azure Portal](https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/99160d5b-9289-4b66-8074-ed268e739e8e/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/TypeScript-1ebb3390-2634-4956-a955-eab987b7bb25/appServices), [Deploy logs](https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/99160d5b-9289-4b66-8074-ed268e739e8e/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/TypeScript-1ebb3390-2634-4956-a955-eab987b7bb25/vstscd), [App Insights](https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/57bfeeed-c34a-4ffd-a06b-ccff27ac91b8/resourceGroups/typescriptlang-org/providers/microsoft.insights/components/TypeScriptLang-Prod-Ai/overview) - **Translations:** [microsoft/TypeScript-Website-Localizations](https://github.com/microsoft/TypeScript-Website-Localizations) @@ -33,7 +32,7 @@ Some useful knowledge you need to know: - All packages have: `yarn build` and `yarn test` - All packages use [debug](https://www.npmjs.com/package/debug) - which means you can do `env DEBUG="*" yarn test` to get verbose logs -You can manually via GH Actions for [production here](https://github.com/microsoft/TypeScript-Website/actions?query=workflow%3A%22Monday+Website+Push+To+Production%22) and [staging here](https://github.com/microsoft/TypeScript-Website/actions?query=workflow%3A%22Build+Website+To+Staging%22). +You can manually via GH Actions for [production here](https://github.com/microsoft/TypeScript-Website/actions?query=workflow%3A%22Monday+Website+Push+To+Production%22) Having issues getting set up? [Consult the troubleshooting](./docs/Setup%20Troubleshooting.md). @@ -41,7 +40,6 @@ Having issues getting set up? [Consult the troubleshooting](./docs/Setup%20Troub Deployment is automatic: -- Pushes to the branch `v2` deploy to [staging](http://www.staging-typescript.org) - On a Monday the v2 branch is deployed to [production](https://www.typescriptlang.org) You can find the build logs in [GitHub Actions](https://github.com/microsoft/TypeScript-Website/actions) @@ -103,7 +101,7 @@ yarn workspace tsconfig-reference run lint resolveJson ## Documentation -The docs for TypeScript. Originally ported over from [microsoft/TypeScript-Handbook](https://github.com/microsoft/TypeScript-Handbook/) then intermingled with [microsoft/TypeScript-New-Handbook](https://github.com/microsoft/TypeScript-New-Handbook), and finally updated for [Twoslash](http://www.staging-typescript.org/dev/twoslash/) and with new content. +The docs for TypeScript. Originally ported over from [microsoft/TypeScript-Handbook](https://github.com/microsoft/TypeScript-Handbook/) then intermingled with [microsoft/TypeScript-New-Handbook](https://github.com/microsoft/TypeScript-New-Handbook)and with new content. ## JSON Schema diff --git a/docs/Converting Twoslash Code Samples.md b/docs/Converting Twoslash Code Samples.md index 6e498e58adf2..69f122380ffd 100644 --- a/docs/Converting Twoslash Code Samples.md +++ b/docs/Converting Twoslash Code Samples.md @@ -64,5 +64,3 @@ x = [10, "hello"]; ```` --- - -A twoslash code sample can do _a lot_ - the best documentation for twoslash lives inside the [bug workbench](https://www.staging-typescript.org/dev/bug-workbench) where you can test your code sample live and read how it all works. diff --git a/docs/Something Went Wrong.md b/docs/Something Went Wrong.md index f52232babf03..7c4d15006f27 100644 --- a/docs/Something Went Wrong.md +++ b/docs/Something Went Wrong.md @@ -21,7 +21,6 @@ We're currently running on App Service, the places where you can find info: The build to deploy train normally looks like this: - `v2` branch gets pushed: -- A deploy is made to azure blob storage via [`.github/workflows/v2-merged-staging.yml`](https://github.com/microsoft/TypeScript-website/blob/v2/.github/workflows/v2-merged-staging.yml) - Every Monday, a deploy is made from v2 to the production app via [`.github/workflows/deploy-prod.yml`](https://github.com/microsoft/TypeScript-website/blob/v2/.github/workflows/deploy-prod.yml) You can deploy `v2` to production anytime via the ["Run workflow" button here](https://github.com/microsoft/TypeScript-Website/actions?query=workflow%3A%22Monday+Website+Push+To+Production%22), so if you have an emergency commit - it goes to `v2` then you can run the action. diff --git a/packages/create-typescript-playground-plugin/template/CONTRIBUTING.md b/packages/create-typescript-playground-plugin/template/CONTRIBUTING.md index d2ebf211a628..91f21752b84e 100644 --- a/packages/create-typescript-playground-plugin/template/CONTRIBUTING.md +++ b/packages/create-typescript-playground-plugin/template/CONTRIBUTING.md @@ -45,7 +45,7 @@ The route to handle this is via rollup: ## Deployment -This module should be deployed to npm when you would like the world to see it, this may mean making your code handle a staging vs production environment (because the URLs will be different.) +This module should be deployed to npm when you would like the world to see it, this may mean making your code handle a production environment (because the URLs will be different.) For example, this is how you can handle getting the URL for a CSS file which is included in your `dist` folder: @@ -57,7 +57,7 @@ const cssHref = isDev ? "http://localhost:5000/slideshow.css" : unpkgURL ### Post-Deploy -Once this is deployed, you can test it on the TypeScript playground by passing in the name of your plugin on npm to the custom plugin box. This is effectively your staging environment. +Once this is deployed, you can test it on the TypeScript playground by passing in the name of your plugin on npm to the custom plugin box. Once you're happy and it's polished, you can apply to have it in the default plugin list. diff --git a/packages/create-typescript-playground-plugin/template/scripts/getDTS.js b/packages/create-typescript-playground-plugin/template/scripts/getDTS.js index cb88fffcc13f..92d8696a9336 100644 --- a/packages/create-typescript-playground-plugin/template/scripts/getDTS.js +++ b/packages/create-typescript-playground-plugin/template/scripts/getDTS.js @@ -22,7 +22,7 @@ const go = async () => { if (!existsSync(vendor)) mkdirSync(vendor) if (!existsSync(ds)) mkdirSync(ds) - const host = "https://www.staging-typescript.org" + const host = "https://www.typescriptlang.org" // For playground-dev purposes // const host = "http://localhost:8000"; diff --git a/packages/ts-twoslasher/CHANGELOG.md b/packages/ts-twoslasher/CHANGELOG.md index a9dac0c4f939..f6711c19938a 100644 --- a/packages/ts-twoslasher/CHANGELOG.md +++ b/packages/ts-twoslasher/CHANGELOG.md @@ -107,7 +107,7 @@ const b = "345" ``` Now returns correct query responses, I needed this for the bug workbench. -http://www.staging-typescript.org/dev/bug-workbench +https://www.typescriptlang.org/dev/bug-workbench Also has a way to set the defaults for the config diff --git a/packages/typescriptlang-org/package.json b/packages/typescriptlang-org/package.json index 43700ff4f957..5d8170e5a356 100644 --- a/packages/typescriptlang-org/package.json +++ b/packages/typescriptlang-org/package.json @@ -11,7 +11,6 @@ "update-static-assets": "node scripts/downloadSearchAssets.js", "update-versions": "node scripts/getTypeScriptNPMVersions.js", "setup-playground-cache-bust": "node scripts/cacheBustPlayground.mjs", - "setup-staging": "node scripts/setupStaging.mjs", "create-lighthouse-json": "node scripts/createLighthouseJSON.js", "compile-index-examples": "twoslash --reactAlso src/components/index/twoslash/*.ts src/components/index/twoslash/*.js src/components/index/twoslash/*.tsx src/components/index/twoslash/generated && node scripts/updateIndexTwoslashExamples.js", "start": "gatsby develop", diff --git a/packages/typescriptlang-org/scripts/createLighthouseJSON.js b/packages/typescriptlang-org/scripts/createLighthouseJSON.js index a340d154dc71..ea54dfb8b8b5 100644 --- a/packages/typescriptlang-org/scripts/createLighthouseJSON.js +++ b/packages/typescriptlang-org/scripts/createLighthouseJSON.js @@ -4,7 +4,7 @@ const { join } = require("path") const parser = require("xml-js") const prRoot = - process.env.PR_DEPLOY_URL_ROOT || "https://www.staging-typescript.org/" + process.env.PR_DEPLOY_URL_ROOT || "https://www.typescriptlang.org/" const go = async () => { const sitemap = `${prRoot}/sitemap.xml` diff --git a/packages/typescriptlang-org/scripts/makeMarkdownForAppInsights.js b/packages/typescriptlang-org/scripts/makeMarkdownForAppInsights.js index b9b639ebc910..ca1b0d56f5d7 100644 --- a/packages/typescriptlang-org/scripts/makeMarkdownForAppInsights.js +++ b/packages/typescriptlang-org/scripts/makeMarkdownForAppInsights.js @@ -40,7 +40,7 @@ const makeAToSitePath = path => `${path}` const makeAToPlaygroundSample = path => - `${path}` + `${path}` const makeAnchorAsNPMModule = path => `${path}` diff --git a/packages/typescriptlang-org/scripts/setupStaging.mjs b/packages/typescriptlang-org/scripts/setupStaging.mjs deleted file mode 100644 index 0f708eb8cfdb..000000000000 --- a/packages/typescriptlang-org/scripts/setupStaging.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import fs from "fs" - -const toChange = "src/components/HeadSEO.tsx" -const content = fs - .readFileSync(toChange, "utf8") - .replace("const staging = false", "const staging = true") - -fs.writeFileSync(toChange, content)