├── .editorconfig ├── .ember-cli ├── .eslintignore ├── .eslintrc.js ├── .github └── workflows │ ├── ci.yml │ ├── plan-release.yml │ └── publish.yml ├── .gitignore ├── .npmignore ├── .prettierignore ├── .prettierrc.js ├── .release-plan.json ├── .stylelintignore ├── .stylelintrc.js ├── .template-lintrc.js ├── .watchmanconfig ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── RELEASE.md ├── addon └── index.js ├── ember-cli-build.js ├── index.d.ts ├── index.js ├── package.json ├── pnpm-lock.yaml ├── testem.js ├── tests ├── acceptance │ ├── flush-deprecations-test.js │ └── workflow-config-test.js ├── dummy │ ├── app │ │ ├── app.js │ │ ├── components │ │ │ └── .gitkeep │ │ ├── controllers │ │ │ └── .gitkeep │ │ ├── deprecation-workflow.js │ │ ├── helpers │ │ │ └── .gitkeep │ │ ├── index.html │ │ ├── models │ │ │ └── .gitkeep │ │ ├── router.js │ │ ├── routes │ │ │ └── .gitkeep │ │ ├── styles │ │ │ └── app.css │ │ └── templates │ │ │ └── application.hbs │ ├── config │ │ ├── ember-cli-update.json │ │ ├── ember-try.js │ │ ├── environment.js │ │ ├── optional-features.json │ │ └── targets.js │ └── public │ │ └── robots.txt ├── helpers │ ├── debug-test.js │ └── index.js ├── index.html ├── test-helper.js └── unit │ ├── .gitkeep │ ├── deprecation-collector-test.js │ ├── flush-deprecations-test.js │ └── handle-deprecation-workflow-test.js ├── tsconfig.declarations.json └── vendor └── ember-cli-deprecation-workflow └── main.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.hbs] 16 | insert_final_newline = false 17 | 18 | [*.{diff,md}] 19 | trim_trailing_whitespace = false 20 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript 4 | rather than JavaScript by default, when a TypeScript version of a given blueprint is available. 5 | */ 6 | "isTypeScriptProject": false 7 | } 8 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | 4 | # compiled output 5 | /dist/ 6 | 7 | # misc 8 | /coverage/ 9 | !.* 10 | .*/ 11 | 12 | # ember-try 13 | /.node_modules.ember-try/ 14 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | root: true, 5 | parser: '@babel/eslint-parser', 6 | parserOptions: { 7 | ecmaVersion: 'latest', 8 | sourceType: 'module', 9 | requireConfigFile: false, 10 | babelOptions: { 11 | plugins: [ 12 | ['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }], 13 | ], 14 | }, 15 | }, 16 | plugins: ['ember'], 17 | extends: [ 18 | 'eslint:recommended', 19 | 'plugin:ember/recommended', 20 | 'plugin:prettier/recommended', 21 | ], 22 | env: { 23 | browser: true, 24 | }, 25 | rules: {}, 26 | overrides: [ 27 | // node files 28 | { 29 | files: [ 30 | './.eslintrc.js', 31 | './.prettierrc.js', 32 | './.stylelintrc.js', 33 | './.template-lintrc.js', 34 | './ember-cli-build.js', 35 | 'generate-deprecations-tree.js', 36 | './index.js', 37 | './testem.js', 38 | './blueprints/*/index.js', 39 | './config/**/*.js', 40 | './tests/dummy/config/**/*.js', 41 | ], 42 | excludedFiles: [ 43 | 'addon/**', 44 | 'addon-test-support/**', 45 | 'app/**', 46 | 'tests/dummy/app/**', 47 | ], 48 | parserOptions: { 49 | sourceType: 'script', 50 | }, 51 | env: { 52 | browser: false, 53 | node: true, 54 | }, 55 | plugins: ['n'], 56 | extends: ['plugin:n/recommended'], 57 | rules: { 58 | 'ember/new-module-imports': 0, 59 | }, 60 | }, 61 | { 62 | // test files 63 | files: ['tests/**/*-test.{js,ts}'], 64 | extends: ['plugin:qunit/recommended'], 65 | }, 66 | ], 67 | }; 68 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | pull_request: {} 9 | 10 | concurrency: 11 | group: ci-${{ github.head_ref || github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | test: 16 | name: "Tests" 17 | runs-on: ubuntu-latest 18 | timeout-minutes: 8 19 | 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v4 23 | - uses: pnpm/action-setup@v3 24 | with: 25 | version: 8 26 | - name: Install Node 27 | uses: actions/setup-node@v4 28 | with: 29 | node-version: 16 30 | cache: pnpm 31 | - name: Install Dependencies 32 | run: pnpm i --frozen-lockfile 33 | - name: Lint 34 | run: npm run lint 35 | - name: Run Tests 36 | run: pnpm ember test 37 | 38 | floating: 39 | name: "Floating Dependencies" 40 | runs-on: ubuntu-latest 41 | timeout-minutes: 8 42 | 43 | steps: 44 | - uses: actions/checkout@v4 45 | - uses: pnpm/action-setup@v3 46 | with: 47 | version: 8 48 | - name: Install Node 49 | uses: actions/setup-node@v4 50 | with: 51 | node-version: 16 52 | cache: pnpm 53 | - name: Install Dependencies 54 | run: pnpm install --no-lockfile 55 | - name: Run Tests 56 | run: CI=true pnpm ember test 57 | 58 | try-scenarios: 59 | name: ${{ matrix.try-scenario }} 60 | runs-on: ubuntu-latest 61 | timeout-minutes: 8 62 | 63 | strategy: 64 | fail-fast: false 65 | matrix: 66 | try-scenario: 67 | [ 68 | ember-lts-3.28, 69 | ember-lts-4.4, 70 | ember-lts-4.8, 71 | ember-lts-4.12, 72 | ember-lts-5.4, 73 | ember-release, 74 | ember-beta, 75 | ember-canary, 76 | ember-3.28-with-jquery, 77 | ember-3.28-classic, 78 | ] 79 | include: 80 | - ember-try-scenario: ember-canary 81 | allow-failure: true 82 | 83 | steps: 84 | - name: Checkout 85 | uses: actions/checkout@v4 86 | - uses: pnpm/action-setup@v3 87 | with: 88 | version: 8 89 | - name: Install Node 90 | uses: actions/setup-node@v4 91 | with: 92 | node-version: 16 93 | cache: pnpm 94 | - name: Install Dependencies 95 | run: pnpm i --frozen-lockfile 96 | - name: Ember-Try Setup 97 | run: pnpm ember try:one ${{ matrix.try-scenario }} 98 | -------------------------------------------------------------------------------- /.github/workflows/plan-release.yml: -------------------------------------------------------------------------------- 1 | name: Release Plan Review 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - master 7 | pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ 8 | types: 9 | - labeled 10 | - unlabeled 11 | 12 | concurrency: 13 | group: plan-release # only the latest one of these should ever be running 14 | cancel-in-progress: true 15 | 16 | jobs: 17 | check-plan: 18 | name: "Check Release Plan" 19 | runs-on: ubuntu-latest 20 | outputs: 21 | command: ${{ steps.check-release.outputs.command }} 22 | 23 | steps: 24 | - uses: actions/checkout@v4 25 | with: 26 | fetch-depth: 0 27 | ref: 'main' 28 | # This will only cause the `check-plan` job to have a "command" of `release` 29 | # when the .release-plan.json file was changed on the last commit. 30 | - id: check-release 31 | run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT 32 | 33 | prepare_release_notes: 34 | name: Prepare Release Notes 35 | runs-on: ubuntu-latest 36 | timeout-minutes: 5 37 | needs: check-plan 38 | permissions: 39 | contents: write 40 | pull-requests: write 41 | outputs: 42 | explanation: ${{ steps.explanation.outputs.text }} 43 | # only run on push event if plan wasn't updated (don't create a release plan when we're releasing) 44 | # only run on labeled event if the PR has already been merged 45 | if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true) 46 | 47 | steps: 48 | - uses: actions/checkout@v4 49 | # We need to download lots of history so that 50 | # github-changelog can discover what's changed since the last release 51 | with: 52 | fetch-depth: 0 53 | ref: 'main' 54 | - uses: actions/setup-node@v4 55 | with: 56 | node-version: 18 57 | 58 | - uses: pnpm/action-setup@v3 59 | with: 60 | version: 8 61 | - run: pnpm install --frozen-lockfile 62 | 63 | - name: "Generate Explanation and Prep Changelogs" 64 | id: explanation 65 | run: | 66 | set +e 67 | 68 | pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2) 69 | 70 | 71 | if [ $? -ne 0 ]; then 72 | echo 'text<> $GITHUB_OUTPUT 73 | cat release-plan-stderr.txt >> $GITHUB_OUTPUT 74 | echo 'EOF' >> $GITHUB_OUTPUT 75 | else 76 | echo 'text<> $GITHUB_OUTPUT 77 | jq .description .release-plan.json -r >> $GITHUB_OUTPUT 78 | echo 'EOF' >> $GITHUB_OUTPUT 79 | rm release-plan-stderr.txt 80 | fi 81 | env: 82 | GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }} 83 | 84 | - uses: peter-evans/create-pull-request@v6 85 | with: 86 | commit-message: "Prepare Release using 'release-plan'" 87 | labels: "internal" 88 | branch: release-preview 89 | title: Prepare Release 90 | body: | 91 | This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍 92 | 93 | ----------------------------------------- 94 | 95 | ${{ steps.explanation.outputs.text }} 96 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | # For every push to the master branch, this checks if the release-plan was 2 | # updated and if it was it will publish stable npm packages based on the 3 | # release plan 4 | 5 | name: Publish Stable 6 | 7 | on: 8 | workflow_dispatch: 9 | push: 10 | branches: 11 | - main 12 | - master 13 | 14 | concurrency: 15 | group: publish-${{ github.head_ref || github.ref }} 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | check-plan: 20 | name: "Check Release Plan" 21 | runs-on: ubuntu-latest 22 | outputs: 23 | command: ${{ steps.check-release.outputs.command }} 24 | 25 | steps: 26 | - uses: actions/checkout@v4 27 | with: 28 | fetch-depth: 0 29 | ref: 'main' 30 | # This will only cause the `check-plan` job to have a result of `success` 31 | # when the .release-plan.json file was changed on the last commit. This 32 | # plus the fact that this action only runs on main will be enough of a guard 33 | - id: check-release 34 | run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT 35 | 36 | publish: 37 | name: "NPM Publish" 38 | runs-on: ubuntu-latest 39 | needs: check-plan 40 | if: needs.check-plan.outputs.command == 'release' 41 | permissions: 42 | contents: write 43 | pull-requests: write 44 | 45 | steps: 46 | - uses: actions/checkout@v4 47 | - uses: actions/setup-node@v4 48 | with: 49 | node-version: 18 50 | # This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable 51 | registry-url: 'https://registry.npmjs.org' 52 | 53 | - uses: pnpm/action-setup@v3 54 | with: 55 | version: 8 56 | - run: pnpm install --frozen-lockfile 57 | - name: npm publish 58 | run: pnpm release-plan publish 59 | 60 | env: 61 | GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }} 62 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist/ 3 | /declarations/ 4 | 5 | # dependencies 6 | /node_modules/ 7 | 8 | # misc 9 | /.env* 10 | /.pnp* 11 | /.eslintcache 12 | /coverage/ 13 | /npm-debug.log* 14 | /testem.log 15 | /yarn-error.log 16 | 17 | # ember-try 18 | /.node_modules.ember-try/ 19 | /npm-shrinkwrap.json.ember-try 20 | /package.json.ember-try 21 | /package-lock.json.ember-try 22 | /yarn.lock.ember-try 23 | 24 | # broccoli-debug 25 | /DEBUG/ 26 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist/ 3 | /tmp/ 4 | 5 | # misc 6 | /.editorconfig 7 | /.ember-cli 8 | /.env* 9 | /.eslintcache 10 | /.eslintignore 11 | /.eslintrc.js 12 | /.git/ 13 | /.github/ 14 | /.gitignore 15 | /.prettierignore 16 | /.prettierrc.js 17 | /.stylelintignore 18 | /.stylelintrc.js 19 | /.template-lintrc.js 20 | /.travis.yml 21 | /.watchmanconfig 22 | /CONTRIBUTING.md 23 | /ember-cli-build.js 24 | /testem.js 25 | /tests/ 26 | /yarn-error.log 27 | /yarn.lock 28 | .gitkeep 29 | 30 | # ember-try 31 | /.node_modules.ember-try/ 32 | /npm-shrinkwrap.json.ember-try 33 | /package.json.ember-try 34 | /package-lock.json.ember-try 35 | /yarn.lock.ember-try 36 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | 4 | # compiled output 5 | /dist/ 6 | 7 | # misc 8 | /coverage/ 9 | !.* 10 | .*/ 11 | 12 | # ember-try 13 | /.node_modules.ember-try/ 14 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | overrides: [ 5 | { 6 | files: '*.{js,ts}', 7 | options: { 8 | singleQuote: true, 9 | }, 10 | }, 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /.release-plan.json: -------------------------------------------------------------------------------- 1 | { 2 | "solution": { 3 | "ember-cli-deprecation-workflow": { 4 | "impact": "minor", 5 | "oldVersion": "3.2.1", 6 | "newVersion": "3.3.0", 7 | "constraints": [ 8 | { 9 | "impact": "minor", 10 | "reason": "Appears in changelog section :rocket: Enhancement" 11 | } 12 | ], 13 | "pkgJSONPath": "./package.json" 14 | } 15 | }, 16 | "description": "## Release (2025-03-21)\n\nember-cli-deprecation-workflow 3.3.0 (minor)\n\n#### :rocket: Enhancement\n* `ember-cli-deprecation-workflow`\n * [#209](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/209) flushDeprecations merges detected deprecations with existing config ([@simonihmig](https://github.com/simonihmig))\n\n#### Committers: 1\n- Simon Ihmig ([@simonihmig](https://github.com/simonihmig))\n" 17 | } 18 | -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | # unconventional files 2 | /blueprints/*/files/ 3 | 4 | # compiled output 5 | /dist/ 6 | 7 | # addons 8 | /.node_modules.ember-try/ 9 | -------------------------------------------------------------------------------- /.stylelintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'], 5 | }; 6 | -------------------------------------------------------------------------------- /.template-lintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | extends: 'recommended', 5 | }; 6 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["dist"] 3 | } 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Release (2025-03-21) 4 | 5 | ember-cli-deprecation-workflow 3.3.0 (minor) 6 | 7 | #### :rocket: Enhancement 8 | * `ember-cli-deprecation-workflow` 9 | * [#209](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/209) flushDeprecations merges detected deprecations with existing config ([@simonihmig](https://github.com/simonihmig)) 10 | 11 | #### Committers: 1 12 | - Simon Ihmig ([@simonihmig](https://github.com/simonihmig)) 13 | 14 | ## Release (2025-03-21) 15 | 16 | ember-cli-deprecation-workflow 3.2.1 (patch) 17 | 18 | #### :bug: Bug Fix 19 | * `ember-cli-deprecation-workflow` 20 | * [#212](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/212) Fix type declarations ([@simonihmig](https://github.com/simonihmig)) 21 | * [#210](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/210) Options are optional ([@ef4](https://github.com/ef4)) 22 | 23 | #### Committers: 2 24 | - Edward Faulkner ([@ef4](https://github.com/ef4)) 25 | - Simon Ihmig ([@simonihmig](https://github.com/simonihmig)) 26 | 27 | ## Release (2025-03-06) 28 | 29 | ember-cli-deprecation-workflow 3.2.0 (minor) 30 | 31 | #### :rocket: Enhancement 32 | * `ember-cli-deprecation-workflow` 33 | * [#207](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/207) Allow passing a custom handler to flushDeprecations ([@simonihmig](https://github.com/simonihmig)) 34 | * [#206](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/206) Support RegExp for matchId ([@simonihmig](https://github.com/simonihmig)) 35 | 36 | #### Committers: 1 37 | - Simon Ihmig ([@simonihmig](https://github.com/simonihmig)) 38 | 39 | ## Release (2024-12-27) 40 | 41 | ember-cli-deprecation-workflow 3.1.0 (minor) 42 | 43 | #### :rocket: Enhancement 44 | * `ember-cli-deprecation-workflow` 45 | * [#200](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/200) Add TypeScript declaration file ([@bertdeblock](https://github.com/bertdeblock)) 46 | 47 | #### Committers: 1 48 | - Bert De Block ([@bertdeblock](https://github.com/bertdeblock)) 49 | 50 | ## Release (2024-08-21) 51 | 52 | ember-cli-deprecation-workflow 3.0.2 (patch) 53 | 54 | #### :bug: Bug Fix 55 | * `ember-cli-deprecation-workflow` 56 | * [#197](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/197) Remove @ember/string (it's unused) ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 57 | 58 | #### Committers: 1 59 | - [@NullVoxPopuli](https://github.com/NullVoxPopuli) 60 | 61 | ## Release (2024-07-11) 62 | 63 | ember-cli-deprecation-workflow 3.0.1 (patch) 64 | 65 | #### :house: Internal 66 | * `ember-cli-deprecation-workflow` 67 | * [#192](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/192) fix repository link in package.json ([@mansona](https://github.com/mansona)) 68 | * [#191](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/191) update release plan workflow ([@mansona](https://github.com/mansona)) 69 | 70 | #### Committers: 1 71 | - Chris Manson ([@mansona](https://github.com/mansona)) 72 | 73 | ## Release (2024-06-25) 74 | 75 | ember-cli-deprecation-workflow 3.0.0 (major) 76 | 77 | #### :boom: Breaking Change 78 | * `ember-cli-deprecation-workflow` 79 | * [#159](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/159) [BREAKING] Convert to a module. Drops support for Ember < 3.28, requires manual initialization ([@lolmaus](https://github.com/lolmaus)) 80 | * [#175](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/175) Node 16 is the minimum supported version ([@mixonic](https://github.com/mixonic)) 81 | 82 | #### :bug: Bug Fix 83 | * `ember-cli-deprecation-workflow` 84 | * [#181](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/181) Remove unused broccoli magic ([@simonihmig](https://github.com/simonihmig)) 85 | 86 | #### :memo: Documentation 87 | * `ember-cli-deprecation-workflow` 88 | * [#184](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/184) Update configuration paths in documentation ([@backspace](https://github.com/backspace)) 89 | 90 | #### :house: Internal 91 | * `ember-cli-deprecation-workflow` 92 | * [#189](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/189) start using release-plan ([@mansona](https://github.com/mansona)) 93 | * [#188](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/188) start using pnpm ([@mansona](https://github.com/mansona)) 94 | * [#178](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/178) Upgrade Ember CLI to 5.4 ([@lolmaus](https://github.com/lolmaus)) 95 | * [#170](https://github.com/ember-cli/ember-cli-deprecation-workflow/pull/170) Bump Node, swap to npm, update CI pipeline ([@mixonic](https://github.com/mixonic)) 96 | 97 | #### Committers: 5 98 | - Andrey Mikhaylov (lolmaus) ([@lolmaus](https://github.com/lolmaus)) 99 | - Buck Doyle ([@backspace](https://github.com/backspace)) 100 | - Chris Manson ([@mansona](https://github.com/mansona)) 101 | - Matthew Beale ([@mixonic](https://github.com/mixonic)) 102 | - Simon Ihmig ([@simonihmig](https://github.com/simonihmig)) 103 | 104 | ## v2.2.0 (2023-11-01) 105 | 106 | * Introduce a dependency on ember-string to improve out of the box 107 | compatibiliy with Ember 4.12 108 | * Refactor to adopt newer versions of dev dependencies. 109 | 110 | 111 | ## v2.0.0 (2021-07-04) 112 | 113 | 114 | ## v2.0.0-beta.5 (2021-07-04) 115 | 116 | #### :bug: Bug Fix 117 | * [#118](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/118) Avoid the Ember global deprecation ([@mixonic](https://github.com/mixonic)) 118 | 119 | #### Committers: 1 120 | - Matthew Beale ([@mixonic](https://github.com/mixonic)) 121 | 122 | 123 | ## v2.0.0-beta.4 (2021-06-04) 124 | 125 | #### :boom: Breaking Change 126 | * [#116](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/116) [BREAKING] Drop Node 10 ([@mixonic](https://github.com/mixonic)) 127 | 128 | #### :bug: Bug Fix 129 | * [#123](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/123) [BUGFIX] Check the incremented count for limit ([@mixonic](https://github.com/mixonic)) 130 | 131 | #### :house: Internal 132 | * [#125](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/125) Drop ember.component.reopen log ([@mixonic](https://github.com/mixonic)) 133 | * [#124](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/124) Clean up test config for clarity ([@mixonic](https://github.com/mixonic)) 134 | * [#121](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/121) Remove deprecation-without-for and deprecation-without-since warnings in test ([@SergeAstapov](https://github.com/SergeAstapov)) 135 | * [#120](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/120) Update main.js code style ([@mixonic](https://github.com/mixonic)) 136 | * [#119](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/119) Bump deps to remove some deprecated use of Ember global ([@mixonic](https://github.com/mixonic)) 137 | 138 | #### Committers: 2 139 | - Matthew Beale ([@mixonic](https://github.com/mixonic)) 140 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov)) 141 | 142 | 143 | ## v2.0.0-beta.3 (2021-05-27) 144 | 145 | #### :boom: Breaking Change 146 | * Upgrade verious dependencies across major versions 147 | 148 | #### :bug: Bug Fix 149 | * [#111](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/111) Address a deprecated import path for deprecate in tests 150 | * [#114](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/114) Drop debug handler polyfill, fixes [#113](https://github.com/mixonic/ember-cli-deprecation-workflow/issues/113). 151 | 152 | #### :rocket: Enhancement 153 | * [#93](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/93) Limit logging when a high-repetition deprecation is firing. 154 | 155 | ## v2.0.0-beta.2 (2021-02-27) 156 | 157 | #### :boom: Breaking Change 158 | * [#92](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/92) Modernize ([@wagenet](https://github.com/wagenet)) 159 | 160 | #### :house: Internal 161 | * [#98](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/98) Add release automation ([@rwjblue](https://github.com/rwjblue)) 162 | * [#97](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/97) Migrate to GH Actions. ([@rwjblue](https://github.com/rwjblue)) 163 | 164 | #### Committers: 3 165 | - Igor Terzic ([@igorT](https://github.com/igorT)) 166 | - Peter Wagenet ([@wagenet](https://github.com/wagenet)) 167 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 168 | 169 | 170 | ## v1.0.1 (2018-11-05) 171 | 172 | #### :bug: Bug Fix 173 | * [#62](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/62) Avoid error when running on nested addons (`this.app` is not always present) ([@SparshithNR](https://github.com/SparshithNR)) 174 | 175 | #### Committers: 1 176 | - SparshithNRai ([@SparshithNR](https://github.com/SparshithNR)) 177 | 178 | ## v1.0.0 (2018-09-26) 179 | 180 | #### :boom: Breaking Change 181 | * [#57](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/57) Update to ember-cli 2.18 ([@Gaurav0](https://github.com/Gaurav0)) 182 | * Drop support for Node 4 and lower. 183 | 184 | #### :rocket: Enhancement 185 | * [#55](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/55) Allow custom addon config directory ([@atsao](https://github.com/atsao)) 186 | * [#58](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/58) Update to ember-cli@3.4 blueprint. ([@rwjblue](https://github.com/rwjblue)) 187 | * [#57](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/57) Update to ember-cli 2.18 ([@Gaurav0](https://github.com/Gaurav0)) 188 | 189 | #### :bug: Bug Fix 190 | * [#59](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/59) Update broccoli node to be broccoli-plugin based. ([@rwjblue](https://github.com/rwjblue)) 191 | 192 | #### :house: Internal 193 | * [#60](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/60) Add Ember 1.13, 2.4, 2.8, and 2.12 back into config/ember-try.js. ([@rwjblue](https://github.com/rwjblue)) 194 | 195 | #### Committers: 3 196 | - Andrew Tsao ([@atsao](https://github.com/atsao)) 197 | - Gaurav Munjal ([@Gaurav0](https://github.com/Gaurav0)) 198 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 199 | 200 | 201 | ## v0.2.5 (2018-08-10) 202 | 203 | #### :bug: Bug Fix 204 | * [#54](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/54) Switch from Ember.Logger to console ([@wagenet](https://github.com/wagenet)) 205 | 206 | #### :memo: Documentation 207 | * [#42](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/42) Update README.md ([@tabeth](https://github.com/tabeth)) 208 | * [#48](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/48) document production builds and catch-all ([@IRun26Point2](https://github.com/IRun26Point2)) 209 | 210 | #### Committers: 3 211 | - Peter Wagenet ([@wagenet](https://github.com/wagenet)) 212 | - Tabeth Nkangoh ([@tabeth](https://github.com/tabeth)) 213 | - [@IRun26Point2](https://github.com/IRun26Point2) 214 | 215 | 216 | ## v0.2.4 (2017-10-18) 217 | 218 | #### :rocket: Enhancement 219 | * [#46](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/46) Convert "ember-cli-babel" to dev dependency ([@Turbo87](https://github.com/Turbo87)) 220 | 221 | #### :memo: Documentation 222 | * [#41](https://github.com/mixonic/ember-cli-deprecation-workflow/pull/41) Update README.md ([@tabeth](https://github.com/tabeth)) 223 | 224 | #### Committers: 2 225 | - Tabeth Nkangoh ([@tabeth](https://github.com/tabeth)) 226 | - Tobias Bieniek ([@Turbo87](https://github.com/Turbo87)) 227 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | ## Installation 4 | 5 | * `git clone https://github.com/mixonic/ember-cli-deprecation-workflow.git` 6 | * `cd ember-cli-deprecation-workflow` 7 | * `npm install` 8 | 9 | ## Linting 10 | 11 | * `npm run lint` 12 | * `npm run lint:fix` 13 | 14 | ## Running tests 15 | 16 | * `ember test` – Runs the test suite on the current Ember version 17 | * `ember test --server` – Runs the test suite in "watch mode" 18 | * `ember try:each` – Runs the test suite against multiple Ember versions 19 | 20 | ## Running the dummy application 21 | 22 | * `ember serve` 23 | * Visit the dummy application at [http://localhost:4200](http://localhost:4200). 24 | 25 | For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/). 26 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ember-cli-deprecation-workflow 2 | 3 | An addon geared towards making Ember upgrades easier by allowing you to work 4 | through deprecations without massive console noise. 5 | 6 | ## History 7 | 8 | Upgrading Ember versions can be very daunting. One of the largest factors is the 9 | massive `console.log` noise that the deprecations introduced in those versions 10 | (to help us know what we need to do to stay up to date) is so overwhelming that 11 | we quite literally have no idea what to do. 12 | 13 | The "deprecation spew" issue became very obvious as we progressed into the later 14 | 1.13 beta releases. At that point, [@mixonic](https://twitter.com/mixonic) and 15 | [@rwjblue](https://twitter.com/rwjblue) came up with a wild scheme. 16 | 17 | The scheme was to build tooling which made dealing with deprecations an 18 | incremental process. ember-cli-deprecation-workflow allows you to focus on 19 | addressing a single deprecation at a time, and prevents backsliding 20 | (re-introduction of a deprecated API use) in a codebase. 21 | 22 | ## Usage 23 | 24 | ### Compatibility 25 | 26 | 3.x 27 | 28 | - Ember.js 3.28 until at least 5.4 29 | - Ember CLI 4.12 or above 30 | - Node.js 16 or above 31 | 32 | 2.x 33 | 34 | - Ember.js 2.12 until at least 4.12 35 | - Ember CLI 3.16 or above 36 | - Node.js 12 and 14 or above 37 | 38 | 1.x 39 | 40 | - Ember.js 1.13 until at least 3.4 41 | - Ember CLI 3.4 as well as many versions before and after 42 | - Node.js 6, 8, and 10 until at least 14 43 | 44 | ### Getting started 45 | 46 | 1. Install the ember-cli-deprecation-workflow addon (`ember install ember-cli-deprecation-workflow`). 47 | 2. Create an `app/deprecation-workflow.js` file with the following content: 48 | 49 | ```js 50 | import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 51 | 52 | setupDeprecationWorkflow(); 53 | ``` 54 | 55 | 3. In your `app/app.js`, do: 56 | 57 | ```js 58 | import './deprecation-workflow'; 59 | ``` 60 | 61 | 4. Run your test suite\* with `ember test --server`. 62 | 5. Navigate to your tests (default: http://localhost:7357/) 63 | 6. Run `deprecationWorkflow.flushDeprecations()` in your browsers console. Or `flushDeprecations({ handler: 'log' })` if you want a different [handler](#handlers) than the default of `silence`. 64 | 7. Copy the string output and overwrite the content of `app/deprecation-workflow.js`. 65 | 66 | In Chrome, use right click → "Copy string contents" to avoid escape characters. 67 | 68 | Once this initial setup is completed the "deprecation spew" should be largely 69 | "fixed". Only unhandled deprecations will be displayed in your console. 70 | 71 | \*Note: Unless your test coverage is amazing (>90%), it's likely that running 72 | the test suite alone will not reveal _every_ deprecation. It may be prudent to 73 | run through the app's workflows live and flush deprecations a second time, 74 | merging the resulting output list with that generated from your test suite. 75 | 76 | Now that the spew has settled down, you can process one deprecation at a time while ensuring that no new deprecations are introduced. 77 | 78 | ### Workflow 79 | 80 | What does that individual deprecation workflow look like? 81 | 82 | 1. Change one entry in `app/deprecation-workflow.js` from `silence` to `throw`. 83 | 2. Run your tests or use your application. 84 | 3. Errors will be thrown for just that one deprecation, and you can track down the fixes needed in relative isolation of the rest of the deprecations. 85 | 4. Once the deprecation has been dealt with, remove its entry from `app/deprecation-workflow.js`. 86 | 5. Lather and repeat. 87 | 88 | ### Handlers 89 | 90 | There are 3 defined handlers that have different behaviors 91 | 92 | | Handler | Behavior | 93 | | --------- | ---------------------------------------------------------------------------------------------------------------- | 94 | | `silence` | Keeps this deprecation from spewing all over the console | 95 | | `log` | Normal deprecation behavior runs for this deprecation and messages are logged to the console | 96 | | `throw` | The error is thrown instead of allowing the deprecated behavior to run. **_WARNING: APPLICATION MAY GO :boom:_** | 97 | 98 | ### Matchers 99 | 100 | the output from running `deprecationWorkflow.flushDeprecations()` gives you a 101 | nice Json like JS object with all the deprecations in your app. The 102 | `matchMessage` property determines what to filter out of the console. You can 103 | pass a string that must match the console message exactly or a `RegExp` for 104 | `ember-cli-deprecation-workflow` filter the log by. 105 | 106 | ### Production builds 107 | 108 | By default, production ember-cli builds already remove deprecation warnings. Any 109 | deprecations configured to `throw` or `log` will only do so in non-production 110 | builds. 111 | 112 | ### Enable / Disable through configuration 113 | 114 | If your app has disabled test files in development environment you can force enabling this addon through configuration in `ember-cli-build.js` instead: 115 | ```javascript 116 | 'ember-cli-deprecation-workflow': { 117 | enabled: true, 118 | }, 119 | ``` 120 | 121 | ### Catch-all 122 | 123 | To force all deprecations to throw (can be useful in larger teams to prevent 124 | accidental introduction of deprecations), update your 125 | `app/deprecation-workflow.js`: 126 | 127 | ```javascript 128 | window.deprecationWorkflow.config = { 129 | throwOnUnhandled: true, 130 | }; 131 | ``` 132 | 133 | ### Template Deprecations 134 | 135 | By default, the console based deprecations that occur during template 136 | compilation are suppressed in favor of browser deprecations ran during the test 137 | suite. If you would prefer to still have the deprecations in the console, add 138 | the following to your `app/environment.js`: 139 | 140 | ```javascript 141 | module.exports = function (env) { 142 | var ENV = {}; 143 | 144 | // normal things here 145 | 146 | ENV.logTemplateLintToConsole = true; 147 | }; 148 | ``` 149 | 150 | ### Configuration 151 | 152 | In some cases, it may be necessary to indicate a different `config` directory 153 | from the default one (`/config`). For example, you may want the flushed 154 | deprecations file to be referenced in a config directory like `my-config`. 155 | 156 | Adjust the `configPath` in your `package.json` file. The `/` will automatically 157 | be prefixed. 158 | 159 | ```javascript 160 | { 161 | 'ember-addon': { 162 | configPath: 'my-config' 163 | } 164 | } 165 | ``` 166 | 167 | ## Contributing 168 | 169 | Details on contributing to the addon itself (not required for normal usage). 170 | 171 | See the [Contributing](CONTRIBUTING.md) guide for details. 172 | 173 | ## License 174 | 175 | This project is licensed under the [MIT License](LICENSE.md). 176 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Release Process 2 | 3 | Releases in this repo are mostly automated using [release-plan](https://github.com/embroider-build/release-plan/). Once you label all your PRs correctly (see below) you will have an automatically generated PR that updates your CHANGELOG.md file and a `.release-plan.json` that is used to prepare the release once the PR is merged. 4 | 5 | ## Preparation 6 | 7 | Since the majority of the actual release process is automated, the remaining tasks before releasing are: 8 | 9 | - correctly labeling **all** pull requests that have been merged since the last release 10 | - updating pull request titles so they make sense to our users 11 | 12 | Some great information on why this is important can be found at [keepachangelog.com](https://keepachangelog.com/en/1.1.0/), but the overall 13 | guiding principle here is that changelogs are for humans, not machines. 14 | 15 | When reviewing merged PR's the labels to be used are: 16 | 17 | * breaking - Used when the PR is considered a breaking change. 18 | * enhancement - Used when the PR adds a new feature or enhancement. 19 | * bug - Used when the PR fixes a bug included in a previous release. 20 | * documentation - Used when the PR adds or updates documentation. 21 | * internal - Internal changes or things that don't fit in any other category. 22 | 23 | **Note:** `release-plan` requires that **all** PRs are labeled. If a PR doesn't fit in a category it's fine to label it as `internal` 24 | 25 | ## Release 26 | 27 | Once the prep work is completed, the actual release is straight forward: you just need to merge the open [Plan Release](https://github.com/mixonic/ember-cli-deprecation-workflow/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR 28 | -------------------------------------------------------------------------------- /addon/index.js: -------------------------------------------------------------------------------- 1 | import { registerDeprecationHandler } from '@ember/debug'; 2 | 3 | const LOG_LIMIT = 100; 4 | 5 | export default function setupDeprecationWorkflow(config) { 6 | self.deprecationWorkflow = self.deprecationWorkflow || {}; 7 | self.deprecationWorkflow.deprecationLog = { 8 | messages: new Set(), 9 | }; 10 | 11 | registerDeprecationHandler((message, options, next) => 12 | handleDeprecationWorkflow(config, message, options, next), 13 | ); 14 | 15 | registerDeprecationHandler(deprecationCollector); 16 | 17 | self.deprecationWorkflow.flushDeprecations = (options) => 18 | flushDeprecations({ config, ...options }); 19 | } 20 | 21 | function matchesWorkflow(matcher, value) { 22 | return ( 23 | (typeof matcher === 'string' && matcher === value) || 24 | (matcher instanceof RegExp && matcher.exec(value)) 25 | ); 26 | } 27 | 28 | export function detectWorkflow(config, message, options) { 29 | if (!config || !config.workflow) { 30 | return; 31 | } 32 | 33 | let i, workflow, matcher, idMatcher; 34 | for (i = 0; i < config.workflow.length; i++) { 35 | workflow = config.workflow[i]; 36 | matcher = workflow.matchMessage; 37 | idMatcher = workflow.matchId; 38 | 39 | if ( 40 | matchesWorkflow(idMatcher, options?.id) || 41 | matchesWorkflow(matcher, message) 42 | ) { 43 | return workflow; 44 | } 45 | } 46 | } 47 | 48 | export function flushDeprecations({ handler = 'silence', config = {} } = {}) { 49 | let messages = self.deprecationWorkflow.deprecationLog.messages; 50 | let existing = config.workflow ?? []; 51 | let collected = messages 52 | .values() 53 | .filter((matchId) => !existing.some((entry) => entry.matchId === matchId)) 54 | .map((matchId) => ({ 55 | handler, 56 | matchId, 57 | })); 58 | 59 | let mergedConfig = { 60 | ...config, 61 | workflow: [...existing, ...collected], 62 | }; 63 | 64 | return `import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 65 | 66 | setupDeprecationWorkflow(${JSON.stringify(mergedConfig, undefined, 2)});`; 67 | } 68 | 69 | export function handleDeprecationWorkflow(config, message, options, next) { 70 | let matchingWorkflow = detectWorkflow(config, message, options); 71 | if (!matchingWorkflow) { 72 | if (config && config.throwOnUnhandled) { 73 | throw new Error(message); 74 | } else { 75 | next(message, options); 76 | } 77 | } else { 78 | switch (matchingWorkflow.handler) { 79 | case 'silence': 80 | // no-op 81 | break; 82 | case 'log': { 83 | let key = (options && options.id) || message; 84 | 85 | if (!self.deprecationWorkflow.logCounts) { 86 | self.deprecationWorkflow.logCounts = {}; 87 | } 88 | 89 | let count = self.deprecationWorkflow.logCounts[key] || 0; 90 | self.deprecationWorkflow.logCounts[key] = ++count; 91 | 92 | if (count <= LOG_LIMIT) { 93 | console.warn('DEPRECATION: ' + message); 94 | if (count === LOG_LIMIT) { 95 | console.warn( 96 | 'To avoid console overflow, this deprecation will not be logged any more in this run.', 97 | ); 98 | } 99 | } 100 | 101 | break; 102 | } 103 | case 'throw': 104 | throw new Error(message); 105 | default: 106 | next(message, options); 107 | break; 108 | } 109 | } 110 | } 111 | 112 | export function deprecationCollector(message, options, next) { 113 | self.deprecationWorkflow.deprecationLog.messages.add(options.id); 114 | 115 | next(message, options); 116 | } 117 | -------------------------------------------------------------------------------- /ember-cli-build.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Ensures tests can find the dummy app config directory 4 | const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 5 | 6 | module.exports = function (defaults) { 7 | const app = new EmberAddon(defaults, { 8 | // Add options here 9 | }); 10 | 11 | // this is needed to prevent the building app to assume the root `vendor` 12 | // directory (since it is used by the addon itself) 13 | // 14 | // this is likely a bug upstream in ember-cli that needs to be fixed 15 | app.trees.vendor = null; 16 | 17 | /* 18 | This build file specifes the options for the dummy test app of this 19 | addon, located in `/tests/dummy` 20 | This build file does *not* influence how the addon or the app using it 21 | behave. You most likely want to be modifying `./index.js` or app's build file 22 | */ 23 | 24 | const { maybeEmbroider } = require('@embroider/test-setup'); 25 | return maybeEmbroider(app, { 26 | skipBabel: [ 27 | { 28 | package: 'qunit', 29 | }, 30 | ], 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | interface WorkflowMatchId { 2 | handler?: 'log' | 'silence' | 'throw'; 3 | matchId: string | RegExp; 4 | } 5 | 6 | interface WorkflowMatchMessage { 7 | handler?: 'log' | 'silence' | 'throw'; 8 | matchMessage: string | RegExp; 9 | } 10 | 11 | type Workflow = WorkflowMatchId | WorkflowMatchMessage; 12 | 13 | export default function setupDeprecationWorkflow(config?: { 14 | throwOnUnhandled?: boolean; 15 | workflow?: Workflow[]; 16 | }): void; 17 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | name: require('./package').name, 5 | 6 | _shouldInclude() { 7 | // the presence of `this.app.tests` shows that we are in one of: 8 | // 9 | // * running non-production build 10 | // * running tests against production 11 | // 12 | var app = this.app || this._findHost(); 13 | let addonOptions = app.options['ember-cli-deprecation-workflow']; 14 | 15 | if (addonOptions) { 16 | return addonOptions.enabled; 17 | } else { 18 | return app.tests; 19 | } 20 | }, 21 | 22 | included() { 23 | // From https://github.com/rwjblue/ember-debug-handlers-polyfill/blob/master/index.js 24 | var app = this.app || this._findHost(); 25 | 26 | if (this._shouldInclude()) { 27 | app.import('vendor/ember-cli-deprecation-workflow/main.js'); 28 | } 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-deprecation-workflow", 3 | "version": "3.3.0", 4 | "description": "Provides a much needed workflow to managing deprecations.", 5 | "keywords": [ 6 | "ember-addon" 7 | ], 8 | "repository": "https://github.com/ember-cli/ember-cli-deprecation-workflow/", 9 | "license": "MIT", 10 | "author": "", 11 | "directories": { 12 | "doc": "doc", 13 | "test": "tests" 14 | }, 15 | "scripts": { 16 | "build": "ember build --environment=production", 17 | "changelog": "lerna-changelog", 18 | "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", 19 | "lint:css": "stylelint \"**/*.css\"", 20 | "lint:css:fix": "concurrently \"npm:lint:css -- --fix\"", 21 | "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"", 22 | "lint:hbs": "ember-template-lint .", 23 | "lint:hbs:fix": "ember-template-lint . --fix", 24 | "lint:js": "eslint . --cache", 25 | "lint:js:fix": "eslint . --fix", 26 | "start": "ember serve", 27 | "test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"", 28 | "test:ember": "ember test", 29 | "test:ember-compatibility": "ember try:each" 30 | }, 31 | "dependencies": { 32 | "@babel/core": "^7.23.2", 33 | "ember-cli-babel": "^8.2.0" 34 | }, 35 | "devDependencies": { 36 | "@babel/eslint-parser": "^7.22.15", 37 | "@babel/plugin-proposal-decorators": "^7.23.2", 38 | "@ember/optional-features": "^2.0.0", 39 | "@ember/test-helpers": "3.2.0", 40 | "@embroider/test-setup": "^3.0.2", 41 | "@glimmer/component": "^1.1.2", 42 | "@glimmer/tracking": "^1.1.2", 43 | "broccoli-asset-rev": "^3.0.0", 44 | "concurrently": "^8.2.2", 45 | "ember-auto-import": "^2.6.3", 46 | "ember-cli": "~5.4.1", 47 | "ember-cli-clean-css": "^3.0.0", 48 | "ember-cli-dependency-checker": "^3.3.2", 49 | "ember-cli-htmlbars": "^6.3.0", 50 | "ember-cli-inject-live-reload": "^2.1.0", 51 | "ember-cli-sri": "^2.1.1", 52 | "ember-cli-terser": "^4.0.2", 53 | "ember-load-initializers": "^2.1.2", 54 | "ember-page-title": "^8.0.0", 55 | "ember-qunit": "~8.0.1", 56 | "ember-resolver": "^11.0.1", 57 | "ember-source": "~5.4.0", 58 | "ember-source-channel-url": "^3.0.0", 59 | "ember-template-lint": "^5.11.2", 60 | "ember-try": "^3.0.0", 61 | "eslint": "^8.52.0", 62 | "eslint-config-prettier": "^9.0.0", 63 | "eslint-plugin-ember": "^11.11.1", 64 | "eslint-plugin-n": "^16.2.0", 65 | "eslint-plugin-prettier": "^5.0.1", 66 | "eslint-plugin-qunit": "^8.0.1", 67 | "lerna-changelog": "^2.2.0", 68 | "loader.js": "^4.7.0", 69 | "prettier": "^3.0.3", 70 | "qunit": "^2.20.0", 71 | "qunit-dom": "^2.0.0", 72 | "release-plan": "^0.9.0", 73 | "stylelint": "^15.11.0", 74 | "stylelint-config-standard": "^34.0.0", 75 | "stylelint-prettier": "^4.0.2", 76 | "webpack": "^5.89.0" 77 | }, 78 | "peerDependencies": { 79 | "ember-source": ">= 4.0.0" 80 | }, 81 | "engines": { 82 | "node": ">= 18" 83 | }, 84 | "publishConfig": { 85 | "registry": "https://registry.npmjs.org" 86 | }, 87 | "changelog": { 88 | "repo": "mixonic/ember-cli-deprecation-workflow", 89 | "labels": { 90 | "breaking": ":boom: Breaking Change", 91 | "enhancement": ":rocket: Enhancement", 92 | "bug": ":bug: Bug Fix", 93 | "documentation": ":memo: Documentation", 94 | "internal": ":house: Internal" 95 | } 96 | }, 97 | "ember": { 98 | "edition": "octane" 99 | }, 100 | "ember-addon": { 101 | "configPath": "tests/dummy/config", 102 | "after": "ember-cli-htmlbars" 103 | }, 104 | "packageManager": "pnpm@8.15.9", 105 | "volta": { 106 | "node": "16.20.2", 107 | "pnpm": "8.15.9" 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /testem.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | test_page: 'tests/index.html?hidepassed', 5 | disable_watching: true, 6 | launch_in_ci: ['Chrome'], 7 | launch_in_dev: ['Chrome'], 8 | browser_start_timeout: 120, 9 | browser_args: { 10 | Chrome: { 11 | ci: [ 12 | // --no-sandbox is needed when running Chrome inside a container 13 | process.env.CI ? '--no-sandbox' : null, 14 | '--headless', 15 | '--disable-dev-shm-usage', 16 | '--disable-software-rasterizer', 17 | '--mute-audio', 18 | '--remote-debugging-port=0', 19 | '--window-size=1440,900', 20 | ].filter(Boolean), 21 | }, 22 | }, 23 | }; 24 | -------------------------------------------------------------------------------- /tests/acceptance/flush-deprecations-test.js: -------------------------------------------------------------------------------- 1 | import { deprecate } from '@ember/debug'; 2 | import { module } from 'qunit'; 3 | import test from '../helpers/debug-test'; 4 | import { config } from 'dummy/deprecation-workflow'; 5 | 6 | let originalWarn; 7 | 8 | module('flushDeprecations', function (hooks) { 9 | hooks.beforeEach(function () { 10 | originalWarn = window.Testem.handleConsoleMessage; 11 | }); 12 | 13 | hooks.afterEach(function () { 14 | window.deprecationWorkflow.deprecationLog = { messages: new Set() }; 15 | window.Testem.handleConsoleMessage = originalWarn; 16 | }); 17 | 18 | test('works', function (assert) { 19 | deprecate('silence-strict', false, { 20 | since: '2.0.0', 21 | until: 'forever', 22 | id: 'test', 23 | for: 'testing', 24 | }); 25 | 26 | deprecate('log-strict', false, { 27 | since: '2.0.0', 28 | until: 'forever', 29 | id: 'test', 30 | for: 'testing', 31 | }); 32 | 33 | deprecate(' foo log-match foo', false, { 34 | since: 'now', 35 | until: 'forever', 36 | id: 'test', 37 | for: 'testing', 38 | }); 39 | 40 | deprecate(' foo foo', false, { 41 | since: 'now', 42 | until: 'forever', 43 | id: 'log-strict', 44 | for: 'testing', 45 | }); 46 | 47 | deprecate('arbitrary-unmatched-message', false, { 48 | id: 'log-strict', 49 | since: '2.0.0', 50 | until: '3.0.0', 51 | for: 'testing', 52 | }); 53 | 54 | const deprecationsPayload = self.deprecationWorkflow.flushDeprecations(); 55 | 56 | assert.strictEqual( 57 | deprecationsPayload, 58 | `import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 59 | 60 | setupDeprecationWorkflow(${JSON.stringify( 61 | { 62 | ...config, 63 | workflow: [ 64 | ...config.workflow, 65 | { handler: 'silence', matchId: 'test' }, 66 | // this one is already present in the existing config, so don't expect another entry, as we deduplicate 67 | // { handler: 'silence', matchId: 'log-strict' }, 68 | ], 69 | }, 70 | undefined, 71 | 2, 72 | )});`, 73 | ); 74 | }); 75 | }); 76 | -------------------------------------------------------------------------------- /tests/acceptance/workflow-config-test.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable qunit/require-expect */ 2 | 3 | import { deprecate } from '@ember/debug'; 4 | import { module } from 'qunit'; 5 | import test from '../helpers/debug-test'; 6 | 7 | let originalWarn; 8 | 9 | module('workflow config', function (hooks) { 10 | hooks.beforeEach(function () { 11 | originalWarn = window.Testem.handleConsoleMessage; 12 | }); 13 | 14 | hooks.afterEach(function () { 15 | window.deprecationWorkflow.deprecationLog = { messages: new Set() }; 16 | window.Testem.handleConsoleMessage = originalWarn; 17 | }); 18 | 19 | test('deprecation silenced with string matcher', function (assert) { 20 | deprecate('silence-strict', false, { 21 | since: '2.0.0', 22 | until: 'forever', 23 | id: 'test', 24 | for: 'testing', 25 | }); 26 | assert.ok(true, 'Deprecation did not raise'); 27 | }); 28 | 29 | test('deprecation logs with message matcher', function (assert) { 30 | assert.expect(1); 31 | 32 | let message = 'log-strict'; 33 | window.Testem.handleConsoleMessage = function (passedMessage) { 34 | assert.strictEqual( 35 | passedMessage.indexOf('DEPRECATION: ' + message), 36 | 0, 37 | 'deprecation logs', 38 | ); 39 | }; 40 | deprecate(message, false, { 41 | since: '2.0.0', 42 | until: 'forever', 43 | id: 'test', 44 | for: 'testing', 45 | }); 46 | }); 47 | 48 | test('deprecation logs with message matcher by regex', function (assert) { 49 | assert.expect(1); 50 | 51 | let message = ' foo log-match foo'; 52 | window.Testem.handleConsoleMessage = function (passedMessage) { 53 | assert.strictEqual( 54 | passedMessage.indexOf('DEPRECATION: ' + message), 55 | 0, 56 | 'deprecation logs', 57 | ); 58 | }; 59 | deprecate(message, false, { 60 | since: 'now', 61 | until: 'forever', 62 | id: 'test', 63 | for: 'testing', 64 | }); 65 | }); 66 | 67 | test('deprecation logs with id matcher', function (assert) { 68 | assert.expect(1); 69 | 70 | let message = ' foo foo'; 71 | window.Testem.handleConsoleMessage = function (passedMessage) { 72 | assert.strictEqual( 73 | passedMessage.indexOf('DEPRECATION: ' + message), 74 | 0, 75 | 'deprecation logs', 76 | ); 77 | }; 78 | deprecate(message, false, { 79 | since: 'now', 80 | until: 'forever', 81 | id: 'log-strict', 82 | for: 'testing', 83 | }); 84 | }); 85 | 86 | test('deprecation thrown with string matcher', function (assert) { 87 | assert.throws(function () { 88 | deprecate('throw-strict', false, { 89 | since: '2.0.0', 90 | until: 'forever', 91 | id: 'test', 92 | for: 'testing', 93 | }); 94 | }, 'deprecation throws'); 95 | }); 96 | 97 | test('deprecation logs with id matcher and options', function (assert) { 98 | assert.expect(1); 99 | 100 | let message = 'arbitrary-unmatched-message'; 101 | let id = 'log-strict'; 102 | let options = { 103 | id, 104 | since: '2.0.0', 105 | until: '3.0.0', 106 | for: 'testing', 107 | }; 108 | let expected = `DEPRECATION: ${message}`; 109 | window.Testem.handleConsoleMessage = function (passedMessage) { 110 | assert.strictEqual( 111 | passedMessage.substr(0, expected.length), 112 | expected, 113 | 'deprecation logs', 114 | ); 115 | }; 116 | deprecate(message, false, options); 117 | }); 118 | 119 | test('deprecation limits each id to 100 console.logs', function (assert) { 120 | assert.expect(104); 121 | let limit = 100; 122 | 123 | let message = 'log-match'; 124 | let id = 'first-and-unique-to-limit-test'; 125 | let options = { 126 | id, 127 | since: '2.0.0', 128 | until: '3.0.0', 129 | for: 'testing', 130 | }; 131 | let expected = `DEPRECATION: ${message}`; 132 | 133 | let count = 0; 134 | window.Testem.handleConsoleMessage = function (passedMessage) { 135 | count++; 136 | if (count <= limit) { 137 | // eslint-disable-next-line qunit/no-conditional-assertions 138 | assert.strictEqual( 139 | passedMessage.substr(0, expected.length), 140 | expected, 141 | 'deprecation logs', 142 | ); 143 | } 144 | if (count === limit) { 145 | window.Testem.handleConsoleMessage = function (passedMessage) { 146 | assert.strictEqual( 147 | passedMessage, 148 | 'To avoid console overflow, this deprecation will not be logged any more in this run.', 149 | ); 150 | }; 151 | } 152 | }; 153 | 154 | // Run one more time than the limit 155 | for (let i = 0; i <= limit; i++) { 156 | deprecate(message, false, options); 157 | } 158 | 159 | assert.strictEqual( 160 | count, 161 | limit, 162 | 'logged 100 times, including final notice', 163 | ); 164 | 165 | let secondMessage = 'log-strict'; 166 | let secondId = 'second-and-unique-to-limit-test'; 167 | let secondOptions = { 168 | id: secondId, 169 | since: '2.0.0', 170 | until: '3.0.0', 171 | for: 'testing', 172 | }; 173 | let secondExpected = `DEPRECATION: ${secondMessage}`; 174 | 175 | let secondCount = 0; 176 | window.Testem.handleConsoleMessage = function (passedMessage) { 177 | secondCount++; 178 | assert.strictEqual( 179 | passedMessage.substr(0, secondExpected.length), 180 | secondExpected, 181 | 'second deprecation logs', 182 | ); 183 | window.Testem.handleConsoleMessage = function () { 184 | assert.ok(false, 'No further logging expected'); 185 | }; 186 | }; 187 | 188 | deprecate(secondMessage, false, secondOptions); 189 | 190 | assert.strictEqual(secondCount, 1, 'logged deprecation with different id'); 191 | }); 192 | }); 193 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Application from '@ember/application'; 2 | import Resolver from 'ember-resolver'; 3 | import loadInitializers from 'ember-load-initializers'; 4 | import config from 'dummy/config/environment'; 5 | import './deprecation-workflow'; 6 | 7 | export default class App extends Application { 8 | modulePrefix = config.modulePrefix; 9 | podModulePrefix = config.podModulePrefix; 10 | Resolver = Resolver; 11 | } 12 | 13 | loadInitializers(App, config.modulePrefix); 14 | -------------------------------------------------------------------------------- /tests/dummy/app/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-cli-deprecation-workflow/d70f32b0f30e63bf1722e8070ecddb3df434ecce/tests/dummy/app/components/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-cli-deprecation-workflow/d70f32b0f30e63bf1722e8070ecddb3df434ecce/tests/dummy/app/controllers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/deprecation-workflow.js: -------------------------------------------------------------------------------- 1 | import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 2 | 3 | // We export this here to be able to import from our own tests 4 | export const config = { 5 | throwOnUnhandled: true, 6 | workflow: [ 7 | /* 8 | * Actual controlled deprecations 9 | * 10 | * The ember-global log configuration is only required for 11 | * ember-3.28-with-jquery. All other ember-try scenarios pass with that 12 | * handler removed (and defaulting to a throw). 13 | */ 14 | { matchId: 'ember-global', handler: 'log' }, 15 | { matchMessage: /ember-test-waiters/, handler: 'log' }, 16 | 17 | /* 18 | * Deprecation setup for tests 19 | */ 20 | { matchId: 'silence-strict', handler: 'silence' }, 21 | { matchMessage: 'silence-strict', handler: 'silence' }, 22 | { matchMessage: /silence-match/, handler: 'silence' }, 23 | 24 | { matchId: 'log-strict', handler: 'log' }, 25 | { matchMessage: 'log-strict', handler: 'log' }, 26 | { matchMessage: /log-match/, handler: 'log' }, 27 | 28 | { matchMessage: 'throw-strict', handler: 'throw' }, 29 | ], 30 | }; 31 | 32 | setupDeprecationWorkflow(config); 33 | -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-cli-deprecation-workflow/d70f32b0f30e63bf1722e8070ecddb3df434ecce/tests/dummy/app/helpers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Dummy 6 | 7 | 8 | 9 | {{content-for "head"}} 10 | 11 | 12 | 13 | 14 | {{content-for "head-footer"}} 15 | 16 | 17 | {{content-for "body"}} 18 | 19 | 20 | 21 | 22 | {{content-for "body-footer"}} 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-cli-deprecation-workflow/d70f32b0f30e63bf1722e8070ecddb3df434ecce/tests/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import EmberRouter from '@ember/routing/router'; 2 | import config from 'dummy/config/environment'; 3 | 4 | export default class Router extends EmberRouter { 5 | location = config.locationType; 6 | rootURL = config.rootURL; 7 | } 8 | 9 | Router.map(function () {}); 10 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-cli-deprecation-workflow/d70f32b0f30e63bf1722e8070ecddb3df434ecce/tests/dummy/app/routes/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.css: -------------------------------------------------------------------------------- 1 | /* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */ 2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 | {{page-title "Dummy"}} 2 | 3 |

Welcome to Ember

4 | 5 | {{outlet}} -------------------------------------------------------------------------------- /tests/dummy/config/ember-cli-update.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": "1.0.0", 3 | "packages": [ 4 | { 5 | "name": "ember-cli", 6 | "version": "5.4.1", 7 | "blueprints": [ 8 | { 9 | "name": "addon", 10 | "outputRepo": "https://github.com/ember-cli/ember-addon-output", 11 | "codemodsSource": "ember-addon-codemods-manifest@1", 12 | "isBaseBlueprint": true, 13 | "options": [ 14 | "--no-welcome" 15 | ] 16 | } 17 | ] 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/dummy/config/ember-try.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const getChannelURL = require('ember-source-channel-url'); 4 | const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup'); 5 | 6 | module.exports = async function () { 7 | let emberReleaseVersion = await getChannelURL('release'); 8 | return { 9 | usePnpm: true, 10 | scenarios: [ 11 | { 12 | name: 'ember-lts-3.28', 13 | npm: { 14 | devDependencies: { 15 | 'ember-source': '~3.28.0', 16 | 'ember-cli': '^4.12.0', 17 | }, 18 | }, 19 | }, 20 | { 21 | name: 'ember-lts-4.4', 22 | npm: { 23 | devDependencies: { 24 | 'ember-source': '~4.4.0', 25 | }, 26 | }, 27 | }, 28 | { 29 | name: 'ember-lts-4.8', 30 | npm: { 31 | devDependencies: { 32 | 'ember-source': '~4.8.0', 33 | }, 34 | }, 35 | }, 36 | { 37 | name: 'ember-lts-4.12', 38 | npm: { 39 | devDependencies: { 40 | 'ember-source': '~4.12.0', 41 | }, 42 | }, 43 | }, 44 | { 45 | name: 'ember-lts-5.4', 46 | npm: { 47 | devDependencies: { 48 | 'ember-source': '~5.4.0', 49 | }, 50 | }, 51 | }, 52 | { 53 | name: 'ember-release', 54 | npm: { 55 | devDependencies: { 56 | 'ember-source': emberReleaseVersion, 57 | }, 58 | }, 59 | }, 60 | { 61 | name: 'ember-beta', 62 | npm: { 63 | devDependencies: { 64 | 'ember-source': await getChannelURL('beta'), 65 | }, 66 | }, 67 | }, 68 | { 69 | name: 'ember-canary', 70 | npm: { 71 | devDependencies: { 72 | 'ember-source': await getChannelURL('canary'), 73 | }, 74 | }, 75 | }, 76 | { 77 | name: 'ember-3.28-with-jquery', 78 | env: { 79 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 80 | 'jquery-integration': true, 81 | }), 82 | }, 83 | npm: { 84 | devDependencies: { 85 | 'ember-source': '~3.28.0', 86 | '@ember/jquery': '^2.0.0', 87 | 'ember-cli': '^4.12.0', 88 | }, 89 | }, 90 | }, 91 | { 92 | name: 'ember-3.28-classic', 93 | env: { 94 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 95 | 'application-template-wrapper': true, 96 | 'default-async-observers': false, 97 | 'template-only-glimmer-components': false, 98 | }), 99 | }, 100 | npm: { 101 | devDependencies: { 102 | 'ember-source': '~3.28.0', 103 | 'ember-cli': '^4.12.0', 104 | }, 105 | ember: { 106 | edition: 'classic', 107 | }, 108 | }, 109 | }, 110 | embroiderSafe(), 111 | embroiderOptimized(), 112 | ], 113 | }; 114 | }; 115 | -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (environment) { 4 | const ENV = { 5 | modulePrefix: 'dummy', 6 | environment, 7 | rootURL: '/', 8 | locationType: 'history', 9 | EmberENV: { 10 | EXTEND_PROTOTYPES: false, 11 | FEATURES: { 12 | // Here you can enable experimental features on an ember canary build 13 | // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true 14 | }, 15 | }, 16 | 17 | APP: { 18 | // Here you can pass flags/options to your application instance 19 | // when it is created 20 | }, 21 | }; 22 | 23 | if (environment === 'development') { 24 | // ENV.APP.LOG_RESOLVER = true; 25 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 26 | // ENV.APP.LOG_TRANSITIONS = true; 27 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 28 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 29 | } 30 | 31 | if (environment === 'test') { 32 | // Testem prefers this... 33 | ENV.locationType = 'none'; 34 | 35 | // keep test console output quieter 36 | ENV.APP.LOG_ACTIVE_GENERATION = false; 37 | ENV.APP.LOG_VIEW_LOOKUPS = false; 38 | 39 | ENV.APP.rootElement = '#ember-testing'; 40 | ENV.APP.autoboot = false; 41 | } 42 | 43 | if (environment === 'production') { 44 | // here you can enable a production-specific feature 45 | } 46 | 47 | return ENV; 48 | }; 49 | -------------------------------------------------------------------------------- /tests/dummy/config/optional-features.json: -------------------------------------------------------------------------------- 1 | { 2 | "application-template-wrapper": false, 3 | "default-async-observers": true, 4 | "jquery-integration": false, 5 | "template-only-glimmer-components": true 6 | } 7 | -------------------------------------------------------------------------------- /tests/dummy/config/targets.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const browsers = [ 4 | 'last 1 Chrome versions', 5 | 'last 1 Firefox versions', 6 | 'last 1 Safari versions', 7 | ]; 8 | 9 | module.exports = { 10 | browsers, 11 | }; 12 | -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/helpers/debug-test.js: -------------------------------------------------------------------------------- 1 | import { DEBUG } from '@glimmer/env'; 2 | import { test } from 'qunit'; 3 | 4 | export default function debugTest(description, callback) { 5 | // eslint-disable-next-line qunit/require-expect 6 | return test(description, function (assert) { 7 | if (!DEBUG) { 8 | assert.pushResult({ 9 | result: true, 10 | message: 'debug functions are disabled', 11 | }); 12 | return; 13 | } 14 | 15 | return callback.apply(this, arguments); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /tests/helpers/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | setupApplicationTest as upstreamSetupApplicationTest, 3 | setupRenderingTest as upstreamSetupRenderingTest, 4 | setupTest as upstreamSetupTest, 5 | } from 'ember-qunit'; 6 | 7 | // This file exists to provide wrappers around ember-qunit's 8 | // test setup functions. This way, you can easily extend the setup that is 9 | // needed per test type. 10 | 11 | function setupApplicationTest(hooks, options) { 12 | upstreamSetupApplicationTest(hooks, options); 13 | 14 | // Additional setup for application tests can be done here. 15 | // 16 | // For example, if you need an authenticated session for each 17 | // application test, you could do: 18 | // 19 | // hooks.beforeEach(async function () { 20 | // await authenticateSession(); // ember-simple-auth 21 | // }); 22 | // 23 | // This is also a good place to call test setup functions coming 24 | // from other addons: 25 | // 26 | // setupIntl(hooks); // ember-intl 27 | // setupMirage(hooks); // ember-cli-mirage 28 | } 29 | 30 | function setupRenderingTest(hooks, options) { 31 | upstreamSetupRenderingTest(hooks, options); 32 | 33 | // Additional setup for rendering tests can be done here. 34 | } 35 | 36 | function setupTest(hooks, options) { 37 | upstreamSetupTest(hooks, options); 38 | 39 | // Additional setup for unit tests can be done here. 40 | } 41 | 42 | export { setupApplicationTest, setupRenderingTest, setupTest }; 43 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Dummy Tests 6 | 7 | 8 | 9 | {{content-for "head"}} 10 | {{content-for "test-head"}} 11 | 12 | 13 | 14 | 15 | 16 | {{content-for "head-footer"}} 17 | {{content-for "test-head-footer"}} 18 | 19 | 20 | {{content-for "body"}} 21 | {{content-for "test-body"}} 22 | 23 |
24 |
25 |
26 |
27 |
28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | {{content-for "body-footer"}} 37 | {{content-for "test-body-footer"}} 38 | 39 | 40 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import Application from 'dummy/app'; 2 | import config from 'dummy/config/environment'; 3 | import { setApplication } from '@ember/test-helpers'; 4 | import { start } from 'ember-qunit'; 5 | 6 | setApplication(Application.create(config.APP)); 7 | 8 | start(); 9 | -------------------------------------------------------------------------------- /tests/unit/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-cli-deprecation-workflow/d70f32b0f30e63bf1722e8070ecddb3df434ecce/tests/unit/.gitkeep -------------------------------------------------------------------------------- /tests/unit/deprecation-collector-test.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable qunit/require-expect */ 2 | /* eslint no-console: 0 */ 3 | 4 | import { module } from 'qunit'; 5 | import test from '../helpers/debug-test'; 6 | import { deprecationCollector } from 'ember-cli-deprecation-workflow'; 7 | 8 | let originalWarn, originalConfig; 9 | 10 | module('deprecationCollector', function (hooks) { 11 | hooks.beforeEach(function () { 12 | originalWarn = console.warn; 13 | 14 | /* 15 | * Clear config for these tests 16 | */ 17 | originalConfig = self.deprecationWorkflow = { 18 | config: null, 19 | deprecationLog: { 20 | messages: new Set(), 21 | }, 22 | }; 23 | }); 24 | 25 | hooks.afterEach(function () { 26 | self.deprecationWorkflow.config = originalConfig; 27 | self.deprecationWorkflow.deprecationLog = { messages: {} }; 28 | console.warn = originalWarn; 29 | }); 30 | 31 | test('it collects deprecations', function (assert) { 32 | deprecationCollector( 33 | 'First deprecation', 34 | { 35 | id: 'first', 36 | since: 'the beginning', 37 | until: 'forever', 38 | for: 'testing', 39 | }, 40 | () => {}, 41 | ); 42 | deprecationCollector( 43 | 'Second deprecation', 44 | { 45 | id: 'second', 46 | since: 'the beginning', 47 | until: 'forever', 48 | for: 'testing', 49 | }, 50 | () => {}, 51 | ); 52 | 53 | assert.deepEqual( 54 | self.deprecationWorkflow.deprecationLog.messages, 55 | new Set(['first', 'second']), 56 | ); 57 | }); 58 | 59 | test('should call next', function (assert) { 60 | assert.expect(1); 61 | 62 | function next() { 63 | assert.ok(true, 'next has been called'); 64 | } 65 | 66 | deprecationCollector( 67 | 'First deprecation', 68 | { 69 | id: 'first', 70 | since: 'the beginning', 71 | until: 'forever', 72 | for: 'testing', 73 | }, 74 | next, 75 | ); 76 | }); 77 | 78 | test('deprecations are not duplicated', function (assert) { 79 | deprecationCollector( 80 | 'First deprecation', 81 | { 82 | id: 'first', 83 | since: 'the beginning', 84 | until: 'forever', 85 | for: 'testing', 86 | }, 87 | () => {}, 88 | ); 89 | deprecationCollector( 90 | 'Second deprecation', 91 | { 92 | id: 'second', 93 | since: 'the beginning', 94 | until: 'forever', 95 | for: 'testing', 96 | }, 97 | () => {}, 98 | ); 99 | 100 | // do it again 101 | deprecationCollector( 102 | 'First deprecation', 103 | { 104 | id: 'first', 105 | since: 'the beginning', 106 | until: 'forever', 107 | for: 'testing', 108 | }, 109 | () => {}, 110 | ); 111 | deprecationCollector( 112 | 'Second deprecation', 113 | { 114 | id: 'second', 115 | since: 'the beginning', 116 | until: 'forever', 117 | for: 'testing', 118 | }, 119 | () => {}, 120 | ); 121 | 122 | assert.deepEqual( 123 | self.deprecationWorkflow.deprecationLog.messages, 124 | new Set(['first', 'second']), 125 | ); 126 | }); 127 | }); 128 | -------------------------------------------------------------------------------- /tests/unit/flush-deprecations-test.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console: 0 */ 2 | 3 | import { module } from 'qunit'; 4 | import test from '../helpers/debug-test'; 5 | import { flushDeprecations } from 'ember-cli-deprecation-workflow'; 6 | 7 | let originalWarn, originalConfig; 8 | 9 | module('flushDeprecations', function (hooks) { 10 | hooks.beforeEach(function () { 11 | originalWarn = console.warn; 12 | 13 | /* 14 | * Clear config for these tests 15 | */ 16 | originalConfig = self.deprecationWorkflow = { 17 | config: null, 18 | deprecationLog: { 19 | messages: new Set(), 20 | }, 21 | }; 22 | }); 23 | 24 | hooks.afterEach(function () { 25 | self.deprecationWorkflow.config = originalConfig; 26 | self.deprecationWorkflow.deprecationLog = { messages: new Set() }; 27 | console.warn = originalWarn; 28 | }); 29 | 30 | test('calling flushDeprecations returns workflow config', function (assert) { 31 | self.deprecationWorkflow.deprecationLog.messages = new Set([ 32 | 'first', 33 | 'second', 34 | ]); 35 | 36 | let deprecationsPayload = flushDeprecations(); 37 | let expectedConfig = { 38 | workflow: [ 39 | { handler: 'silence', matchId: 'first' }, 40 | { handler: 'silence', matchId: 'second' }, 41 | ], 42 | }; 43 | 44 | assert.strictEqual( 45 | deprecationsPayload, 46 | `import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 47 | 48 | setupDeprecationWorkflow(${JSON.stringify(expectedConfig, undefined, 2)});`, 49 | ); 50 | }); 51 | 52 | test('calling flushDeprecations with custom handler returns workflow config', function (assert) { 53 | self.deprecationWorkflow.deprecationLog.messages = new Set([ 54 | 'first', 55 | 'second', 56 | ]); 57 | 58 | let deprecationsPayload = flushDeprecations({ handler: 'log' }); 59 | let expectedConfig = { 60 | workflow: [ 61 | { handler: 'log', matchId: 'first' }, 62 | { handler: 'log', matchId: 'second' }, 63 | ], 64 | }; 65 | 66 | assert.strictEqual( 67 | deprecationsPayload, 68 | `import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 69 | 70 | setupDeprecationWorkflow(${JSON.stringify(expectedConfig, undefined, 2)});`, 71 | ); 72 | }); 73 | 74 | test('calling flushDeprecations with existing config and no deprecations returns original config', function (assert) { 75 | let config = { 76 | throwOnUnhandled: true, 77 | workflow: [{ handler: 'log', matchId: 'existing' }], 78 | }; 79 | self.deprecationWorkflow.deprecationLog.messages = new Set([]); 80 | 81 | let deprecationsPayload = flushDeprecations({ config }); 82 | assert.strictEqual( 83 | deprecationsPayload, 84 | `import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 85 | 86 | setupDeprecationWorkflow(${JSON.stringify(config, undefined, 2)});`, 87 | ); 88 | }); 89 | 90 | test('calling flushDeprecations with existing config returns augmented config', function (assert) { 91 | let config = { 92 | throwOnUnhandled: true, 93 | workflow: [{ handler: 'log', matchId: 'existing' }], 94 | }; 95 | self.deprecationWorkflow.deprecationLog.messages = new Set([ 96 | 'first', 97 | 'second', 98 | ]); 99 | 100 | let deprecationsPayload = flushDeprecations({ config }); 101 | let expectedConfig = { 102 | throwOnUnhandled: true, 103 | workflow: [ 104 | { handler: 'log', matchId: 'existing' }, 105 | { handler: 'silence', matchId: 'first' }, 106 | { handler: 'silence', matchId: 'second' }, 107 | ], 108 | }; 109 | assert.strictEqual( 110 | deprecationsPayload, 111 | `import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 112 | 113 | setupDeprecationWorkflow(${JSON.stringify(expectedConfig, undefined, 2)});`, 114 | ); 115 | }); 116 | 117 | test('calling flushDeprecations with existing config does not override existing deprecations', function (assert) { 118 | let config = { 119 | throwOnUnhandled: true, 120 | workflow: [{ handler: 'log', matchId: 'existing' }], 121 | }; 122 | self.deprecationWorkflow.deprecationLog.messages = new Set([ 123 | 'first', 124 | 'second', 125 | 'existing', 126 | ]); 127 | 128 | let deprecationsPayload = flushDeprecations({ config }); 129 | let expectedConfig = { 130 | throwOnUnhandled: true, 131 | workflow: [ 132 | { handler: 'log', matchId: 'existing' }, 133 | { handler: 'silence', matchId: 'first' }, 134 | { handler: 'silence', matchId: 'second' }, 135 | ], 136 | }; 137 | assert.strictEqual( 138 | deprecationsPayload, 139 | `import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow'; 140 | 141 | setupDeprecationWorkflow(${JSON.stringify(expectedConfig, undefined, 2)});`, 142 | ); 143 | }); 144 | }); 145 | -------------------------------------------------------------------------------- /tests/unit/handle-deprecation-workflow-test.js: -------------------------------------------------------------------------------- 1 | /* eslint no-console: 0 */ 2 | 3 | import { module } from 'qunit'; 4 | import test from '../helpers/debug-test'; 5 | import { handleDeprecationWorkflow } from 'ember-cli-deprecation-workflow'; 6 | 7 | let originalWarn, originalConfig; 8 | 9 | module('handleDeprecationWorkflow', function (hooks) { 10 | hooks.beforeEach(function () { 11 | originalWarn = console.warn; 12 | 13 | /* 14 | * Clear config for these tests 15 | */ 16 | originalConfig = self.deprecationWorkflow = { 17 | config: null, 18 | deprecationLog: { 19 | messages: {}, 20 | }, 21 | }; 22 | }); 23 | 24 | hooks.afterEach(function () { 25 | self.deprecationWorkflow.config = originalConfig; 26 | self.deprecationWorkflow.deprecationLog = { messages: {} }; 27 | console.warn = originalWarn; 28 | }); 29 | 30 | test('specifying `throwOnUnhandled` as true raises', function (assert) { 31 | const config = { 32 | throwOnUnhandled: true, 33 | workflow: [{ handler: 'silence', matchMessage: 'Sshhhhh!!' }], 34 | }; 35 | 36 | assert.throws( 37 | function () { 38 | handleDeprecationWorkflow( 39 | config, 40 | 'Foobarrrzzzz', 41 | { 42 | since: 'the beginning', 43 | until: 'forever', 44 | id: 'foobar', 45 | for: 'testing', 46 | }, 47 | () => {}, 48 | ); 49 | }, 50 | /Foobarrrzzzz/, 51 | 'setting raiseOnUnhandled throws for unknown workflows', 52 | ); 53 | 54 | handleDeprecationWorkflow( 55 | config, 56 | 'Sshhhhh!!', 57 | { 58 | id: 'quiet', 59 | since: 'the beginning', 60 | until: 'forever', 61 | for: 'testing', 62 | }, 63 | () => {}, 64 | ); 65 | assert.ok(true, 'did not throw when silenced'); 66 | }); 67 | 68 | test('specifying `throwOnUnhandled` as false does nothing', function (assert) { 69 | const config = { 70 | throwOnUnhandled: false, 71 | }; 72 | 73 | handleDeprecationWorkflow( 74 | config, 75 | 'Sshhhhh!!', 76 | { 77 | id: 'quiet', 78 | since: 'the beginning', 79 | until: 'forever', 80 | for: 'testing', 81 | }, 82 | () => {}, 83 | ); 84 | 85 | assert.ok(true, 'does not die when throwOnUnhandled is false'); 86 | }); 87 | 88 | test('deprecation silenced with string matcher', function (assert) { 89 | const config = { 90 | throwOnUnhandled: true, 91 | workflow: [{ matchMessage: 'Interesting', handler: 'silence' }], 92 | }; 93 | 94 | handleDeprecationWorkflow(config, 'Interesting', { 95 | id: 'interesting', 96 | since: 'the beginning', 97 | until: 'forever', 98 | for: 'testing', 99 | }); 100 | assert.ok(true, 'Deprecation did not raise'); 101 | }); 102 | 103 | // eslint-disable-next-line qunit/require-expect 104 | test('deprecation logs with string matcher', function (assert) { 105 | assert.expect(1); 106 | 107 | let message = 'Interesting'; 108 | console.warn = function (passedMessage) { 109 | assert.strictEqual( 110 | passedMessage.indexOf('DEPRECATION: ' + message), 111 | 0, 112 | 'deprecation logs', 113 | ); 114 | }; 115 | 116 | const config = { 117 | throwOnUnhandled: true, 118 | workflow: [{ matchMessage: message, handler: 'log' }], 119 | }; 120 | 121 | handleDeprecationWorkflow( 122 | config, 123 | message, 124 | { 125 | since: 'the beginning', 126 | until: 'forever', 127 | id: 'interesting', 128 | for: 'testing', 129 | }, 130 | () => {}, 131 | ); 132 | }); 133 | 134 | test('deprecation thrown with string matcher', function (assert) { 135 | const config = { 136 | workflow: [{ matchMessage: 'Interesting', handler: 'throw' }], 137 | }; 138 | 139 | assert.throws(function () { 140 | handleDeprecationWorkflow( 141 | config, 142 | 'Interesting', 143 | { 144 | id: 'interesting', 145 | since: 'the beginning', 146 | until: 'forever', 147 | for: 'testing', 148 | }, 149 | () => {}, 150 | ); 151 | }, 'deprecation throws'); 152 | }); 153 | 154 | test('deprecation silenced with regex matcher', function (assert) { 155 | const config = { 156 | throwOnUnhandled: true, 157 | workflow: [{ matchMessage: /Inter/, handler: 'silence' }], 158 | }; 159 | 160 | handleDeprecationWorkflow( 161 | config, 162 | 'Interesting', 163 | { 164 | id: 'interesting', 165 | since: 'the beginning', 166 | until: 'forever', 167 | for: 'testing', 168 | }, 169 | () => {}, 170 | ); 171 | 172 | assert.ok(true, 'Deprecation did not raise'); 173 | }); 174 | 175 | // eslint-disable-next-line qunit/require-expect 176 | test('deprecation logs with regex matcher', function (assert) { 177 | assert.expect(1); 178 | 179 | let message = 'Interesting'; 180 | 181 | console.warn = function (passedMessage) { 182 | assert.strictEqual( 183 | passedMessage, 184 | 'DEPRECATION: ' + message, 185 | 'deprecation logs', 186 | ); 187 | }; 188 | 189 | const config = { 190 | throwOnUnhandled: true, 191 | workflow: [{ matchMessage: /Inter/, handler: 'log' }], 192 | }; 193 | 194 | handleDeprecationWorkflow( 195 | config, 196 | message, 197 | { 198 | id: 'interesting', 199 | since: 'the beginning', 200 | until: 'forever', 201 | for: 'testing', 202 | }, 203 | () => {}, 204 | ); 205 | }); 206 | 207 | test('deprecation thrown with regex matcher', function (assert) { 208 | const config = { 209 | workflow: [{ matchMessage: /Inter/, handler: 'throw' }], 210 | }; 211 | 212 | assert.throws(function () { 213 | handleDeprecationWorkflow( 214 | config, 215 | 'Interesting', 216 | { 217 | id: 'interesting', 218 | since: 'the beginning', 219 | until: 'forever', 220 | for: 'testing', 221 | }, 222 | () => {}, 223 | ); 224 | }, 'deprecation throws'); 225 | }); 226 | 227 | test('deprecation thrown with string matcher with parens', function (assert) { 228 | let message = 229 | 'Some string that includes (). If treated like a regexp this will not match.'; 230 | 231 | const config = { 232 | workflow: [{ matchMessage: message, handler: 'throw' }], 233 | }; 234 | 235 | assert.throws(function () { 236 | handleDeprecationWorkflow( 237 | config, 238 | message, 239 | { 240 | id: 'throws', 241 | since: 'the beginning', 242 | until: 'forever', 243 | for: 'testing', 244 | }, 245 | () => {}, 246 | ); 247 | }, 'deprecation throws'); 248 | }); 249 | 250 | test('deprecation silenced with id matcher', function (assert) { 251 | const config = { 252 | throwOnUnhandled: true, 253 | workflow: [{ matchId: 'ember.deprecation-workflow', handler: 'silence' }], 254 | }; 255 | 256 | handleDeprecationWorkflow( 257 | config, 258 | 'Slightly interesting', 259 | { 260 | id: 'ember.deprecation-workflow', 261 | since: 'the beginning', 262 | until: '3.0.0', 263 | for: 'testing', 264 | }, 265 | () => {}, 266 | ); 267 | 268 | assert.ok(true, 'Deprecation did not raise'); 269 | }); 270 | 271 | // eslint-disable-next-line qunit/require-expect 272 | test('deprecation logs with id matcher', function (assert) { 273 | assert.expect(1); 274 | 275 | let message = 'Slightly interesting'; 276 | 277 | console.warn = function (passedMessage) { 278 | assert.strictEqual( 279 | passedMessage, 280 | 'DEPRECATION: ' + message, 281 | 'deprecation logs', 282 | ); 283 | }; 284 | 285 | const config = { 286 | throwOnUnhandled: true, 287 | workflow: [{ matchId: 'ember.deprecation-workflow', handler: 'log' }], 288 | }; 289 | 290 | handleDeprecationWorkflow( 291 | config, 292 | 'Slightly interesting', 293 | { 294 | id: 'ember.deprecation-workflow', 295 | since: 'the beginning', 296 | until: '3.0.0', 297 | for: 'testing', 298 | }, 299 | () => {}, 300 | ); 301 | }); 302 | 303 | test('deprecation thrown with id matcher', function (assert) { 304 | const config = { 305 | workflow: [{ matchId: 'ember.deprecation-workflow', handler: 'throw' }], 306 | }; 307 | assert.throws(function () { 308 | handleDeprecationWorkflow( 309 | config, 310 | 'Slightly interesting', 311 | { 312 | id: 'ember.deprecation-workflow', 313 | since: 'the beginning', 314 | until: '3.0.0', 315 | for: 'testing', 316 | }, 317 | () => {}, 318 | ); 319 | }, 'deprecation throws'); 320 | }); 321 | 322 | test('deprecation silenced with id regex', function (assert) { 323 | const config = { 324 | throwOnUnhandled: true, 325 | workflow: [{ matchId: /^ember\..*/, handler: 'silence' }], 326 | }; 327 | 328 | handleDeprecationWorkflow( 329 | config, 330 | 'Slightly interesting', 331 | { 332 | id: 'ember.deprecation-workflow', 333 | since: 'the beginning', 334 | until: '3.0.0', 335 | for: 'testing', 336 | }, 337 | () => {}, 338 | ); 339 | 340 | assert.ok(true, 'Deprecation did not raise'); 341 | }); 342 | 343 | // eslint-disable-next-line qunit/require-expect 344 | test('deprecation logs with id regex', function (assert) { 345 | assert.expect(1); 346 | 347 | let message = 'Slightly interesting'; 348 | 349 | console.warn = function (passedMessage) { 350 | assert.strictEqual( 351 | passedMessage, 352 | 'DEPRECATION: ' + message, 353 | 'deprecation logs', 354 | ); 355 | }; 356 | 357 | const config = { 358 | throwOnUnhandled: true, 359 | workflow: [{ matchId: /^ember\..*/, handler: 'log' }], 360 | }; 361 | 362 | handleDeprecationWorkflow( 363 | config, 364 | 'Slightly interesting', 365 | { 366 | id: 'ember.deprecation-workflow', 367 | since: 'the beginning', 368 | until: '3.0.0', 369 | for: 'testing', 370 | }, 371 | () => {}, 372 | ); 373 | }); 374 | 375 | test('deprecation thrown with id regex', function (assert) { 376 | const config = { 377 | workflow: [{ matchId: /^ember\..*/, handler: 'throw' }], 378 | }; 379 | assert.throws(function () { 380 | handleDeprecationWorkflow( 381 | config, 382 | 'Slightly interesting', 383 | { 384 | id: 'ember.deprecation-workflow', 385 | since: 'the beginning', 386 | until: '3.0.0', 387 | for: 'testing', 388 | }, 389 | () => {}, 390 | ); 391 | }, 'deprecation throws'); 392 | }); 393 | }); 394 | -------------------------------------------------------------------------------- /tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declarationDir": "declarations", 5 | "emitDeclarationOnly": true, 6 | "noEmit": false, 7 | "rootDir": "." 8 | }, 9 | "include": ["addon", "addon-test-support"] 10 | } 11 | -------------------------------------------------------------------------------- /vendor/ember-cli-deprecation-workflow/main.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-empty */ 2 | /* global require */ 3 | 4 | (function () { 5 | try { 6 | require('ember-cli-deprecation-workflow').default(); 7 | } catch (e) {} 8 | })(); 9 | --------------------------------------------------------------------------------