├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github ├── dependabot.yml └── workflows │ ├── ci-build.yml │ └── publish-to-branch.yml ├── .github_changelog_generator ├── .gitignore ├── .prettierignore ├── .prettierrc.js ├── .template-lintrc.js ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── LICENSE.md ├── README.md ├── RELEASE.md ├── addon ├── .gitignore ├── .npmignore ├── addon │ ├── index.js │ ├── string │ │ ├── cache.js │ │ └── index.js │ └── utils │ │ └── class-factory.js ├── index.d.ts ├── index.js └── package.json ├── package-lock.json ├── package.json └── test-app ├── .ember-cli ├── .gitignore ├── .watchmanconfig ├── app ├── app.js ├── components │ └── .gitkeep ├── controllers │ └── .gitkeep ├── helpers │ └── .gitkeep ├── index.html ├── models │ └── .gitkeep ├── resolver.js ├── router.js ├── routes │ └── .gitkeep ├── styles │ └── app.css └── templates │ └── application.hbs ├── config ├── ember-cli-update.json ├── ember-try.js ├── environment.js ├── optional-features.json ├── release.js └── targets.js ├── ember-cli-build.js ├── package.json ├── public ├── crossdomain.xml └── robots.txt ├── server └── index.js ├── testem.js └── tests ├── helpers ├── create-test-function.js └── resolver.js ├── index.html ├── test-helper.js └── unit ├── classify_test.js ├── dasherize_test.js ├── decamelize_test.js ├── resolvers └── classic │ ├── -setup-resolver.js │ ├── basic-test.js │ ├── custom-prefixes-test.js │ ├── pods-test.js │ └── with-modues-test.js └── underscore_test.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 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.hbs] 17 | insert_final_newline = false 18 | 19 | [*.{diff,md}] 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | /vendor/ 4 | 5 | # compiled output 6 | /test-app/dist/ 7 | /test-app/tmp/ 8 | 9 | # dependencies 10 | /bower_components/ 11 | /node_modules/ 12 | 13 | # misc 14 | /coverage/ 15 | !.* 16 | 17 | # ember-try 18 | /.node_modules.ember-try/ 19 | /bower.json.ember-try 20 | /package.json.ember-try 21 | -------------------------------------------------------------------------------- /.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 | './addon/index.js', 35 | './addon/config/**/*.js', 36 | './test-app/testem.js', 37 | './test-app/tests/dummy/config/**/*.js', 38 | './test-app/server/**/*.js', 39 | './test-app/testem.js', 40 | './test-app/config/**/*.js', 41 | './test-app/ember-cli-build.js', 42 | ], 43 | parserOptions: { 44 | sourceType: 'script', 45 | }, 46 | env: { 47 | browser: false, 48 | node: true, 49 | }, 50 | extends: ['plugin:n/recommended'], 51 | }, 52 | { 53 | // test files 54 | files: ['tests/**/*-test.{js,ts}'], 55 | extends: ['plugin:qunit/recommended'], 56 | }, 57 | ], 58 | }; 59 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | time: "03:00" 8 | open-pull-requests-limit: 10 9 | versioning-strategy: increase 10 | - package-ecosystem: github-actions 11 | directory: "/" 12 | schedule: 13 | interval: weekly 14 | open-pull-requests-limit: 10 15 | -------------------------------------------------------------------------------- /.github/workflows/ci-build.yml: -------------------------------------------------------------------------------- 1 | name: CI Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - main 8 | - release* 9 | - 'v*' 10 | tags: 11 | - '*' 12 | pull_request: 13 | schedule: 14 | - cron: '0 3 * * *' # daily, at 3am 15 | 16 | concurrency: 17 | group: ci-${{ github.head_ref || github.ref }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | test: 22 | timeout-minutes: 10 23 | name: Tests 24 | runs-on: ubuntu-latest 25 | 26 | steps: 27 | - uses: actions/checkout@v3 28 | - uses: volta-cli/action@v4 29 | - uses: actions/cache@v3 30 | id: npm-cache 31 | with: 32 | path: '**/node_modules' 33 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 34 | restore-keys: | 35 | ${{ runner.os }}-npm- 36 | - name: npm ci 37 | if: steps.npm-cache.outputs.cache-hit != 'true' 38 | run: npm ci 39 | - run: npm run lint 40 | - run: npm run test:ember 41 | working-directory: ./test-app/ 42 | 43 | floating-dependencies: 44 | timeout-minutes: 10 45 | name: "Floating Dependencies" 46 | runs-on: ubuntu-latest 47 | 48 | steps: 49 | - uses: actions/checkout@v3 50 | - uses: volta-cli/action@v4 51 | with: 52 | node-version: 16.x 53 | - run: npm install --no-shrinkwrap 54 | - run: npm test 55 | working-directory: ./test-app/ 56 | 57 | try-scenarios: 58 | timeout-minutes: 10 59 | name: "Try: ${{ matrix.ember-try-scenario }}" 60 | 61 | runs-on: ubuntu-latest 62 | 63 | needs: test 64 | 65 | strategy: 66 | fail-fast: false 67 | matrix: 68 | ember-try-scenario: 69 | - ember-lts-4.12 70 | - ember-lts-5.4 71 | - ember-lts-5.8 72 | - ember-release 73 | - ember-beta 74 | - ember-canary 75 | - embroider-safe 76 | - embroider-optimized 77 | 78 | steps: 79 | - uses: actions/checkout@v3 80 | - uses: volta-cli/action@v4 81 | with: 82 | node-version: 16.x 83 | - uses: actions/cache@v3 84 | id: npm-cache 85 | with: 86 | path: '**/node_modules' 87 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 88 | restore-keys: | 89 | ${{ runner.os }}-npm- 90 | - name: npm ci 91 | if: steps.npm-cache.outputs.cache-hit != 'true' 92 | run: npm ci 93 | - name: test 94 | run: npx ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup 95 | working-directory: ./test-app/ 96 | 97 | publish: 98 | name: Publish to npm 99 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') 100 | runs-on: ubuntu-latest 101 | steps: 102 | - name: Checkout 103 | uses: actions/checkout@v3 104 | 105 | - name: Install node 106 | uses: volta-cli/action@v4 107 | with: 108 | node-version: 16.x 109 | registry-url: 'https://registry.npmjs.org' 110 | 111 | - uses: actions/cache@v3 112 | id: npm-cache 113 | with: 114 | path: '**/node_modules' 115 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 116 | restore-keys: | 117 | ${{ runner.os }}-npm- 118 | 119 | - name: install dependencies 120 | if: steps.npm-cache.outputs.cache-hit != 'true' 121 | run: npm ci 122 | 123 | - name: auto-dist-tag 124 | run: npx auto-dist-tag --write 125 | working-directory: './addon/' 126 | 127 | - name: publish to npm 128 | run: npm publish 129 | env: 130 | NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH }} 131 | working-directory: './addon/' 132 | -------------------------------------------------------------------------------- /.github/workflows/publish-to-branch.yml: -------------------------------------------------------------------------------- 1 | name: Publish to branch 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | 9 | jobs: 10 | push-dist: 11 | name: Push dist to branch to see built contents 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: volta-cli/action@v4 16 | with: 17 | node-version: 16.x 18 | - uses: actions/cache@v3 19 | id: npm-cache 20 | with: 21 | path: '**/node_modules' 22 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} 23 | restore-keys: | 24 | ${{ runner.os }}-npm- 25 | - name: npm ci 26 | if: steps.npm-cache.outputs.cache-hit != 'true' 27 | run: npm ci 28 | - uses: kategengler/put-built-npm-package-contents-on-branch@v1.0.0 29 | with: 30 | branch: dist 31 | token: ${{ secrets.GITHUB_TOKEN }} 32 | working-directory: ./addon/ 33 | -------------------------------------------------------------------------------- /.github_changelog_generator: -------------------------------------------------------------------------------- 1 | user=ember-cli 2 | project=ember-resolver 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | # and you can put in anything else that tends to accumulate in your environment: 4 | yarn-error.log 5 | .DS_Store 6 | /testem.log 7 | /test-app/dist/ 8 | /test-app/tmp/ 9 | 10 | # ember-try 11 | /test-app/.node_modules.ember-try/ 12 | /test-app/package.json.ember-try 13 | 14 | /.eslintcache 15 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # unconventional js 2 | /blueprints/*/files/ 3 | /vendor/ 4 | 5 | # compiled output 6 | /dist/ 7 | /tmp/ 8 | 9 | # dependencies 10 | /bower_components/ 11 | /node_modules/ 12 | 13 | # misc 14 | /coverage/ 15 | !.* 16 | .eslintcache 17 | .lint-todo/ 18 | 19 | # ember-try 20 | /.node_modules.ember-try/ 21 | /bower.json.ember-try 22 | /npm-shrinkwrap.json.ember-try 23 | /package.json.ember-try 24 | /package-lock.json.ember-try 25 | /yarn.lock.ember-try 26 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.template-lintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | extends: 'recommended', 5 | }; 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ## v13.1.1 (2025-05-16) 15 | 16 | #### :bug: Bug Fix 17 | * [#987](https://github.com/ember-cli/ember-resolver/pull/987) Remove unneeded peer declaration ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 18 | 19 | #### :house: Internal 20 | * [#988](https://github.com/ember-cli/ember-resolver/pull/988) Add packageManager ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 21 | 22 | #### Committers: 1 23 | - [@NullVoxPopuli](https://github.com/NullVoxPopuli) 24 | 25 | ## v13.1.0 (2024-11-19) 26 | 27 | #### :rocket: Enhancement 28 | * [#986](https://github.com/ember-cli/ember-resolver/pull/986) Extending withModules module to support dynamically added modules ([@ef4](https://github.com/ef4)) 29 | 30 | #### Committers: 1 31 | - Edward Faulkner ([@ef4](https://github.com/ef4)) 32 | 33 | ## v13.0.2 (2024-09-24) 34 | 35 | #### :bug: Bug Fix 36 | * [#985](https://github.com/ember-cli/ember-resolver/pull/985) Fix static-this type error ([@ef4](https://github.com/ef4)) 37 | 38 | #### Committers: 1 39 | - Edward Faulkner ([@ef4](https://github.com/ef4)) 40 | 41 | ## v13.0.1 (2024-09-16) 42 | 43 | #### :bug: Bug Fix 44 | * [#982](https://github.com/ember-cli/ember-resolver/pull/982) Give TS tooling an extra hint where the default index.d.ts is ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 45 | 46 | #### :house: Internal 47 | * [#980](https://github.com/ember-cli/ember-resolver/pull/980) Copy README.md and LICENSE.md to addon folder during release ([@SergeAstapov](https://github.com/SergeAstapov)) 48 | 49 | #### Committers: 2 50 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov)) 51 | - [@NullVoxPopuli](https://github.com/NullVoxPopuli) 52 | 53 | ## v13.0.0 (2024-09-11) 54 | 55 | #### :boom: Breaking Change 56 | * [#977](https://github.com/ember-cli/ember-resolver/pull/977) Convert to plain library and drop deprecated behaviors ([@ef4](https://github.com/ef4)) 57 | 58 | #### :rocket: Enhancement 59 | * [#979](https://github.com/ember-cli/ember-resolver/pull/979) Optional explicit modules ([@ef4](https://github.com/ef4)) 60 | 61 | #### :bug: Bug Fix 62 | * [#978](https://github.com/ember-cli/ember-resolver/pull/978) hide global require from webpack ([@ef4](https://github.com/ef4)) 63 | 64 | #### Committers: 1 65 | - Edward Faulkner ([@ef4](https://github.com/ef4)) 66 | 67 | ## v12.0.1 (2024-06-11) 68 | 69 | #### :bug: Bug Fix 70 | * [#976](https://github.com/ember-cli/ember-resolver/pull/976) Fix peer range for ember-source ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 71 | 72 | #### Committers: 1 73 | - [@NullVoxPopuli](https://github.com/NullVoxPopuli) 74 | 75 | ## v12.0.0 (2024-06-07) 76 | 77 | #### :boom: Breaking Change 78 | * [#973](https://github.com/ember-cli/ember-resolver/pull/973) Do not use global ember -- drop support for ember-source < 4.12 ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 79 | 80 | #### :house: Internal 81 | * [#974](https://github.com/ember-cli/ember-resolver/pull/974) Update test format to modern qunit ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 82 | 83 | #### Committers: 1 84 | - [@NullVoxPopuli](https://github.com/NullVoxPopuli) 85 | 86 | ## v11.0.1 (2023-08-15) 87 | 88 | #### :bug: Bug Fix 89 | * [#951](https://github.com/ember-cli/ember-resolver/pull/951) fix: update docs around pluralizedTypes and type the field ([@SergeAstapov](https://github.com/SergeAstapov)) 90 | 91 | #### Committers: 1 92 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov)) 93 | 94 | ## v11.0.0 (2023-07-25) 95 | 96 | #### :boom: Breaking Change 97 | * [#906](https://github.com/ember-cli/ember-resolver/pull/906) Simplify repository structure (remove `addon/resolvers/classic`) ([@rwjblue](https://github.com/rwjblue)) 98 | * [#904](https://github.com/ember-cli/ember-resolver/pull/904) Remove `container-debug-adapter` initializer ([@rwjblue](https://github.com/rwjblue)) 99 | 100 | #### :bug: Bug Fix 101 | * [#916](https://github.com/ember-cli/ember-resolver/pull/916) Loosen peer dependency on ember-source to support ember-source >= v5.0 ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 102 | 103 | #### :rocket: Enhancement 104 | * [#933](https://github.com/ember-cli/ember-resolver/pull/933) Embed `@ember/string` utils and drop peer dependency on `@ember/string` ([@lifeart](https://github.com/lifeart)) 105 | 106 | #### :house: Internal 107 | * [#905](https://github.com/ember-cli/ember-resolver/pull/905) Drop IE11 from `config/targets.js` ([@rwjblue](https://github.com/rwjblue)) 108 | * [#939](https://github.com/ember-cli/ember-resolver/pull/939) Update to latest Ember LTS ([@kategengler](https://github.com/kategengler)) 109 | 110 | #### Committers: 4 111 | - Alex Kanunnikov ([@lifeart](https://github.com/lifeart)) 112 | - Katie Gengler ([@kategengler](https://github.com/kategengler)) 113 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 114 | - [@NullVoxPopuli](https://github.com/NullVoxPopuli) 115 | 116 | ## v10.1.0 (2023-05-02) 117 | 118 | #### :rocket: Enhancement 119 | * [#902](https://github.com/ember-cli/ember-resolver/pull/902) Convert Resolver to Native Class ([@elwayman02](https://github.com/elwayman02)) 120 | 121 | #### Committers: 1 122 | - Jordan Hawker ([@elwayman02](https://github.com/elwayman02)) 123 | 124 | 125 | ## v10.0.0 (2023-01-11) 126 | 127 | #### :boom: Breaking Change :bug: Bug Fix 128 | * [#862](https://github.com/ember-cli/ember-resolver/pull/862) Add @ember/string as a peerDep to indicate the package is required to avoid deprecations in ember-source 4.10 ([@kategengler](https://github.com/kategengler)) 129 | 130 | #### :house: Internal 131 | * [#855](https://github.com/ember-cli/ember-resolver/pull/855) Setup CI releasing ([@kategengler](https://github.com/kategengler)) 132 | * [#856](https://github.com/ember-cli/ember-resolver/pull/856) Update dependabot config to get updates for CI actions ([@kategengler](https://github.com/kategengler)) 133 | * [#854](https://github.com/ember-cli/ember-resolver/pull/854) Update gh action dependencies ([@kategengler](https://github.com/kategengler)) 134 | 135 | #### Committers: 2 136 | - Chris Krycho ([@chriskrycho](https://github.com/chriskrycho)) 137 | - Katie Gengler ([@kategengler](https://github.com/kategengler)) 138 | 139 | 140 | ## v9.0.1 (2022-12-21) 141 | 142 | This was an accidental republication of [v9.0.0](https://github.com/ember-cli/ember-resolver/releases/tag/v9.0.1). 🤦🏼‍♂️ Nothing to see here. 143 | 144 | ## v8.1.0 (2022-12-20) 145 | Back-ports built-in TypeScript support from 9.0.0 (see below) to decouple that from the Ember 4.x upgrade. 146 | 147 | #### :rocket: Enhancement 148 | * [#839](https://github.com/ember-cli/ember-resolver/pull/839) Backport types to 8.x ([@chriskrycho](https://github.com/chriskrycho)) 149 | 150 | #### Committers: 1 151 | - Chris Krycho ([@chriskrycho](https://github.com/chriskrycho)) 152 | 153 | ## v9.0.0 (2022-12-19) 154 | TL;DR: drop some old versions, and ship TypeScript type definitions. 155 | 156 | #### :boom: Breaking Change 157 | * [#835](https://github.com/ember-cli/ember-resolver/pull/835) Drop support for Ember 3.x, add 4.8 to CI ([@chriskrycho](https://github.com/chriskrycho)) 158 | * [#774](https://github.com/ember-cli/ember-resolver/pull/774) Remove CI scenarios for Ember < 3.24 ([@rwjblue](https://github.com/rwjblue)) 159 | * [#758](https://github.com/ember-cli/ember-resolver/pull/758) Remove support for ember-cli < 2.0.0 ([@rwjblue](https://github.com/rwjblue)) 160 | * [#757](https://github.com/ember-cli/ember-resolver/pull/757) Drop support for Node 10, 11, 12, 13, 15, and 17. ([@rwjblue](https://github.com/rwjblue)) 161 | 162 | #### :rocket: Enhancement 163 | * [#823](https://github.com/ember-cli/ember-resolver/pull/823) Feature: Introduce ambient type definitions ([@chriskrycho](https://github.com/chriskrycho)) 164 | 165 | #### :bug: Bug Fix 166 | * [#831](https://github.com/ember-cli/ember-resolver/pull/831) Bugfix/types: `Resolver extends EmberObject` ([@chriskrycho](https://github.com/chriskrycho)) 167 | 168 | #### :memo: Documentation 169 | * [#778](https://github.com/ember-cli/ember-resolver/pull/778) Refactor the README ([@rwjblue](https://github.com/rwjblue)) 170 | 171 | #### :house: Internal 172 | * [#834](https://github.com/ember-cli/ember-resolver/pull/834) Fix release-it config ([@chriskrycho](https://github.com/chriskrycho)) 173 | * [#782](https://github.com/ember-cli/ember-resolver/pull/782) V2 Addon Part 1: Separate test-app from addon ([@rwjblue](https://github.com/rwjblue)) 174 | * [#781](https://github.com/ember-cli/ember-resolver/pull/781) Remove unused dependencies ([@rwjblue](https://github.com/rwjblue)) 175 | * [#780](https://github.com/ember-cli/ember-resolver/pull/780) Add concurrency setup to CI ([@rwjblue](https://github.com/rwjblue)) 176 | * [#779](https://github.com/ember-cli/ember-resolver/pull/779) Migrate to `npm` ([@rwjblue](https://github.com/rwjblue)) 177 | * [#777](https://github.com/ember-cli/ember-resolver/pull/777) Update minimum ember-cli-babel version to 7.26.11 ([@rwjblue](https://github.com/rwjblue)) 178 | * [#714](https://github.com/ember-cli/ember-resolver/pull/714) Update npmignore file ([@SergeAstapov](https://github.com/SergeAstapov)) 179 | * [#776](https://github.com/ember-cli/ember-resolver/pull/776) Add Ember 3.28 and 4.4 CI scenarios ([@rwjblue](https://github.com/rwjblue)) 180 | * [#775](https://github.com/ember-cli/ember-resolver/pull/775) Update Embroider CI scenarios to ^1.8.0 ([@rwjblue](https://github.com/rwjblue)) 181 | * [#772](https://github.com/ember-cli/ember-resolver/pull/772) Update devDependencies to latest. ([@rwjblue](https://github.com/rwjblue)) 182 | * [#773](https://github.com/ember-cli/ember-resolver/pull/773) Remove "classic" edition CI scenarios ([@rwjblue](https://github.com/rwjblue)) 183 | * [#771](https://github.com/ember-cli/ember-resolver/pull/771) Fix CI when using Ember 4+ ([@rwjblue](https://github.com/rwjblue)) 184 | * [#756](https://github.com/ember-cli/ember-resolver/pull/756) Update ember-auto-import to >= 2.4.2 ([@rwjblue](https://github.com/rwjblue)) 185 | 186 | #### Committers: 3 187 | - Chris Krycho ([@chriskrycho](https://github.com/chriskrycho)) 188 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 189 | - Sergey Astapov ([@SergeAstapov](https://github.com/SergeAstapov)) 190 | 191 | ## v8.0.3 (2021-09-09) 192 | 193 | #### :bug: Bug Fix 194 | * [#699](https://github.com/ember-cli/ember-resolver/pull/699) enable embroider scenarios ([@stefanpenner](https://github.com/stefanpenner)) 195 | * [#697](https://github.com/ember-cli/ember-resolver/pull/697) Fix issues with ember-source@4.0.0-beta.1+ ([@stefanpenner](https://github.com/stefanpenner)) 196 | 197 | #### :house: Internal 198 | * [#700](https://github.com/ember-cli/ember-resolver/pull/700) re-roll-lockfile ([@stefanpenner](https://github.com/stefanpenner)) 199 | * [#696](https://github.com/ember-cli/ember-resolver/pull/696) Update test setup to latest ember-qunit / @ember/test-helpers ([@stefanpenner](https://github.com/stefanpenner)) 200 | * [#695](https://github.com/ember-cli/ember-resolver/pull/695) Update ember-cli + ember-source to latest ([@stefanpenner](https://github.com/stefanpenner)) 201 | * [#688](https://github.com/ember-cli/ember-resolver/pull/688) GH Actions ([@stefanpenner](https://github.com/stefanpenner)) 202 | 203 | #### Committers: 2 204 | - Stefan Penner ([@stefanpenner](https://github.com/stefanpenner)) 205 | - [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview) 206 | 207 | 208 | ## v8.0.2 (2020-08-08) 209 | 210 | #### :bug: Bug Fix 211 | * [#590](https://github.com/ember-cli/ember-resolver/pull/590) Revert "Ensure app/foo/index.js can be looked up with foo:main" ([@rwjblue](https://github.com/rwjblue)) 212 | 213 | #### Committers: 1 214 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 215 | 216 | 217 | ## v8.0.1 (2020-08-07) 218 | 219 | #### :bug: Bug Fix 220 | * [#588](https://github.com/ember-cli/ember-resolver/pull/588) Ensure `app/foo/index.js` can be looked up with `foo:main` ([@snewcomer](https://github.com/snewcomer)) 221 | 222 | #### Committers: 1 223 | - Scott Newcomer ([@snewcomer](https://github.com/snewcomer)) 224 | 225 | 226 | ## v8.0.0 (2020-04-11) 227 | 228 | #### :boom: Breaking Change 229 | * [#542](https://github.com/ember-cli/ember-resolver/pull/542) Remove automatic dasherization of modifiers. ([@rwjblue](https://github.com/rwjblue)) 230 | * [#532](https://github.com/ember-cli/ember-resolver/pull/532) Drop support for Node 8 ([@buschtoens](https://github.com/buschtoens)) 231 | 232 | #### :bug: Bug Fix 233 | * [#531](https://github.com/ember-cli/ember-resolver/pull/531) Fix resolving `@scope/name` namespaces ([@buschtoens](https://github.com/buschtoens)) 234 | 235 | #### Committers: 2 236 | - Jan Buschtöns ([@buschtoens](https://github.com/buschtoens)) 237 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 238 | 239 | 240 | ## v7.0.0 (2019-12-18) 241 | 242 | #### :boom: Breaking Change 243 | * [#452](https://github.com/ember-cli/ember-resolver/pull/452) Remove dead module unification code ([@stefanpenner](https://github.com/stefanpenner)) 244 | 245 | #### :rocket: Enhancement 246 | * [#450](https://github.com/ember-cli/ember-resolver/pull/450) remove now defunct v8 optimization ([@stefanpenner](https://github.com/stefanpenner)) 247 | 248 | #### :bug: Bug Fix 249 | * [#475](https://github.com/ember-cli/ember-resolver/pull/475) Fix babel-plugin-debug-macros warning ([@hjdivad](https://github.com/hjdivad)) 250 | 251 | #### Committers: 2 252 | - David J. Hamilton ([@hjdivad](https://github.com/hjdivad)) 253 | - Stefan Penner ([@stefanpenner](https://github.com/stefanpenner)) 254 | 255 | ## v6.0.2 (2019-12-18) 256 | 257 | * Re-release v6.0.0, to avoid SemVer issue with removal of module unification support within 6.x. 258 | 259 | ## v6.0.1 (2019-12-18) 260 | 261 | #### :boom: Breaking Change 262 | * [#452](https://github.com/ember-cli/ember-resolver/pull/452) Remove dead module unification code ([@stefanpenner](https://github.com/stefanpenner)) 263 | 264 | #### :rocket: Enhancement 265 | * [#450](https://github.com/ember-cli/ember-resolver/pull/450) remove now defunct v8 optimization ([@stefanpenner](https://github.com/stefanpenner)) 266 | 267 | #### :bug: Bug Fix 268 | * [#475](https://github.com/ember-cli/ember-resolver/pull/475) Fix babel-plugin-debug-macros warning ([@hjdivad](https://github.com/hjdivad)) 269 | 270 | #### Committers: 2 271 | - David J. Hamilton ([@hjdivad](https://github.com/hjdivad)) 272 | - Stefan Penner ([@stefanpenner](https://github.com/stefanpenner)) 273 | 274 | ## v6.0.0 (2019-11-19) 275 | 276 | #### :boom: Breaking Change 277 | * [#449](https://github.com/ember-cli/ember-resolver/pull/449) Upgrade deps and drop node 6 support ([@stefanpenner](https://github.com/stefanpenner)) 278 | 279 | #### Committers: 1 280 | - Stefan Penner ([@stefanpenner](https://github.com/stefanpenner)) 281 | 282 | ## v5.2.1 (2019-08-09) 283 | 284 | #### :bug: Bug Fix 285 | * [#396](https://github.com/ember-cli/ember-resolver/pull/396) Component and their templates should be normalized the same. ([@rwjblue](https://github.com/rwjblue)) 286 | 287 | #### Committers: 1 288 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 289 | 290 | ## v5.2.0 (2019-08-01) 291 | 292 | #### :bug: Bug Fix 293 | * [#392](https://github.com/ember-cli/ember-resolver/pull/392) Add components to dasherisation exception ([@backspace](https://github.com/backspace)) 294 | 295 | #### :memo: Documentation 296 | * [#376](https://github.com/ember-cli/ember-resolver/pull/376) Add basic project description to README.md. ([@abhilashlr](https://github.com/abhilashlr)) 297 | 298 | #### Committers: 3 299 | - Buck Doyle ([@backspace](https://github.com/backspace)) 300 | - [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview) 301 | - abhilashlr ([@abhilashlr](https://github.com/abhilashlr)) 302 | 303 | ## v5.1.3 (2019-02-22) 304 | 305 | #### :bug: Bug Fix 306 | * [#338](https://github.com/ember-cli/ember-resolver/pull/338) Fix MU `GlimmerResolver.normalize` when `fullName` is not present ([@ppcano](https://github.com/ppcano)) 307 | 308 | #### Committers: 1 309 | - Pepe Cano ([@ppcano](https://github.com/ppcano)) 310 | 311 | ## v5.1.2 (2019-02-21) 312 | 313 | #### :bug: Bug Fix 314 | * [#336](https://github.com/ember-cli/ember-resolver/pull/336) Update modifiers and router-map in MU resolver configuration. ([@rwjblue](https://github.com/rwjblue)) 315 | 316 | #### Committers: 2 317 | - L. Preston Sego III ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 318 | - Robert Jackson ([@rwjblue](https://github.com/rwjblue)) 319 | 320 | ## v5.1.1 (2019-02-15) 321 | 322 | #### :bug: Bug Fix 323 | * [#313](https://github.com/ember-cli/ember-resolver/pull/313) fix(glimmer-wrapper): move debug `normalize` in `.extend()` block ([@buschtoens](https://github.com/buschtoens)) 324 | 325 | #### Committers: 1 326 | - Jan Buschtöns ([@buschtoens](https://github.com/buschtoens)) 327 | 328 | ## v5.1.0 (2019-02-15) 329 | 330 | #### :rocket: Enhancement 331 | * [#295](https://github.com/ember-cli/ember-resolver/pull/295) Remove deprecated legacy shims ([@Turbo87](https://github.com/Turbo87)) 332 | 333 | #### :bug: Bug Fix 334 | * [#330](https://github.com/ember-cli/ember-resolver/pull/330) Support engine resolution in scoped packages ([@dfreeman](https://github.com/dfreeman)) 335 | * [#300](https://github.com/ember-cli/ember-resolver/pull/300) fix(glimmer-wrapper): add `normalize` method for `Registry#has` ([@buschtoens](https://github.com/buschtoens)) 336 | * [#247](https://github.com/ember-cli/ember-resolver/pull/247) Fix MU for deeply nested classic components ([@simonihmig](https://github.com/simonihmig)) 337 | * [#301](https://github.com/ember-cli/ember-resolver/pull/301) Add component-manager and modifier-manager to default module unification configuration ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 338 | 339 | #### :memo: Documentation 340 | * [#316](https://github.com/ember-cli/ember-resolver/pull/316) Adds changelog entry for version v5.0.0 ([@NLincoln](https://github.com/NLincoln)) 341 | 342 | #### :house: Internal 343 | * [#310](https://github.com/ember-cli/ember-resolver/pull/310) Remove outaded comment ([@dcyriller](https://github.com/dcyriller)) 344 | * [#294](https://github.com/ember-cli/ember-resolver/pull/294) Remove unused dependencies ([@Turbo87](https://github.com/Turbo87)) 345 | 346 | #### Committers: 8 347 | - Cyrille David ([@dcyriller](https://github.com/dcyriller)) 348 | - Dan Freeman ([@dfreeman](https://github.com/dfreeman)) 349 | - Jan Buschtöns ([@buschtoens](https://github.com/buschtoens)) 350 | - L. Preston Sego III ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) 351 | - Léo Bugoni ([@leobugoni](https://github.com/leobugoni)) 352 | - Nathan Lincoln ([@NLincoln](https://github.com/NLincoln)) 353 | - Simon Ihmig ([@simonihmig](https://github.com/simonihmig)) 354 | - Tobias Bieniek ([@Turbo87](https://github.com/Turbo87)) 355 | 356 | ## [v5.0.0](https://github.com/ember-cli/ember-resolver/tree/v5.0.0) (2018-07-23) 357 | 358 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.5.6...v5.0.0) 359 | 360 | **Breaking Changes** 361 | 362 | - Dropped support for Node v4 363 | - ember-resolver will no longer fall back to the globals resolver [\#243](https://github.com/ember-cli/ember-resolver/pull/243) 364 | 365 | ## [v4.5.6](https://github.com/ember-cli/ember-resolver/tree/v4.5.6) (2018-06-13) 366 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.5.5...v4.5.6) 367 | 368 | **Closed issues:** 369 | 370 | - An error occurred in the constructor for ember-resolver [\#234](https://github.com/ember-cli/ember-resolver/issues/234) 371 | - emberResolverFeatureFlags\(\) calls project.config\(\) without an environment name [\#233](https://github.com/ember-cli/ember-resolver/issues/233) 372 | - ember-cli-react/resolver not found [\#231](https://github.com/ember-cli/ember-resolver/issues/231) 373 | - Add ember-cli-eslint [\#200](https://github.com/ember-cli/ember-resolver/issues/200) 374 | 375 | **Merged pull requests:** 376 | 377 | - cleanup yo [\#240](https://github.com/ember-cli/ember-resolver/pull/240) ([stefanpenner](https://github.com/stefanpenner)) 378 | - Added config type to module unification config [\#239](https://github.com/ember-cli/ember-resolver/pull/239) ([chrism](https://github.com/chrism)) 379 | - use flag EMBER\_CLI\_MODULE\_UNIFICATION [\#238](https://github.com/ember-cli/ember-resolver/pull/238) ([givanse](https://github.com/givanse)) 380 | - Fixup linting issues. [\#236](https://github.com/ember-cli/ember-resolver/pull/236) ([rwjblue](https://github.com/rwjblue)) 381 | - Update to ember-cli@3.1.4 blueprint. [\#235](https://github.com/ember-cli/ember-resolver/pull/235) ([rwjblue](https://github.com/rwjblue)) 382 | 383 | ## [v4.5.5](https://github.com/ember-cli/ember-resolver/tree/v4.5.5) (2018-03-23) 384 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.5.4...v4.5.5) 385 | 386 | **Closed issues:** 387 | 388 | - \[4.5.3\] Build error [\#227](https://github.com/ember-cli/ember-resolver/issues/227) 389 | - Support for RFC 297 - Deprecation of Ember.Logger [\#223](https://github.com/ember-cli/ember-resolver/issues/223) 390 | 391 | **Merged pull requests:** 392 | 393 | - \[RFC 297\] Updated to conditionally use console rather than using Ember.Logger [\#232](https://github.com/ember-cli/ember-resolver/pull/232) ([lupestro](https://github.com/lupestro)) 394 | - Update module unification spec link [\#230](https://github.com/ember-cli/ember-resolver/pull/230) ([josemarluedke](https://github.com/josemarluedke)) 395 | - Use build-time `project.isModuleUnification\(\)` instead of feature flag. [\#228](https://github.com/ember-cli/ember-resolver/pull/228) ([cibernox](https://github.com/cibernox)) 396 | 397 | ## [v4.5.4](https://github.com/ember-cli/ember-resolver/tree/v4.5.4) (2018-03-09) 398 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.5.3...v4.5.4) 399 | 400 | ## [v4.5.3](https://github.com/ember-cli/ember-resolver/tree/v4.5.3) (2018-03-09) 401 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.5.2...v4.5.3) 402 | 403 | **Closed issues:** 404 | 405 | - Namespaces [\#214](https://github.com/ember-cli/ember-resolver/issues/214) 406 | 407 | **Merged pull requests:** 408 | 409 | - Update MU trees: template-options is now template-compiler [\#226](https://github.com/ember-cli/ember-resolver/pull/226) ([cibernox](https://github.com/cibernox)) 410 | 411 | ## [v4.5.2](https://github.com/ember-cli/ember-resolver/tree/v4.5.2) (2018-03-05) 412 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.5.1...v4.5.2) 413 | 414 | ## [v4.5.1](https://github.com/ember-cli/ember-resolver/tree/v4.5.1) (2018-03-05) 415 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.5.0...v4.5.1) 416 | 417 | **Closed issues:** 418 | 419 | - Use shorthands & recursive lookup for component paths called from template [\#217](https://github.com/ember-cli/ember-resolver/issues/217) 420 | - Implement a fallback resolver [\#188](https://github.com/ember-cli/ember-resolver/issues/188) 421 | - default podModulePrefix value [\#74](https://github.com/ember-cli/ember-resolver/issues/74) 422 | 423 | **Merged pull requests:** 424 | 425 | - Source and Namespace via Local Lookup [\#225](https://github.com/ember-cli/ember-resolver/pull/225) ([mixonic](https://github.com/mixonic)) 426 | - Normalize specifiers before passing to fallback [\#224](https://github.com/ember-cli/ember-resolver/pull/224) ([iezer](https://github.com/iezer)) 427 | - \[DOCS\] Adds example about pluralizedTypes usage [\#222](https://github.com/ember-cli/ember-resolver/pull/222) ([SergeAstapov](https://github.com/SergeAstapov)) 428 | - Fix Main Service Lookup [\#221](https://github.com/ember-cli/ember-resolver/pull/221) ([iezer](https://github.com/iezer)) 429 | - Glimmer Resolver gets target namespace as third argument [\#220](https://github.com/ember-cli/ember-resolver/pull/220) ([iezer](https://github.com/iezer)) 430 | - Upgrade to Ember CLI 2.18, Re-enable beta testing [\#219](https://github.com/ember-cli/ember-resolver/pull/219) ([mixonic](https://github.com/mixonic)) 431 | - Add support to glimmer-wrapper for MU namespaces [\#218](https://github.com/ember-cli/ember-resolver/pull/218) ([iezer](https://github.com/iezer)) 432 | 433 | ## [v4.5.0](https://github.com/ember-cli/ember-resolver/tree/v4.5.0) (2017-08-29) 434 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.4.0...v4.5.0) 435 | 436 | **Merged pull requests:** 437 | 438 | - Ensure internal `layoutFor` lookups for namespaced templates works. [\#213](https://github.com/ember-cli/ember-resolver/pull/213) ([rwjblue](https://github.com/rwjblue)) 439 | 440 | ## [v4.4.0](https://github.com/ember-cli/ember-resolver/tree/v4.4.0) (2017-08-16) 441 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.3.1...v4.4.0) 442 | 443 | **Merged pull requests:** 444 | 445 | - Dependency Cleanup [\#211](https://github.com/ember-cli/ember-resolver/pull/211) ([mixonic](https://github.com/mixonic)) 446 | 447 | ## [v4.3.1](https://github.com/ember-cli/ember-resolver/tree/v4.3.1) (2017-08-15) 448 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.3.0...v4.3.1) 449 | 450 | **Closed issues:** 451 | 452 | - Adding files to the resolver [\#209](https://github.com/ember-cli/ember-resolver/issues/209) 453 | 454 | **Merged pull requests:** 455 | 456 | - Update ember-cli-version-checker [\#212](https://github.com/ember-cli/ember-resolver/pull/212) ([ef4](https://github.com/ef4)) 457 | 458 | ## [v4.3.0](https://github.com/ember-cli/ember-resolver/tree/v4.3.0) (2017-07-11) 459 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.2.4...v4.3.0) 460 | 461 | **Closed issues:** 462 | 463 | - MU: camelCased lookups [\#195](https://github.com/ember-cli/ember-resolver/issues/195) 464 | 465 | **Merged pull requests:** 466 | 467 | - Fallback Resolver [\#208](https://github.com/ember-cli/ember-resolver/pull/208) ([iezer](https://github.com/iezer)) 468 | 469 | ## [v4.2.4](https://github.com/ember-cli/ember-resolver/tree/v4.2.4) (2017-07-08) 470 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.2.3...v4.2.4) 471 | 472 | **Merged pull requests:** 473 | 474 | - Normalize dots to slashes where appropriate [\#207](https://github.com/ember-cli/ember-resolver/pull/207) ([mixonic](https://github.com/mixonic)) 475 | 476 | ## [v4.2.3](https://github.com/ember-cli/ember-resolver/tree/v4.2.3) (2017-07-08) 477 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.2.2...v4.2.3) 478 | 479 | **Merged pull requests:** 480 | 481 | - Normalize services [\#206](https://github.com/ember-cli/ember-resolver/pull/206) ([mixonic](https://github.com/mixonic)) 482 | 483 | ## [v4.2.2](https://github.com/ember-cli/ember-resolver/tree/v4.2.2) (2017-07-08) 484 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.2.1...v4.2.2) 485 | 486 | **Closed issues:** 487 | 488 | - Component helper usage should warn [\#203](https://github.com/ember-cli/ember-resolver/issues/203) 489 | 490 | **Merged pull requests:** 491 | 492 | - Bump @glimmer/resolver [\#205](https://github.com/ember-cli/ember-resolver/pull/205) ([mixonic](https://github.com/mixonic)) 493 | - Support named exports [\#204](https://github.com/ember-cli/ember-resolver/pull/204) ([mixonic](https://github.com/mixonic)) 494 | 495 | ## [v4.2.1](https://github.com/ember-cli/ember-resolver/tree/v4.2.1) (2017-07-02) 496 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.2.0...v4.2.1) 497 | 498 | **Merged pull requests:** 499 | 500 | - make referrer absolute for all lookups [\#201](https://github.com/ember-cli/ember-resolver/pull/201) ([iezer](https://github.com/iezer)) 501 | - use `test` instead of `match` [\#197](https://github.com/ember-cli/ember-resolver/pull/197) ([bekzod](https://github.com/bekzod)) 502 | 503 | ## [v4.2.0](https://github.com/ember-cli/ember-resolver/tree/v4.2.0) (2017-07-02) 504 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.1.0...v4.2.0) 505 | 506 | **Implemented enhancements:** 507 | 508 | - Port on top of @glimmer/di [\#171](https://github.com/ember-cli/ember-resolver/issues/171) 509 | 510 | **Closed issues:** 511 | 512 | - Local lookup [\#191](https://github.com/ember-cli/ember-resolver/issues/191) 513 | - GlimmerWrapper: Resolve modules without a default export [\#189](https://github.com/ember-cli/ember-resolver/issues/189) 514 | - 4.1.0 produces html-formatted "...@glimmer/resolver was not found..."-error on `npm install` on jenkins [\#187](https://github.com/ember-cli/ember-resolver/issues/187) 515 | 516 | **Merged pull requests:** 517 | 518 | - Dependency upgrades [\#199](https://github.com/ember-cli/ember-resolver/pull/199) ([mixonic](https://github.com/mixonic)) 519 | - Normalize referrer and lookupString, add config flag [\#198](https://github.com/ember-cli/ember-resolver/pull/198) ([mixonic](https://github.com/mixonic)) 520 | - defaultType support, mv partials code to resolver [\#192](https://github.com/ember-cli/ember-resolver/pull/192) ([mixonic](https://github.com/mixonic)) 521 | - Assert against get, not normalize [\#190](https://github.com/ember-cli/ember-resolver/pull/190) ([mixonic](https://github.com/mixonic)) 522 | - fix file name typo [\#186](https://github.com/ember-cli/ember-resolver/pull/186) ([kellyselden](https://github.com/kellyselden)) 523 | - Fixes a small typo [\#184](https://github.com/ember-cli/ember-resolver/pull/184) ([acorncom](https://github.com/acorncom)) 524 | 525 | ## [v4.1.0](https://github.com/ember-cli/ember-resolver/tree/v4.1.0) (2017-03-28) 526 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v4.0.0...v4.1.0) 527 | 528 | **Merged pull requests:** 529 | 530 | - Initial implementation of the module unification feature flag [\#182](https://github.com/ember-cli/ember-resolver/pull/182) ([mixonic](https://github.com/mixonic)) 531 | - Feature flags [\#180](https://github.com/ember-cli/ember-resolver/pull/180) ([mixonic](https://github.com/mixonic)) 532 | 533 | ## [v4.0.0](https://github.com/ember-cli/ember-resolver/tree/v4.0.0) (2017-03-25) 534 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v3.0.1...v4.0.0) 535 | 536 | **Merged pull requests:** 537 | 538 | - Update to Babel 6. [\#179](https://github.com/ember-cli/ember-resolver/pull/179) ([rwjblue](https://github.com/rwjblue)) 539 | 540 | ## [v3.0.1](https://github.com/ember-cli/ember-resolver/tree/v3.0.1) (2017-03-24) 541 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v3.0.0...v3.0.1) 542 | 543 | **Closed issues:** 544 | 545 | - 3 version break ember-inspector. [\#175](https://github.com/ember-cli/ember-resolver/issues/175) 546 | - ContainerDebugAdapter.catalogEntriesByType returns objects of wrong type [\#120](https://github.com/ember-cli/ember-resolver/issues/120) 547 | 548 | **Merged pull requests:** 549 | 550 | - \[Fixes \#175\] restore ability to resolve from modules [\#178](https://github.com/ember-cli/ember-resolver/pull/178) ([stefanpenner](https://github.com/stefanpenner)) 551 | - No longer need Ember.keys [\#177](https://github.com/ember-cli/ember-resolver/pull/177) ([mixonic](https://github.com/mixonic)) 552 | - Restructure on disk [\#176](https://github.com/ember-cli/ember-resolver/pull/176) ([mixonic](https://github.com/mixonic)) 553 | 554 | ## [v3.0.0](https://github.com/ember-cli/ember-resolver/tree/v3.0.0) (2017-03-11) 555 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v2.1.1...v3.0.0) 556 | 557 | **Closed issues:** 558 | 559 | - Remove old / dead code [\#131](https://github.com/ember-cli/ember-resolver/issues/131) 560 | - Re-register failing on `App.reset\(\)` [\#130](https://github.com/ember-cli/ember-resolver/issues/130) 561 | - confirm @ember as npm scope works [\#114](https://github.com/ember-cli/ember-resolver/issues/114) 562 | 563 | **Merged pull requests:** 564 | 565 | - more cleanup [\#174](https://github.com/ember-cli/ember-resolver/pull/174) ([stefanpenner](https://github.com/stefanpenner)) 566 | - cleanup [\#173](https://github.com/ember-cli/ember-resolver/pull/173) ([stefanpenner](https://github.com/stefanpenner)) 567 | - cleanup deps [\#172](https://github.com/ember-cli/ember-resolver/pull/172) ([stefanpenner](https://github.com/stefanpenner)) 568 | - Allow for lazy people like me to easy navigate to update example. [\#169](https://github.com/ember-cli/ember-resolver/pull/169) ([daniellawrence](https://github.com/daniellawrence)) 569 | - Update ember-cli-app-version to version 2.0.1 🚀 [\#165](https://github.com/ember-cli/ember-resolver/pull/165) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 570 | - Update ember-cli to version 2.9.1 🚀 [\#164](https://github.com/ember-cli/ember-resolver/pull/164) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 571 | 572 | ## [v2.1.1](https://github.com/ember-cli/ember-resolver/tree/v2.1.1) (2016-12-30) 573 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v2.1.2...v2.1.1) 574 | 575 | **Merged pull requests:** 576 | 577 | - Don't resolve camelCase helper names to dasherized modules [\#167](https://github.com/ember-cli/ember-resolver/pull/167) ([lukemelia](https://github.com/lukemelia)) 578 | - 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#166](https://github.com/ember-cli/ember-resolver/pull/166) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) 579 | 580 | ## [v2.1.2](https://github.com/ember-cli/ember-resolver/tree/v2.1.2) (2016-10-17) 581 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v2.1.0...v2.1.2) 582 | 583 | **Merged pull requests:** 584 | 585 | - Update `ember-cli` to `2.8.0`. Closes \#152. [\#156](https://github.com/ember-cli/ember-resolver/pull/156) ([btecu](https://github.com/btecu)) 586 | 587 | ## [v2.1.0](https://github.com/ember-cli/ember-resolver/tree/v2.1.0) (2016-09-03) 588 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v2.0.3...v2.1.0) 589 | 590 | **Fixed bugs:** 591 | 592 | - Pin "jquery" to v1.11.3 [\#145](https://github.com/ember-cli/ember-resolver/pull/145) ([Turbo87](https://github.com/Turbo87)) 593 | 594 | **Closed issues:** 595 | 596 | - Use Ember Inflector for pluralization? [\#147](https://github.com/ember-cli/ember-resolver/issues/147) 597 | - Fix broken/hanging TravisCI builds [\#137](https://github.com/ember-cli/ember-resolver/issues/137) 598 | - ember-data and pod format [\#128](https://github.com/ember-cli/ember-resolver/issues/128) 599 | - Deprecation warning in Ember 2.2 [\#124](https://github.com/ember-cli/ember-resolver/issues/124) 600 | - How to transpile `index.js` with broccoli-babel-transpiler [\#121](https://github.com/ember-cli/ember-resolver/issues/121) 601 | - Bower: Unable to find a suitable version for ember-resolver [\#119](https://github.com/ember-cli/ember-resolver/issues/119) 602 | - Make moduleNameLookupPatterns a DAG for extensibility. [\#118](https://github.com/ember-cli/ember-resolver/issues/118) 603 | 604 | **Merged pull requests:** 605 | 606 | - Implement resolveEngine and resolveRouteMap [\#151](https://github.com/ember-cli/ember-resolver/pull/151) ([trentmwillis](https://github.com/trentmwillis)) 607 | - Update CHANGELOG file [\#146](https://github.com/ember-cli/ember-resolver/pull/146) ([Turbo87](https://github.com/Turbo87)) 608 | - Add options to deprecation [\#133](https://github.com/ember-cli/ember-resolver/pull/133) ([wagenet](https://github.com/wagenet)) 609 | - Updating semver comparison to handle pre-release versions. [\#126](https://github.com/ember-cli/ember-resolver/pull/126) ([gmurphey](https://github.com/gmurphey)) 610 | - Update README URLs based on HTTP redirects [\#125](https://github.com/ember-cli/ember-resolver/pull/125) ([ReadmeCritic](https://github.com/ReadmeCritic)) 611 | - Update readme to explain confusing bower resolution message [\#123](https://github.com/ember-cli/ember-resolver/pull/123) ([darbyw](https://github.com/darbyw)) 612 | - Add installation guide [\#117](https://github.com/ember-cli/ember-resolver/pull/117) ([bianjp](https://github.com/bianjp)) 613 | 614 | ## [v2.0.3](https://github.com/ember-cli/ember-resolver/tree/v2.0.3) (2015-08-31) 615 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v2.0.2...v2.0.3) 616 | 617 | **Implemented enhancements:** 618 | 619 | - Move to node [\#79](https://github.com/ember-cli/ember-resolver/issues/79) 620 | 621 | **Closed issues:** 622 | 623 | - Don't Rely On Globals [\#106](https://github.com/ember-cli/ember-resolver/issues/106) 624 | - This doesn't seem to be published on npm [\#102](https://github.com/ember-cli/ember-resolver/issues/102) 625 | 626 | **Merged pull requests:** 627 | 628 | - Add backwards compatibility with 0.1.x exported modules. [\#115](https://github.com/ember-cli/ember-resolver/pull/115) ([rwjblue](https://github.com/rwjblue)) 629 | - Make an ember-cli addon. [\#113](https://github.com/ember-cli/ember-resolver/pull/113) ([rwjblue](https://github.com/rwjblue)) 630 | 631 | ## [v2.0.2](https://github.com/ember-cli/ember-resolver/tree/v2.0.2) (2015-08-31) 632 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v2.0.1...v2.0.2) 633 | 634 | ## [v2.0.1](https://github.com/ember-cli/ember-resolver/tree/v2.0.1) (2015-08-31) 635 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v1.0.1...v2.0.1) 636 | 637 | ## [v1.0.1](https://github.com/ember-cli/ember-resolver/tree/v1.0.1) (2015-08-30) 638 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.21...v1.0.1) 639 | 640 | ## [v0.1.21](https://github.com/ember-cli/ember-resolver/tree/v0.1.21) (2015-08-28) 641 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.20...v0.1.21) 642 | 643 | **Merged pull requests:** 644 | 645 | - Fix failure on Ember canary. [\#112](https://github.com/ember-cli/ember-resolver/pull/112) ([rwjblue](https://github.com/rwjblue)) 646 | - Improve performance of translateToContainerFullname function [\#111](https://github.com/ember-cli/ember-resolver/pull/111) ([joshvfleming](https://github.com/joshvfleming)) 647 | 648 | ## [v0.1.20](https://github.com/ember-cli/ember-resolver/tree/v0.1.20) (2015-08-24) 649 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.19...v0.1.20) 650 | 651 | **Closed issues:** 652 | 653 | - When variable and helper shares the same name, the helper always wins [\#108](https://github.com/ember-cli/ember-resolver/issues/108) 654 | 655 | **Merged pull requests:** 656 | 657 | - Add a changelog [\#110](https://github.com/ember-cli/ember-resolver/pull/110) ([mike-north](https://github.com/mike-north)) 658 | - Align with container cleanup [\#109](https://github.com/ember-cli/ember-resolver/pull/109) ([mike-north](https://github.com/mike-north)) 659 | 660 | ## [v0.1.19](https://github.com/ember-cli/ember-resolver/tree/v0.1.19) (2015-08-20) 661 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.18...v0.1.19) 662 | 663 | **Closed issues:** 664 | 665 | - Problem with loading templates. [\#103](https://github.com/ember-cli/ember-resolver/issues/103) 666 | 667 | **Merged pull requests:** 668 | 669 | - \[DOCS\] adding license attribute to the bower.json [\#107](https://github.com/ember-cli/ember-resolver/pull/107) ([williamsbdev](https://github.com/williamsbdev)) 670 | - Add failing test for @content-helper lookup [\#105](https://github.com/ember-cli/ember-resolver/pull/105) ([tim-evans](https://github.com/tim-evans)) 671 | - Rebased \#92 [\#104](https://github.com/ember-cli/ember-resolver/pull/104) ([tim-evans](https://github.com/tim-evans)) 672 | 673 | ## [v0.1.18](https://github.com/ember-cli/ember-resolver/tree/v0.1.18) (2015-06-25) 674 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.17...v0.1.18) 675 | 676 | **Closed issues:** 677 | 678 | - Change usages of `Ember.create` and `Ember.keys` to `Object.create` and `Object.keys` [\#97](https://github.com/ember-cli/ember-resolver/issues/97) 679 | - Deprecated Computed Syntax [\#93](https://github.com/ember-cli/ember-resolver/issues/93) 680 | - Nested pods & Adapters [\#91](https://github.com/ember-cli/ember-resolver/issues/91) 681 | - Colocating the model with templates, controllers, partials and routes in a pod directory structure [\#81](https://github.com/ember-cli/ember-resolver/issues/81) 682 | 683 | **Merged pull requests:** 684 | 685 | - Updates [\#100](https://github.com/ember-cli/ember-resolver/pull/100) ([stefanpenner](https://github.com/stefanpenner)) 686 | 687 | ## [v0.1.17](https://github.com/ember-cli/ember-resolver/tree/v0.1.17) (2015-06-12) 688 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.16...v0.1.17) 689 | 690 | **Merged pull requests:** 691 | 692 | - Fix `shouldWrapInClassFactory` issue from knownForType refactor. [\#96](https://github.com/ember-cli/ember-resolver/pull/96) ([rwjblue](https://github.com/rwjblue)) 693 | 694 | ## [v0.1.16](https://github.com/ember-cli/ember-resolver/tree/v0.1.16) (2015-06-12) 695 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.15...v0.1.16) 696 | 697 | **Closed issues:** 698 | 699 | - Error with lookup process [\#94](https://github.com/ember-cli/ember-resolver/issues/94) 700 | - may the initializers.js be modularized? [\#67](https://github.com/ember-cli/ember-resolver/issues/67) 701 | 702 | **Merged pull requests:** 703 | 704 | - Implement `knownForType` for RFC\#58. [\#95](https://github.com/ember-cli/ember-resolver/pull/95) ([rwjblue](https://github.com/rwjblue)) 705 | - Fix namespaced resolves for all types [\#92](https://github.com/ember-cli/ember-resolver/pull/92) ([rmachielse](https://github.com/rmachielse)) 706 | 707 | ## [v0.1.15](https://github.com/ember-cli/ember-resolver/tree/v0.1.15) (2015-03-20) 708 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.14...v0.1.15) 709 | 710 | **Merged pull requests:** 711 | 712 | - Bump version 0.1.15 [\#90](https://github.com/ember-cli/ember-resolver/pull/90) ([trabus](https://github.com/trabus)) 713 | 714 | ## [v0.1.14](https://github.com/ember-cli/ember-resolver/tree/v0.1.14) (2015-03-15) 715 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.13...v0.1.14) 716 | 717 | **Merged pull requests:** 718 | 719 | - Do not throw an error if `this.namespace` is undefined on init. [\#89](https://github.com/ember-cli/ember-resolver/pull/89) ([rwjblue](https://github.com/rwjblue)) 720 | 721 | ## [v0.1.13](https://github.com/ember-cli/ember-resolver/tree/v0.1.13) (2015-03-15) 722 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.12...v0.1.13) 723 | 724 | **Closed issues:** 725 | 726 | - Release new version [\#86](https://github.com/ember-cli/ember-resolver/issues/86) 727 | 728 | **Merged pull requests:** 729 | 730 | - Add podModulePrefix deprecation warning. [\#88](https://github.com/ember-cli/ember-resolver/pull/88) ([trabus](https://github.com/trabus)) 731 | - Refactor chooseModuleName to not be an anonymous function [\#87](https://github.com/ember-cli/ember-resolver/pull/87) ([alexspeller](https://github.com/alexspeller)) 732 | 733 | ## [v0.1.12](https://github.com/ember-cli/ember-resolver/tree/v0.1.12) (2015-02-22) 734 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.11...v0.1.12) 735 | 736 | **Closed issues:** 737 | 738 | - How are the needs supposed to be specified for a controller with nested routes? [\#85](https://github.com/ember-cli/ember-resolver/issues/85) 739 | - AMD support [\#78](https://github.com/ember-cli/ember-resolver/issues/78) 740 | - ember-dev is pointing to `master` branch instead of `ruby` in Gemfile [\#71](https://github.com/ember-cli/ember-resolver/issues/71) 741 | 742 | **Merged pull requests:** 743 | 744 | - //@ is depricated [\#84](https://github.com/ember-cli/ember-resolver/pull/84) ([mikeumus](https://github.com/mikeumus)) 745 | - Update dist for pod debug adapter support [\#83](https://github.com/ember-cli/ember-resolver/pull/83) ([teddyzeenny](https://github.com/teddyzeenny)) 746 | - Add pod support and avoid duplicate entries [\#82](https://github.com/ember-cli/ember-resolver/pull/82) ([teddyzeenny](https://github.com/teddyzeenny)) 747 | - Update organization name in repository URL [\#76](https://github.com/ember-cli/ember-resolver/pull/76) ([tricknotes](https://github.com/tricknotes)) 748 | 749 | ## [v0.1.11](https://github.com/ember-cli/ember-resolver/tree/v0.1.11) (2014-12-21) 750 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.10...v0.1.11) 751 | 752 | **Closed issues:** 753 | 754 | - extra unneeded closures exist in dist builds. [\#2](https://github.com/ember-cli/ember-resolver/issues/2) 755 | 756 | **Merged pull requests:** 757 | 758 | - Stamp Resolver class to indicate it is a modulesBasedResolver. [\#75](https://github.com/ember-cli/ember-resolver/pull/75) ([rwjblue](https://github.com/rwjblue)) 759 | - Make assertion message friendly [\#73](https://github.com/ember-cli/ember-resolver/pull/73) ([tricknotes](https://github.com/tricknotes)) 760 | - Fix link to homepage [\#72](https://github.com/ember-cli/ember-resolver/pull/72) ([tricknotes](https://github.com/tricknotes)) 761 | 762 | ## [v0.1.10](https://github.com/ember-cli/ember-resolver/tree/v0.1.10) (2014-10-16) 763 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.9...v0.1.10) 764 | 765 | **Merged pull requests:** 766 | 767 | - Allow namespace resolving [\#70](https://github.com/ember-cli/ember-resolver/pull/70) ([bcardarella](https://github.com/bcardarella)) 768 | 769 | ## [v0.1.9](https://github.com/ember-cli/ember-resolver/tree/v0.1.9) (2014-10-10) 770 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.8...v0.1.9) 771 | 772 | **Merged pull requests:** 773 | 774 | - Allow namespace resolving [\#65](https://github.com/ember-cli/ember-resolver/pull/65) ([bcardarella](https://github.com/bcardarella)) 775 | 776 | ## [v0.1.8](https://github.com/ember-cli/ember-resolver/tree/v0.1.8) (2014-10-09) 777 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.7...v0.1.8) 778 | 779 | **Closed issues:** 780 | 781 | - namespace resolver breaks resolving apps [\#69](https://github.com/ember-cli/ember-resolver/issues/69) 782 | - ember-resolver v0.1.7 pulls down v0.1.6 [\#66](https://github.com/ember-cli/ember-resolver/issues/66) 783 | - .detect and .nearestOfType broken [\#62](https://github.com/ember-cli/ember-resolver/issues/62) 784 | - It cannot resolve nested route on the namespace \(App.TestListRoute\) [\#57](https://github.com/ember-cli/ember-resolver/issues/57) 785 | - including 3rd party ember's library with precompiled templates doesn't work because of `normalize` method [\#55](https://github.com/ember-cli/ember-resolver/issues/55) 786 | - templateName does not resolve when in pod structure [\#45](https://github.com/ember-cli/ember-resolver/issues/45) 787 | - Controller \(with no corresponding Route\) in sub directory cannot be found [\#37](https://github.com/ember-cli/ember-resolver/issues/37) 788 | - resolveTemplate should try both dasherized and underscores [\#34](https://github.com/ember-cli/ember-resolver/issues/34) 789 | - Models in POD structure [\#28](https://github.com/ember-cli/ember-resolver/issues/28) 790 | 791 | **Merged pull requests:** 792 | 793 | - Allow pluralization to be configurable. [\#68](https://github.com/ember-cli/ember-resolver/pull/68) ([rwjblue](https://github.com/rwjblue)) 794 | - Updated the bower.json name attr to be ember-resolver [\#64](https://github.com/ember-cli/ember-resolver/pull/64) ([toranb](https://github.com/toranb)) 795 | - Resolves IE8 bug [\#63](https://github.com/ember-cli/ember-resolver/pull/63) ([jdjkelly](https://github.com/jdjkelly)) 796 | 797 | ## [v0.1.7](https://github.com/ember-cli/ember-resolver/tree/v0.1.7) (2014-07-24) 798 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.6...v0.1.7) 799 | 800 | ## [v0.1.6](https://github.com/ember-cli/ember-resolver/tree/v0.1.6) (2014-07-24) 801 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.5...v0.1.6) 802 | 803 | **Closed issues:** 804 | 805 | - Object.create not available on IE 8 [\#60](https://github.com/ember-cli/ember-resolver/issues/60) 806 | 807 | **Merged pull requests:** 808 | 809 | - Allow components to be grouped together in a single subdirectory. [\#61](https://github.com/ember-cli/ember-resolver/pull/61) ([rwjblue](https://github.com/rwjblue)) 810 | - Bump version in bower.json [\#59](https://github.com/ember-cli/ember-resolver/pull/59) ([xtian](https://github.com/xtian)) 811 | 812 | ## [v0.1.5](https://github.com/ember-cli/ember-resolver/tree/v0.1.5) (2014-07-18) 813 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.4...v0.1.5) 814 | 815 | ## [v0.1.4](https://github.com/ember-cli/ember-resolver/tree/v0.1.4) (2014-07-18) 816 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/v0.1.3...v0.1.4) 817 | 818 | ## [v0.1.3](https://github.com/ember-cli/ember-resolver/tree/v0.1.3) (2014-07-18) 819 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/0.1.2...v0.1.3) 820 | 821 | **Closed issues:** 822 | 823 | - Loading templates doesn't work [\#52](https://github.com/ember-cli/ember-resolver/issues/52) 824 | - Components with templates in pod structure [\#30](https://github.com/ember-cli/ember-resolver/issues/30) 825 | 826 | **Merged pull requests:** 827 | 828 | - add normalization caching. [\#58](https://github.com/ember-cli/ember-resolver/pull/58) ([stefanpenner](https://github.com/stefanpenner)) 829 | - Minor grammatical fix to a comment [\#54](https://github.com/ember-cli/ember-resolver/pull/54) ([baddox](https://github.com/baddox)) 830 | - Fix component template lookup with pods. [\#53](https://github.com/ember-cli/ember-resolver/pull/53) ([rwjblue](https://github.com/rwjblue)) 831 | 832 | ## [0.1.2](https://github.com/ember-cli/ember-resolver/tree/0.1.2) (2014-06-03) 833 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/0.1.1...0.1.2) 834 | 835 | **Closed issues:** 836 | 837 | - Should resolver be optionally independent of the Application namespace? [\#41](https://github.com/ember-cli/ember-resolver/issues/41) 838 | 839 | **Merged pull requests:** 840 | 841 | - Fix typo in logging tests [\#51](https://github.com/ember-cli/ember-resolver/pull/51) ([rlivsey](https://github.com/rlivsey)) 842 | - Don't log if logging is disabled [\#50](https://github.com/ember-cli/ember-resolver/pull/50) ([rlivsey](https://github.com/rlivsey)) 843 | 844 | ## [0.1.1](https://github.com/ember-cli/ember-resolver/tree/0.1.1) (2014-06-03) 845 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/0.1.0...0.1.1) 846 | 847 | **Merged pull requests:** 848 | 849 | - Do not parse the name if it was already parsed. [\#48](https://github.com/ember-cli/ember-resolver/pull/48) ([rwjblue](https://github.com/rwjblue)) 850 | 851 | ## [0.1.0](https://github.com/ember-cli/ember-resolver/tree/0.1.0) (2014-06-03) 852 | [Full Changelog](https://github.com/ember-cli/ember-resolver/compare/0.0.1...0.1.0) 853 | 854 | **Closed issues:** 855 | 856 | - Change name to michael-bay-resolver [\#46](https://github.com/ember-cli/ember-resolver/issues/46) 857 | - templateName convention and RangeError: invalid array length [\#43](https://github.com/ember-cli/ember-resolver/issues/43) 858 | - Single word handlebars helpers do not resolve [\#40](https://github.com/ember-cli/ember-resolver/issues/40) 859 | - proposal for a new folder for adapters, serializers and transformers [\#38](https://github.com/ember-cli/ember-resolver/issues/38) 860 | - Resolver breaks when logging long names [\#35](https://github.com/ember-cli/ember-resolver/issues/35) 861 | - Bower install breaks after the last commit [\#33](https://github.com/ember-cli/ember-resolver/issues/33) 862 | - Incorrect Assertion due to camelCasing of Ember Data Model [\#24](https://github.com/ember-cli/ember-resolver/issues/24) 863 | - Partial resolution is ambiguous [\#22](https://github.com/ember-cli/ember-resolver/issues/22) 864 | - Folder structure tweak [\#21](https://github.com/ember-cli/ember-resolver/issues/21) 865 | - Loading template issue [\#13](https://github.com/ember-cli/ember-resolver/issues/13) 866 | - Configure for default controller and route in application, by default it's a generated by Ember [\#11](https://github.com/ember-cli/ember-resolver/issues/11) 867 | - Create real tests of resolver. [\#1](https://github.com/ember-cli/ember-resolver/issues/1) 868 | 869 | **Merged pull requests:** 870 | 871 | - Very light refactor to the `chooseModuleName` function. [\#47](https://github.com/ember-cli/ember-resolver/pull/47) ([yamadapc](https://github.com/yamadapc)) 872 | - Update README.md [\#42](https://github.com/ember-cli/ember-resolver/pull/42) ([zigomir](https://github.com/zigomir)) 873 | - Refactor `resolveOther` into separate methods. [\#39](https://github.com/ember-cli/ember-resolver/pull/39) ([rwjblue](https://github.com/rwjblue)) 874 | - Do not error when logging long module names. [\#36](https://github.com/ember-cli/ember-resolver/pull/36) ([rwjblue](https://github.com/rwjblue)) 875 | - switch back to inheriting from Ember.DefaultResolver [\#32](https://github.com/ember-cli/ember-resolver/pull/32) ([ghempton](https://github.com/ghempton)) 876 | - WIP: Entries for type [\#31](https://github.com/ember-cli/ember-resolver/pull/31) ([teddyzeenny](https://github.com/teddyzeenny)) 877 | - Changed AMD module name to be less generic [\#27](https://github.com/ember-cli/ember-resolver/pull/27) ([jayphelps](https://github.com/jayphelps)) 878 | - Revert \#20 and \#25. [\#26](https://github.com/ember-cli/ember-resolver/pull/26) ([abuiles](https://github.com/abuiles)) 879 | - More generic error message for normalize method [\#25](https://github.com/ember-cli/ember-resolver/pull/25) ([denisnazarov](https://github.com/denisnazarov)) 880 | - Provide fallback lookup for partials. [\#23](https://github.com/ember-cli/ember-resolver/pull/23) ([rwjblue](https://github.com/rwjblue)) 881 | - Support camelcase resolving of controllers in `needs` array [\#20](https://github.com/ember-cli/ember-resolver/pull/20) ([rahulcs](https://github.com/rahulcs)) 882 | - Reduce the usage of \_eak\_seen. [\#19](https://github.com/ember-cli/ember-resolver/pull/19) ([rwjblue](https://github.com/rwjblue)) 883 | - Refactor logging into helper function. [\#18](https://github.com/ember-cli/ember-resolver/pull/18) ([rwjblue](https://github.com/rwjblue)) 884 | - Test against all three Ember channels. [\#17](https://github.com/ember-cli/ember-resolver/pull/17) ([rwjblue](https://github.com/rwjblue)) 885 | - Add POD structure and allow types to have custom prefixes. [\#16](https://github.com/ember-cli/ember-resolver/pull/16) ([rwjblue](https://github.com/rwjblue)) 886 | - Allow 'some-type:main' modules to be looked up easier. [\#15](https://github.com/ember-cli/ember-resolver/pull/15) ([rwjblue](https://github.com/rwjblue)) 887 | - Add some real tests. [\#14](https://github.com/ember-cli/ember-resolver/pull/14) ([rwjblue](https://github.com/rwjblue)) 888 | - Fixed typo. Ambigous should be Ambiguous [\#12](https://github.com/ember-cli/ember-resolver/pull/12) ([eccegordo](https://github.com/eccegordo)) 889 | - Avoid dot notation for property `default` [\#9](https://github.com/ember-cli/ember-resolver/pull/9) ([zeppelin](https://github.com/zeppelin)) 890 | - Skip type normalization [\#8](https://github.com/ember-cli/ember-resolver/pull/8) ([teddyzeenny](https://github.com/teddyzeenny)) 891 | - Fix invalid JSON [\#6](https://github.com/ember-cli/ember-resolver/pull/6) ([joliss](https://github.com/joliss)) 892 | - Remove exports dependency. [\#5](https://github.com/ember-cli/ember-resolver/pull/5) ([rwjblue](https://github.com/rwjblue)) 893 | - naming isn't finalized, but this provides a toString useful for modules [\#4](https://github.com/ember-cli/ember-resolver/pull/4) ([stefanpenner](https://github.com/stefanpenner)) 894 | - Fancier logging! [\#3](https://github.com/ember-cli/ember-resolver/pull/3) ([jonkirkman](https://github.com/jonkirkman)) 895 | 896 | ## [0.0.1](https://github.com/ember-cli/ember-resolver/tree/0.0.1) (2013-10-31) 897 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | +The Ember team and community are committed to everyone having a safe and inclusive experience. 2 | + 3 | +**Our Community Guidelines / Code of Conduct can be found here**: 4 | + 5 | +http://emberjs.com/guidelines/ 6 | + 7 | +For a history of updates, see the page history here: 8 | + 9 | +https://github.com/emberjs/website/commits/master/source/guidelines.html.erb 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | ## Installation 4 | 5 | * `git clone ` 6 | * `cd ember-resolver` 7 | * `yarn install` 8 | 9 | ## Linting 10 | 11 | * `yarn lint:hbs` 12 | * `yarn lint:js` 13 | * `yarn lint:js --fix` 14 | 15 | ## Running tests 16 | 17 | * `ember test` – Runs the test suite on the current Ember version 18 | * `ember test --server` – Runs the test suite in "watch mode" 19 | * `ember try:each` – Runs the test suite against multiple Ember versions 20 | 21 | ## Running the dummy application 22 | 23 | * `ember serve` 24 | * Visit the dummy application at [http://localhost:4200](http://localhost:4200). 25 | 26 | For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Stefan Penner and Ember App Kit Contributors 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 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 Resolver [![CI Build](https://github.com/ember-cli/ember-resolver/actions/workflows/ci-build.yml/badge.svg)](https://github.com/ember-cli/ember-resolver/actions/workflows/ci-build.yml) 2 | 3 | The Ember Resolver is the mechanism responsible for looking up code in your application and converting its naming conventions into the actual classes, functions, and templates that Ember needs to resolve its dependencies, for example, what template to render for a given route. It is a system that helps the app resolve the lookup of JavaScript modules agnostic of what kind of module system is used, which can be AMD, CommonJS or just plain globals. It is used to lookup routes, models, components, templates, or anything that is used in your Ember app. 4 | 5 | This project provides the Ember resolver used by [ember-cli](https://github.com/ember-cli/ember-cli) 6 | 7 | ## Installation 8 | 9 | `ember-resolver` is an ember-cli addon, and should be installed with `ember install`: 10 | 11 | ``` 12 | ember install ember-resolver 13 | ``` 14 | 15 | ## Configuration 16 | 17 | To customize pluralization provide a `pluralizedTypes` object to your applications resolver: 18 | 19 | ```js 20 | // app/app.js 21 | import Resolver from 'ember-resolver'; 22 | 23 | export default class AppResolver extends Resolver { 24 | pluralizedTypes = { 25 | ...this.pluralizedTypes, 26 | 'sheep': 'sheep', 27 | 'strategy': 'strategies' 28 | } 29 | } 30 | 31 | // ...snip... 32 | export default class App extends Application { 33 | // ...snip... 34 | Resolver = AppResolver; 35 | } 36 | 37 | // ...snip... 38 | ``` 39 | 40 | ## Addon Development 41 | 42 | ### Installation 43 | 44 | * `git clone` this repository 45 | * `npm install` 46 | * `bower install` 47 | 48 | ### Running 49 | 50 | * `ember server` 51 | * Visit your app at http://localhost:4200. 52 | 53 | ### Running Tests 54 | 55 | * `ember test` 56 | * `ember test --server` 57 | 58 | ### Building 59 | 60 | * `ember build` 61 | 62 | For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/). 63 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Release 2 | 3 | Releases are mostly automated using 4 | [release-it](https://github.com/release-it/release-it/) and 5 | [lerna-changelog](https://github.com/lerna/lerna-changelog/). 6 | 7 | 8 | ## Preparation 9 | 10 | Since the majority of the actual release process is automated, the primary 11 | remaining task prior to releasing is confirming that all pull requests that 12 | have been merged since the last release have been labeled with the appropriate 13 | `lerna-changelog` labels and the titles have been updated to ensure they 14 | represent something that would make sense to our users. Some great information 15 | on why this is important can be found at 16 | [keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall 17 | guiding principle here is that changelogs are for humans, not machines. 18 | 19 | When reviewing merged PR's the labels to be used are: 20 | 21 | * breaking - Used when the PR is considered a breaking change. 22 | * enhancement - Used when the PR adds a new feature or enhancement. 23 | * bug - Used when the PR fixes a bug included in a previous release. 24 | * documentation - Used when the PR adds or updates documentation. 25 | * internal - Used for internal changes that still require a mention in the 26 | changelog/release notes. 27 | 28 | 29 | ## Release 30 | 31 | Once the prep work is completed, the actual release is straight forward: 32 | 33 | * First ensure that you have `release-it` installed globally, generally done by 34 | using one of the following commands: 35 | 36 | ``` 37 | # using https://volta.sh 38 | volta install release-it 39 | 40 | # using Yarn 41 | yarn global add release-it 42 | 43 | # using npm 44 | npm install --global release-it 45 | ``` 46 | 47 | * Second, ensure that you have installed your projects dependencies: 48 | 49 | ``` 50 | yarn install 51 | ``` 52 | 53 | * And last (but not least 😁) do your release. It requires a 54 | [GitHub personal access token](https://github.com/settings/tokens) as 55 | `$GITHUB_AUTH` environment variable. Only "repo" access is needed; no "admin" 56 | or other scopes are required. 57 | 58 | ``` 59 | export GITHUB_AUTH="f941e0..." 60 | release-it 61 | ``` 62 | 63 | [release-it](https://github.com/release-it/release-it/) manages the actual 64 | release process. It will prompt you to to choose the version number after which 65 | you will have the chance to hand tweak the changelog to be used (for the 66 | `CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging, 67 | pushing the tag and commits, etc. 68 | -------------------------------------------------------------------------------- /addon/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist/ 5 | /tmp/ 6 | 7 | # dependencies 8 | /bower_components/ 9 | /node_modules/ 10 | 11 | # misc 12 | /.env* 13 | /.pnp* 14 | /.sass-cache 15 | /connect.lock 16 | /coverage/ 17 | /libpeerconnection.log 18 | /npm-debug.log* 19 | /testem.log 20 | /yarn-error.log 21 | 22 | # ember-try 23 | /.node_modules.ember-try/ 24 | /bower.json.ember-try 25 | /package.json.ember-try 26 | 27 | .eslintcache 28 | 29 | # The authoritative copies of these live in the monorepo root (because they're 30 | # more useful on github that way), but the build copies them into here so they 31 | # will also appear in published NPM packages. 32 | /README.md 33 | /LICENSE.md 34 | -------------------------------------------------------------------------------- /addon/.npmignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist/ 3 | /tmp/ 4 | 5 | # dependencies 6 | /bower_components/ 7 | 8 | # misc 9 | /.bowerrc 10 | /.editorconfig 11 | /.ember-cli 12 | /.env* 13 | /.eslintcache 14 | /.eslintignore 15 | /.eslintrc.js 16 | /.git/ 17 | /.github/ 18 | /.github_changelog_generator 19 | /.gitignore 20 | /.prettierignore 21 | /.prettierrc.js 22 | /.template-lintrc.js 23 | /.travis.yml 24 | /.watchmanconfig 25 | /bower.json 26 | /config/ember-try.js 27 | /CODE_OF_CONDUCT.md 28 | /CONTRIBUTING.md 29 | /ember-cli-build.js 30 | /RELEASE.md 31 | /server/ 32 | /testem.js 33 | /tests/ 34 | /yarn-error.log 35 | /yarn.lock 36 | .gitkeep 37 | 38 | # ember-try 39 | /.node_modules.ember-try/ 40 | /bower.json.ember-try 41 | /npm-shrinkwrap.json.ember-try 42 | /package.json.ember-try 43 | /package-lock.json.ember-try 44 | /yarn.lock.ember-try 45 | -------------------------------------------------------------------------------- /addon/addon/index.js: -------------------------------------------------------------------------------- 1 | import { dasherize, classify, underscore } from './string'; 2 | import classFactory from './utils/class-factory'; 3 | 4 | export class ModuleRegistry { 5 | constructor(entries) { 6 | this._entries = entries || globalThis.requirejs.entries; 7 | } 8 | moduleNames() { 9 | return Object.keys(this._entries); 10 | } 11 | has(moduleName) { 12 | return moduleName in this._entries; 13 | } 14 | get(...args) { 15 | return globalThis.require(...args); 16 | } 17 | } 18 | 19 | /** 20 | * This module defines a subclass of Ember.DefaultResolver that adds two 21 | * important features: 22 | * 23 | * 1) The resolver makes the container aware of es6 modules via the AMD 24 | * output. The loader's _moduleEntries is consulted so that classes can be 25 | * resolved directly via the module loader, without needing a manual 26 | * `import`. 27 | * 2) is able to provide injections to classes that implement `extend` 28 | * (as is typical with Ember). 29 | */ 30 | export default class Resolver { 31 | static moduleBasedResolver = true; 32 | moduleBasedResolver = true; 33 | 34 | _deprecatedPodModulePrefix = false; 35 | _normalizeCache = Object.create(null); 36 | 37 | static create(props) { 38 | return new this(props); 39 | } 40 | 41 | /** 42 | A listing of functions to test for moduleName's based on the provided 43 | `parsedName`. This allows easy customization of additional module based 44 | lookup patterns. 45 | 46 | @property moduleNameLookupPatterns 47 | @returns {Ember.Array} 48 | */ 49 | moduleNameLookupPatterns = [ 50 | this.podBasedModuleName, 51 | this.podBasedComponentsInSubdir, 52 | this.mainModuleName, 53 | this.defaultModuleName, 54 | this.nestedColocationComponentModuleName, 55 | ]; 56 | 57 | static withModules(explicitModules) { 58 | return class extends this { 59 | static explicitModules = explicitModules; 60 | }; 61 | } 62 | 63 | constructor(props) { 64 | Object.assign(this, props); 65 | if (!this._moduleRegistry) { 66 | let explicitModules = this.constructor.explicitModules; 67 | if (explicitModules) { 68 | this._moduleRegistry = { 69 | moduleNames() { 70 | return Object.keys(explicitModules); 71 | }, 72 | has(name) { 73 | return Boolean(explicitModules[name]); 74 | }, 75 | get(name) { 76 | return explicitModules[name]; 77 | }, 78 | addModules(modules) { 79 | explicitModules = Object.assign({}, explicitModules, modules); 80 | }, 81 | }; 82 | } else { 83 | if (typeof globalThis.requirejs.entries === 'undefined') { 84 | globalThis.requirejs.entries = globalThis.requirejs._eak_seen; 85 | } 86 | this._moduleRegistry = new ModuleRegistry(); 87 | } 88 | } 89 | 90 | this.pluralizedTypes = this.pluralizedTypes || Object.create(null); 91 | 92 | if (!this.pluralizedTypes.config) { 93 | this.pluralizedTypes.config = 'config'; 94 | } 95 | } 96 | 97 | makeToString(factory, fullName) { 98 | return '' + this.namespace.modulePrefix + '@' + fullName + ':'; 99 | } 100 | 101 | shouldWrapInClassFactory(/* module, parsedName */) { 102 | return false; 103 | } 104 | 105 | parseName(fullName) { 106 | if (fullName.parsedName === true) { 107 | return fullName; 108 | } 109 | 110 | let prefix, type, name; 111 | let fullNameParts = fullName.split('@'); 112 | 113 | if (fullNameParts.length === 3) { 114 | if (fullNameParts[0].length === 0) { 115 | // leading scoped namespace: `@scope/pkg@type:name` 116 | prefix = `@${fullNameParts[1]}`; 117 | let prefixParts = fullNameParts[2].split(':'); 118 | type = prefixParts[0]; 119 | name = prefixParts[1]; 120 | } else { 121 | // interweaved scoped namespace: `type:@scope/pkg@name` 122 | prefix = `@${fullNameParts[1]}`; 123 | type = fullNameParts[0].slice(0, -1); 124 | name = fullNameParts[2]; 125 | } 126 | 127 | if (type === 'template:components') { 128 | name = `components/${name}`; 129 | type = 'template'; 130 | } 131 | } else if (fullNameParts.length === 2) { 132 | let prefixParts = fullNameParts[0].split(':'); 133 | 134 | if (prefixParts.length === 2) { 135 | if (prefixParts[1].length === 0) { 136 | type = prefixParts[0]; 137 | name = `@${fullNameParts[1]}`; 138 | } else { 139 | prefix = prefixParts[1]; 140 | type = prefixParts[0]; 141 | name = fullNameParts[1]; 142 | } 143 | } else { 144 | let nameParts = fullNameParts[1].split(':'); 145 | 146 | prefix = fullNameParts[0]; 147 | type = nameParts[0]; 148 | name = nameParts[1]; 149 | } 150 | 151 | if (type === 'template' && prefix.lastIndexOf('components/', 0) === 0) { 152 | name = `components/${name}`; 153 | prefix = prefix.slice(11); 154 | } 155 | } else { 156 | fullNameParts = fullName.split(':'); 157 | type = fullNameParts[0]; 158 | name = fullNameParts[1]; 159 | } 160 | 161 | let fullNameWithoutType = name; 162 | let namespace = this.namespace; 163 | let root = namespace; 164 | 165 | return { 166 | parsedName: true, 167 | fullName: fullName, 168 | prefix: prefix || this.prefix({ type: type }), 169 | type: type, 170 | fullNameWithoutType: fullNameWithoutType, 171 | name: name, 172 | root: root, 173 | resolveMethodName: 'resolve' + classify(type), 174 | }; 175 | } 176 | 177 | resolveOther(parsedName) { 178 | assert('`modulePrefix` must be defined', this.namespace.modulePrefix); 179 | 180 | let normalizedModuleName = this.findModuleName(parsedName); 181 | 182 | if (normalizedModuleName) { 183 | let defaultExport = this._extractDefaultExport( 184 | normalizedModuleName, 185 | parsedName 186 | ); 187 | 188 | if (defaultExport === undefined) { 189 | throw new Error( 190 | ` Expected to find: '${parsedName.fullName}' within '${normalizedModuleName}' but got 'undefined'. Did you forget to 'export default' within '${normalizedModuleName}'?` 191 | ); 192 | } 193 | 194 | if (this.shouldWrapInClassFactory(defaultExport, parsedName)) { 195 | defaultExport = classFactory(defaultExport); 196 | } 197 | 198 | return defaultExport; 199 | } 200 | } 201 | 202 | normalize(fullName) { 203 | return ( 204 | this._normalizeCache[fullName] || 205 | (this._normalizeCache[fullName] = this._normalize(fullName)) 206 | ); 207 | } 208 | 209 | resolve(fullName) { 210 | if (fullName === 'resolver:current') { 211 | return { create: () => this }; 212 | } 213 | let parsedName = this.parseName(fullName); 214 | let resolveMethodName = parsedName.resolveMethodName; 215 | let resolved; 216 | 217 | if (typeof this[resolveMethodName] === 'function') { 218 | resolved = this[resolveMethodName](parsedName); 219 | } 220 | 221 | if (resolved == null) { 222 | resolved = this.resolveOther(parsedName); 223 | } 224 | 225 | return resolved; 226 | } 227 | 228 | addModules(modules) { 229 | if (!this._moduleRegistry.addModules) { 230 | throw new Error( 231 | `addModules is only supported when your Resolver has been configured to use static modules via Resolver.withModules()` 232 | ); 233 | } 234 | this._moduleRegistry.addModules(modules); 235 | } 236 | 237 | _normalize(fullName) { 238 | // A) Convert underscores to dashes 239 | // B) Convert camelCase to dash-case, except for components (their 240 | // templates) and helpers where we want to avoid shadowing camelCase 241 | // expressions 242 | // C) replace `.` with `/` in order to make nested controllers work in the following cases 243 | // 1. `needs: ['posts/post']` 244 | // 2. `{{render "posts/post"}}` 245 | // 3. `this.render('posts/post')` from Route 246 | 247 | let split = fullName.split(':'); 248 | if (split.length > 1) { 249 | let type = split[0]; 250 | 251 | if ( 252 | type === 'component' || 253 | type === 'helper' || 254 | type === 'modifier' || 255 | (type === 'template' && split[1].indexOf('components/') === 0) 256 | ) { 257 | return type + ':' + split[1].replace(/_/g, '-'); 258 | } else { 259 | return type + ':' + dasherize(split[1].replace(/\./g, '/')); 260 | } 261 | } else { 262 | return fullName; 263 | } 264 | } 265 | 266 | pluralize(type) { 267 | return ( 268 | this.pluralizedTypes[type] || (this.pluralizedTypes[type] = type + 's') 269 | ); 270 | } 271 | 272 | podBasedLookupWithPrefix(podPrefix, parsedName) { 273 | let fullNameWithoutType = parsedName.fullNameWithoutType; 274 | 275 | if (parsedName.type === 'template') { 276 | fullNameWithoutType = fullNameWithoutType.replace(/^components\//, ''); 277 | } 278 | 279 | return podPrefix + '/' + fullNameWithoutType + '/' + parsedName.type; 280 | } 281 | 282 | podBasedModuleName(parsedName) { 283 | let podPrefix = 284 | this.namespace.podModulePrefix || this.namespace.modulePrefix; 285 | 286 | return this.podBasedLookupWithPrefix(podPrefix, parsedName); 287 | } 288 | 289 | podBasedComponentsInSubdir(parsedName) { 290 | let podPrefix = 291 | this.namespace.podModulePrefix || this.namespace.modulePrefix; 292 | podPrefix = podPrefix + '/components'; 293 | 294 | if ( 295 | parsedName.type === 'component' || 296 | /^components/.test(parsedName.fullNameWithoutType) 297 | ) { 298 | return this.podBasedLookupWithPrefix(podPrefix, parsedName); 299 | } 300 | } 301 | 302 | resolveEngine(parsedName) { 303 | let engineName = parsedName.fullNameWithoutType; 304 | let engineModule = engineName + '/engine'; 305 | 306 | if (this._moduleRegistry.has(engineModule)) { 307 | return this._extractDefaultExport(engineModule); 308 | } 309 | } 310 | 311 | resolveRouteMap(parsedName) { 312 | let engineName = parsedName.fullNameWithoutType; 313 | let engineRoutesModule = engineName + '/routes'; 314 | 315 | if (this._moduleRegistry.has(engineRoutesModule)) { 316 | let routeMap = this._extractDefaultExport(engineRoutesModule); 317 | 318 | assert( 319 | `The route map for ${engineName} should be wrapped by 'buildRoutes' before exporting.`, 320 | routeMap.isRouteMap 321 | ); 322 | 323 | return routeMap; 324 | } 325 | } 326 | 327 | resolveTemplate(parsedName) { 328 | return this.resolveOther(parsedName); 329 | } 330 | 331 | mainModuleName(parsedName) { 332 | if (parsedName.fullNameWithoutType === 'main') { 333 | // if router:main or adapter:main look for a module with just the type first 334 | return parsedName.prefix + '/' + parsedName.type; 335 | } 336 | } 337 | 338 | defaultModuleName(parsedName) { 339 | return ( 340 | parsedName.prefix + 341 | '/' + 342 | this.pluralize(parsedName.type) + 343 | '/' + 344 | parsedName.fullNameWithoutType 345 | ); 346 | } 347 | 348 | nestedColocationComponentModuleName(parsedName) { 349 | if (parsedName.type === 'component') { 350 | return ( 351 | parsedName.prefix + 352 | '/' + 353 | this.pluralize(parsedName.type) + 354 | '/' + 355 | parsedName.fullNameWithoutType + 356 | '/index' 357 | ); 358 | } 359 | } 360 | 361 | prefix(parsedName) { 362 | let tmpPrefix = this.namespace.modulePrefix; 363 | 364 | if (this.namespace[parsedName.type + 'Prefix']) { 365 | tmpPrefix = this.namespace[parsedName.type + 'Prefix']; 366 | } 367 | 368 | return tmpPrefix; 369 | } 370 | 371 | findModuleName(parsedName) { 372 | let moduleNameLookupPatterns = this.moduleNameLookupPatterns; 373 | let moduleName; 374 | 375 | for ( 376 | let index = 0, length = moduleNameLookupPatterns.length; 377 | index < length; 378 | index++ 379 | ) { 380 | let item = moduleNameLookupPatterns[index]; 381 | 382 | let tmpModuleName = item.call(this, parsedName); 383 | 384 | // allow treat all dashed and all underscored as the same thing 385 | // supports components with dashes and other stuff with underscores. 386 | if (tmpModuleName) { 387 | tmpModuleName = this.chooseModuleName(tmpModuleName); 388 | } 389 | 390 | if (tmpModuleName && this._moduleRegistry.has(tmpModuleName)) { 391 | moduleName = tmpModuleName; 392 | } 393 | 394 | if (moduleName) { 395 | return moduleName; 396 | } 397 | } 398 | } 399 | 400 | chooseModuleName(moduleName) { 401 | let underscoredModuleName = underscore(moduleName); 402 | 403 | if ( 404 | moduleName !== underscoredModuleName && 405 | this._moduleRegistry.has(moduleName) && 406 | this._moduleRegistry.has(underscoredModuleName) 407 | ) { 408 | throw new TypeError( 409 | `Ambiguous module names: '${moduleName}' and '${underscoredModuleName}'` 410 | ); 411 | } 412 | 413 | if (this._moduleRegistry.has(moduleName)) { 414 | return moduleName; 415 | } else if (this._moduleRegistry.has(underscoredModuleName)) { 416 | return underscoredModuleName; 417 | } 418 | } 419 | 420 | knownForType(type) { 421 | let moduleKeys = this._moduleRegistry.moduleNames(); 422 | 423 | let items = Object.create(null); 424 | for (let index = 0, length = moduleKeys.length; index < length; index++) { 425 | let moduleName = moduleKeys[index]; 426 | let fullname = this.translateToContainerFullname(type, moduleName); 427 | 428 | if (fullname) { 429 | items[fullname] = true; 430 | } 431 | } 432 | 433 | return items; 434 | } 435 | 436 | translateToContainerFullname(type, moduleName) { 437 | let prefix = this.prefix({ type }); 438 | 439 | // Note: using string manipulation here rather than regexes for better performance. 440 | // pod modules 441 | // '^' + prefix + '/(.+)/' + type + '$' 442 | let podPrefix = prefix + '/'; 443 | let podSuffix = '/' + type; 444 | let start = moduleName.indexOf(podPrefix); 445 | let end = moduleName.indexOf(podSuffix); 446 | 447 | if ( 448 | start === 0 && 449 | end === moduleName.length - podSuffix.length && 450 | moduleName.length > podPrefix.length + podSuffix.length 451 | ) { 452 | return type + ':' + moduleName.slice(start + podPrefix.length, end); 453 | } 454 | 455 | // non-pod modules 456 | // '^' + prefix + '/' + pluralizedType + '/(.+)$' 457 | let pluralizedType = this.pluralize(type); 458 | let nonPodPrefix = prefix + '/' + pluralizedType + '/'; 459 | 460 | if ( 461 | moduleName.indexOf(nonPodPrefix) === 0 && 462 | moduleName.length > nonPodPrefix.length 463 | ) { 464 | return type + ':' + moduleName.slice(nonPodPrefix.length); 465 | } 466 | } 467 | 468 | _extractDefaultExport(normalizedModuleName) { 469 | let module = this._moduleRegistry.get( 470 | normalizedModuleName, 471 | null, 472 | null, 473 | true /* force sync */ 474 | ); 475 | 476 | if (module && module['default']) { 477 | module = module['default']; 478 | } 479 | 480 | return module; 481 | } 482 | } 483 | 484 | function assert(message, check) { 485 | if (!check) { 486 | throw new Error(message); 487 | } 488 | } 489 | -------------------------------------------------------------------------------- /addon/addon/string/cache.js: -------------------------------------------------------------------------------- 1 | export default class Cache { 2 | constructor(limit, func, store) { 3 | this.limit = limit; 4 | this.func = func; 5 | this.store = store; 6 | this.size = 0; 7 | this.misses = 0; 8 | this.hits = 0; 9 | this.store = store || new Map(); 10 | } 11 | get(key) { 12 | let value = this.store.get(key); 13 | if (this.store.has(key)) { 14 | this.hits++; 15 | return this.store.get(key); 16 | } else { 17 | this.misses++; 18 | value = this.set(key, this.func(key)); 19 | } 20 | return value; 21 | } 22 | set(key, value) { 23 | if (this.limit > this.size) { 24 | this.size++; 25 | this.store.set(key, value); 26 | } 27 | return value; 28 | } 29 | purge() { 30 | this.store.clear(); 31 | this.size = 0; 32 | this.hits = 0; 33 | this.misses = 0; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /addon/addon/string/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-useless-escape */ 2 | import Cache from './cache'; 3 | let STRINGS = {}; 4 | export function setStrings(strings) { 5 | STRINGS = strings; 6 | } 7 | export function getStrings() { 8 | return STRINGS; 9 | } 10 | export function getString(name) { 11 | return STRINGS[name]; 12 | } 13 | const STRING_DASHERIZE_REGEXP = /[ _]/g; 14 | const STRING_DASHERIZE_CACHE = new Cache(1000, (key) => 15 | decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-') 16 | ); 17 | const STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/; 18 | const STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g; 19 | const STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g; 20 | const CLASSIFY_CACHE = new Cache(1000, (str) => { 21 | const replace1 = (_match, _separator, chr) => 22 | chr ? `_${chr.toUpperCase()}` : ''; 23 | const replace2 = (_match, initialChar, _separator, chr) => 24 | initialChar + (chr ? chr.toUpperCase() : ''); 25 | const parts = str.split('/'); 26 | for (let i = 0; i < parts.length; i++) { 27 | parts[i] = parts[i] 28 | .replace(STRING_CLASSIFY_REGEXP_1, replace1) 29 | .replace(STRING_CLASSIFY_REGEXP_2, replace2); 30 | } 31 | return parts 32 | .join('/') 33 | .replace(STRING_CLASSIFY_REGEXP_3, (match /*, separator, chr */) => 34 | match.toUpperCase() 35 | ); 36 | }); 37 | const STRING_UNDERSCORE_REGEXP_1 = /([a-z\d])([A-Z]+)/g; 38 | const STRING_UNDERSCORE_REGEXP_2 = /\-|\s+/g; 39 | const UNDERSCORE_CACHE = new Cache(1000, (str) => 40 | str 41 | .replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2') 42 | .replace(STRING_UNDERSCORE_REGEXP_2, '_') 43 | .toLowerCase() 44 | ); 45 | const STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g; 46 | const DECAMELIZE_CACHE = new Cache(1000, (str) => 47 | str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase() 48 | ); 49 | /** 50 | Converts a camelized string into all lower case separated by underscores. 51 | 52 | ```javascript 53 | import { decamelize } from '@ember/string'; 54 | 55 | decamelize('innerHTML'); // 'inner_html' 56 | decamelize('action_name'); // 'action_name' 57 | decamelize('css-class-name'); // 'css-class-name' 58 | decamelize('my favorite items'); // 'my favorite items' 59 | ``` 60 | 61 | @method decamelize 62 | @param {String} str The string to decamelize. 63 | @return {String} the decamelized string. 64 | @public 65 | */ 66 | export function decamelize(str) { 67 | return DECAMELIZE_CACHE.get(str); 68 | } 69 | /** 70 | Replaces underscores, spaces, or camelCase with dashes. 71 | 72 | ```javascript 73 | import { dasherize } from '@ember/string'; 74 | 75 | dasherize('innerHTML'); // 'inner-html' 76 | dasherize('action_name'); // 'action-name' 77 | dasherize('css-class-name'); // 'css-class-name' 78 | dasherize('my favorite items'); // 'my-favorite-items' 79 | dasherize('privateDocs/ownerInvoice'; // 'private-docs/owner-invoice' 80 | ``` 81 | 82 | @method dasherize 83 | @param {String} str The string to dasherize. 84 | @return {String} the dasherized string. 85 | @public 86 | */ 87 | export function dasherize(str) { 88 | return STRING_DASHERIZE_CACHE.get(str); 89 | } 90 | /** 91 | Returns the UpperCamelCase form of a string. 92 | 93 | ```javascript 94 | import { classify } from '@ember/string'; 95 | 96 | classify('innerHTML'); // 'InnerHTML' 97 | classify('action_name'); // 'ActionName' 98 | classify('css-class-name'); // 'CssClassName' 99 | classify('my favorite items'); // 'MyFavoriteItems' 100 | classify('private-docs/owner-invoice'); // 'PrivateDocs/OwnerInvoice' 101 | ``` 102 | 103 | @method classify 104 | @param {String} str the string to classify 105 | @return {String} the classified string 106 | @public 107 | */ 108 | export function classify(str) { 109 | return CLASSIFY_CACHE.get(str); 110 | } 111 | /** 112 | More general than decamelize. Returns the lower\_case\_and\_underscored 113 | form of a string. 114 | 115 | ```javascript 116 | import { underscore } from '@ember/string'; 117 | 118 | underscore('innerHTML'); // 'inner_html' 119 | underscore('action_name'); // 'action_name' 120 | underscore('css-class-name'); // 'css_class_name' 121 | underscore('my favorite items'); // 'my_favorite_items' 122 | underscore('privateDocs/ownerInvoice'); // 'private_docs/owner_invoice' 123 | ``` 124 | 125 | @method underscore 126 | @param {String} str The string to underscore. 127 | @return {String} the underscored string. 128 | @public 129 | */ 130 | export function underscore(str) { 131 | return UNDERSCORE_CACHE.get(str); 132 | } 133 | -------------------------------------------------------------------------------- /addon/addon/utils/class-factory.js: -------------------------------------------------------------------------------- 1 | export default function classFactory(klass) { 2 | return { 3 | create(injections) { 4 | if (typeof klass.extend === 'function') { 5 | return klass.extend(injections); 6 | } else { 7 | return klass; 8 | } 9 | }, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /addon/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Resolver as ResolverContract } from "@ember/owner"; 2 | 3 | export default class Resolver { 4 | static create(this: T, props: Record): InstanceType; 5 | static withModules(this: T, modules: Record): T; 6 | } 7 | export default interface Resolver extends Required { 8 | pluralizedTypes: Record; 9 | addModules(modules: Record): void; 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /addon/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | name: require('./package.json').name, 5 | }; 6 | -------------------------------------------------------------------------------- /addon/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-resolver", 3 | "version": "13.1.1", 4 | "description": "The default modules based resolver for Ember CLI.", 5 | "keywords": [], 6 | "homepage": "https://github.com/ember-cli/ember-resolver#readme", 7 | "bugs": { 8 | "url": "https://github.com/ember-cli/ember-resolver/issues" 9 | }, 10 | "types": "index.d.ts", 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/ember-cli/ember-resolver.git" 14 | }, 15 | "license": "MIT", 16 | "author": "Robert Jackson ", 17 | "main": "index.js", 18 | "directories": { 19 | "doc": "doc", 20 | "test": "tests" 21 | }, 22 | "scripts": {}, 23 | "dependencies": { 24 | "ember-cli-babel": "^7.26.11" 25 | }, 26 | "engines": { 27 | "node": "14.* || 16.* || >= 18" 28 | }, 29 | "publishConfig": { 30 | "registry": "https://registry.npmjs.org" 31 | }, 32 | "ember": { 33 | "edition": "octane" 34 | }, 35 | "exports": { 36 | ".": { 37 | "types": "./index.d.ts", 38 | "default": "./addon/index" 39 | }, 40 | "./*": "./addon/*" 41 | }, 42 | "volta": { 43 | "extends": "../package.json" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "workspaces": [ 4 | "addon", 5 | "test-app" 6 | ], 7 | "repository": { 8 | "type": "git", 9 | "url": "git+https://github.com/ember-cli/ember-resolver.git" 10 | }, 11 | "scripts": { 12 | "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"", 13 | "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix", 14 | "lint:hbs": "ember-template-lint .", 15 | "lint:hbs:fix": "ember-template-lint . --fix", 16 | "lint:js": "eslint . --cache", 17 | "lint:js:fix": "eslint . --fix" 18 | }, 19 | "devDependencies": { 20 | "@babel/eslint-parser": "^7.21.3", 21 | "@babel/plugin-proposal-decorators": "^7.21.0", 22 | "@release-it-plugins/lerna-changelog": "5.0.0", 23 | "@release-it-plugins/workspaces": "^3.2.0", 24 | "ember-template-lint": "^5.7.2", 25 | "eslint": "^8.46.0", 26 | "eslint-config-prettier": "^8.9.0", 27 | "eslint-plugin-ember": "^11.5.0", 28 | "eslint-plugin-n": "^15.7.0", 29 | "eslint-plugin-prettier": "^4.2.1", 30 | "eslint-plugin-qunit": "^7.3.4", 31 | "npm-run-all": "^4.1.5", 32 | "prettier": "^2.8.4", 33 | "release-it": "^15.6.0" 34 | }, 35 | "release-it": { 36 | "hooks": { 37 | "before:init": "cp README.md LICENSE.md addon/" 38 | }, 39 | "plugins": { 40 | "@release-it-plugins/workspaces": { 41 | "publish": false 42 | }, 43 | "@release-it-plugins/lerna-changelog": { 44 | "infile": "CHANGELOG.md", 45 | "launchEditor": true 46 | } 47 | }, 48 | "git": { 49 | "tagName": "v${version}" 50 | }, 51 | "npm": false, 52 | "github": { 53 | "release": true, 54 | "tokenRef": "GITHUB_AUTH" 55 | } 56 | }, 57 | "packageManager": "npm@8.12.1", 58 | "volta": { 59 | "node": "14.19.3", 60 | "npm": "8.12.1" 61 | }, 62 | "version": "13.1.1" 63 | } 64 | -------------------------------------------------------------------------------- /test-app/.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /test-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist/ 5 | /tmp/ 6 | 7 | # dependencies 8 | /bower_components/ 9 | /node_modules/ 10 | 11 | # misc 12 | /.env* 13 | /.pnp* 14 | /.sass-cache 15 | /connect.lock 16 | /coverage/ 17 | /libpeerconnection.log 18 | /npm-debug.log* 19 | /testem.log 20 | /yarn-error.log 21 | 22 | # ember-try 23 | /.node_modules.ember-try/ 24 | /bower.json.ember-try 25 | /package.json.ember-try 26 | 27 | .eslintcache 28 | -------------------------------------------------------------------------------- /test-app/.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp", "dist"] 3 | } 4 | -------------------------------------------------------------------------------- /test-app/app/app.js: -------------------------------------------------------------------------------- 1 | import Application from '@ember/application'; 2 | import Resolver from './resolver'; 3 | import loadInitializers from 'ember-load-initializers'; 4 | import config from './config/environment'; 5 | 6 | export default class App extends Application { 7 | modulePrefix = config.modulePrefix; 8 | podModulePrefix = config.podModulePrefix; 9 | Resolver = Resolver; 10 | } 11 | 12 | loadInitializers(App, config.modulePrefix); 13 | 14 | // Makes Ember's type definitions visible throughout the project, thereby using 15 | // TS to power autocomplete for all Ember types in any editor. 16 | /** 17 | * @typedef {import('ember-source/types')} Stable 18 | * @typedef {import('ember-source/types/preview')} Preview 19 | */ 20 | -------------------------------------------------------------------------------- /test-app/app/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-resolver/d6a8d1fde7e38b707ae8c9c6c76160469381ba1c/test-app/app/components/.gitkeep -------------------------------------------------------------------------------- /test-app/app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-resolver/d6a8d1fde7e38b707ae8c9c6c76160469381ba1c/test-app/app/controllers/.gitkeep -------------------------------------------------------------------------------- /test-app/app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-resolver/d6a8d1fde7e38b707ae8c9c6c76160469381ba1c/test-app/app/helpers/.gitkeep -------------------------------------------------------------------------------- /test-app/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TestApp 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | 12 | 13 | 14 | 15 | {{content-for "head-footer"}} 16 | 17 | 18 | {{content-for "body"}} 19 | 20 | 21 | 22 | 23 | {{content-for "body-footer"}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /test-app/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-resolver/d6a8d1fde7e38b707ae8c9c6c76160469381ba1c/test-app/app/models/.gitkeep -------------------------------------------------------------------------------- /test-app/app/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember-resolver'; 2 | 3 | export default Resolver; 4 | -------------------------------------------------------------------------------- /test-app/app/router.js: -------------------------------------------------------------------------------- 1 | import EmberRouter from '@ember/routing/router'; 2 | import config from './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 | -------------------------------------------------------------------------------- /test-app/app/routes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-resolver/d6a8d1fde7e38b707ae8c9c6c76160469381ba1c/test-app/app/routes/.gitkeep -------------------------------------------------------------------------------- /test-app/app/styles/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ember-cli/ember-resolver/d6a8d1fde7e38b707ae8c9c6c76160469381ba1c/test-app/app/styles/app.css -------------------------------------------------------------------------------- /test-app/app/templates/application.hbs: -------------------------------------------------------------------------------- 1 | {{outlet}} -------------------------------------------------------------------------------- /test-app/config/ember-cli-update.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": "1.0.0", 3 | "packages": [ 4 | { 5 | "name": "ember-cli", 6 | "version": "4.12.1", 7 | "blueprints": [ 8 | { 9 | "name": "app", 10 | "outputRepo": "https://github.com/ember-cli/ember-new-output", 11 | "codemodsSource": "ember-app-codemods-manifest@1", 12 | "isBaseBlueprint": true, 13 | "options": [ 14 | "--no-welcome" 15 | ] 16 | } 17 | ] 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /test-app/config/ember-try.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const getChannelURL = require('ember-source-channel-url'); 4 | 5 | const EMBROIDER_VERSION = '^1.8.0'; 6 | const embroider = { 7 | safe: { 8 | name: 'embroider-safe', 9 | npm: { 10 | devDependencies: { 11 | '@embroider/core': EMBROIDER_VERSION, 12 | '@embroider/webpack': EMBROIDER_VERSION, 13 | '@embroider/compat': EMBROIDER_VERSION, 14 | '@embroider/test-setup': EMBROIDER_VERSION, 15 | }, 16 | }, 17 | env: { 18 | EMBROIDER_TEST_SETUP_OPTIONS: 'safe', 19 | }, 20 | }, 21 | 22 | optimized: { 23 | name: 'embroider-optimized', 24 | npm: { 25 | devDependencies: { 26 | '@embroider/core': EMBROIDER_VERSION, 27 | '@embroider/webpack': EMBROIDER_VERSION, 28 | '@embroider/compat': EMBROIDER_VERSION, 29 | '@embroider/test-setup': EMBROIDER_VERSION, 30 | }, 31 | }, 32 | env: { 33 | EMBROIDER_TEST_SETUP_OPTIONS: 'optimized', 34 | }, 35 | }, 36 | }; 37 | 38 | module.exports = async function () { 39 | return { 40 | buildManagerOptions() { 41 | return ['--no-package-lock', '--legacy-peer-deps']; 42 | }, 43 | 44 | scenarios: [ 45 | { 46 | name: 'ember-lts-4.12', 47 | npm: { 48 | devDependencies: { 49 | 'ember-source': '~4.12.0', 50 | }, 51 | }, 52 | }, 53 | { 54 | name: 'ember-lts-5.4', 55 | npm: { 56 | devDependencies: { 57 | 'ember-source': '~5.4.0', 58 | }, 59 | }, 60 | }, 61 | { 62 | name: 'ember-lts-5.8', 63 | npm: { 64 | devDependencies: { 65 | 'ember-source': '~5.8.0', 66 | }, 67 | }, 68 | }, 69 | { 70 | name: 'ember-release', 71 | npm: { 72 | devDependencies: { 73 | 'ember-source': await getChannelURL('release'), 74 | }, 75 | }, 76 | }, 77 | { 78 | name: 'ember-beta', 79 | npm: { 80 | devDependencies: { 81 | 'ember-source': await getChannelURL('beta'), 82 | }, 83 | }, 84 | }, 85 | { 86 | name: 'ember-canary', 87 | npm: { 88 | devDependencies: { 89 | 'ember-source': await getChannelURL('canary'), 90 | }, 91 | }, 92 | }, 93 | // The default `.travis.yml` runs this scenario via `yarn test`, 94 | // not via `ember try`. It's still included here so that running 95 | // `ember try:each` manually or from a customized CI config will run it 96 | // along with all the other scenarios. 97 | { 98 | name: 'ember-default', 99 | npm: { 100 | devDependencies: {}, 101 | }, 102 | }, 103 | embroider.safe, 104 | embroider.optimized, 105 | ], 106 | }; 107 | }; 108 | -------------------------------------------------------------------------------- /test-app/config/environment.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function (environment) { 4 | let ENV = { 5 | modulePrefix: 'test-app', 6 | environment, 7 | rootURL: '/', 8 | locationType: 'auto', 9 | EmberENV: { 10 | FEATURES: { 11 | // Here you can enable experimental features on an ember canary build 12 | // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true 13 | }, 14 | EXTEND_PROTOTYPES: { 15 | // Prevent Ember Data from overriding Date.parse. 16 | Date: false, 17 | }, 18 | }, 19 | 20 | APP: { 21 | // Here you can pass flags/options to your application instance 22 | // when it is created 23 | }, 24 | }; 25 | 26 | if (environment === 'development') { 27 | // ENV.APP.LOG_RESOLVER = true; 28 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 29 | // ENV.APP.LOG_TRANSITIONS = true; 30 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 31 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 32 | } 33 | 34 | if (environment === 'test') { 35 | // Testem prefers this... 36 | ENV.locationType = 'none'; 37 | 38 | // keep test console output quieter 39 | ENV.APP.LOG_ACTIVE_GENERATION = false; 40 | ENV.APP.LOG_VIEW_LOOKUPS = false; 41 | 42 | ENV.APP.rootElement = '#ember-testing'; 43 | ENV.APP.autoboot = false; 44 | } 45 | 46 | if (environment === 'production') { 47 | // here you can enable a production-specific feature 48 | } 49 | 50 | return ENV; 51 | }; 52 | -------------------------------------------------------------------------------- /test-app/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 | -------------------------------------------------------------------------------- /test-app/config/release.js: -------------------------------------------------------------------------------- 1 | var execSync = require('child_process').execSync; 2 | 3 | module.exports = { 4 | // Publish the new release to NPM after a successful push 5 | afterPush: function () { 6 | var output = execSync('npm publish', { encoding: 'utf8' }); 7 | // eslint-disable-next-line no-console 8 | console.log(output); 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /test-app/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 | -------------------------------------------------------------------------------- /test-app/ember-cli-build.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const EmberApp = require('ember-cli/lib/broccoli/ember-app'); 4 | 5 | module.exports = function (defaults) { 6 | let app = new EmberApp(defaults, { 7 | // Add options here 8 | }); 9 | 10 | /* 11 | This build file specifies the options for the dummy test app of this 12 | addon, located in `/tests/dummy` 13 | This build file does *not* influence how the addon or the app using it 14 | behave. You most likely want to be modifying `./index.js` or app's build file 15 | */ 16 | 17 | const { maybeEmbroider } = require('@embroider/test-setup'); 18 | return maybeEmbroider(app, { 19 | skipBabel: [ 20 | { 21 | package: 'qunit', 22 | }, 23 | ], 24 | }); 25 | }; 26 | -------------------------------------------------------------------------------- /test-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-app", 3 | "private": true, 4 | "version": "13.1.1", 5 | "description": "The default modules based resolver for Ember CLI.", 6 | "keywords": [], 7 | "homepage": "https://github.com/ember-cli/ember-resolver#readme", 8 | "bugs": { 9 | "url": "https://github.com/ember-cli/ember-resolver/issues" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/ember-cli/ember-resolver.git" 14 | }, 15 | "license": "MIT", 16 | "author": "Robert Jackson ", 17 | "main": "index.js", 18 | "directories": { 19 | "doc": "doc", 20 | "test": "tests" 21 | }, 22 | "scripts": { 23 | "build": "ember build --environment=production", 24 | "start": "ember serve", 25 | "test": "ember test", 26 | "test:ember": "ember test", 27 | "test:ember-compatibility": "ember try:each" 28 | }, 29 | "devDependencies": { 30 | "@babel/eslint-parser": "^7.21.3", 31 | "@babel/plugin-proposal-decorators": "^7.21.0", 32 | "@ember/optional-features": "^2.0.0", 33 | "@ember/test-helpers": "^2.8.1", 34 | "@embroider/test-setup": "^2.1.1", 35 | "broccoli-asset-rev": "^3.0.0", 36 | "ember-auto-import": "^2.6.3", 37 | "ember-cli": "~4.12.1", 38 | "ember-cli-babel": "^7.26.11", 39 | "ember-cli-dependency-checker": "^3.3.1", 40 | "ember-cli-htmlbars": "^6.2.0", 41 | "ember-cli-inject-live-reload": "^2.1.0", 42 | "ember-disable-prototype-extensions": "^1.1.3", 43 | "ember-load-initializers": "^2.1.2", 44 | "ember-qunit": "^6.2.0", 45 | "ember-resolver": "13.1.1", 46 | "ember-source": "~4.12.0", 47 | "ember-source-channel-url": "^3.0.0", 48 | "ember-try": "^2.0.0", 49 | "loader.js": "^4.7.0", 50 | "npm-run-all": "^4.1.5", 51 | "prettier": "^2.8.7", 52 | "qunit": "^2.19.4", 53 | "qunit-dom": "^2.0.0", 54 | "webpack": "^5.78.0" 55 | }, 56 | "engines": { 57 | "node": "14.* || 16.* || >= 18" 58 | }, 59 | "publishConfig": { 60 | "registry": "https://registry.npmjs.org" 61 | }, 62 | "ember": { 63 | "edition": "octane" 64 | }, 65 | "release-it": { 66 | "plugins": { 67 | "@release-it-plugins/workspaces": true 68 | }, 69 | "npm": false 70 | }, 71 | "volta": { 72 | "extends": "../package.json" 73 | }, 74 | "dependencies": { 75 | "@embroider/macros": "^1.16.2" 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /test-app/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /test-app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /test-app/server/index.js: -------------------------------------------------------------------------------- 1 | module.exports = (app) => app.get('/', (_, res) => res.redirect('/tests')); 2 | -------------------------------------------------------------------------------- /test-app/testem.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | test_page: 'tests/index.html?hidepassed', 3 | disable_watching: true, 4 | launch_in_ci: ['Chrome'], 5 | launch_in_dev: ['Chrome'], 6 | browser_args: { 7 | Chrome: { 8 | ci: [ 9 | // --no-sandbox is needed when running Chrome inside a container 10 | process.env.CI ? '--no-sandbox' : null, 11 | '--headless', 12 | '--disable-dev-shm-usage', 13 | '--disable-software-rasterizer', 14 | '--mute-audio', 15 | '--remote-debugging-port=0', 16 | '--window-size=1440,900', 17 | ].filter(Boolean), 18 | }, 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /test-app/tests/helpers/create-test-function.js: -------------------------------------------------------------------------------- 1 | import { test } from 'qunit'; 2 | 3 | export default function (fn) { 4 | return function (given, expected, description) { 5 | test(description, function (assert) { 6 | assert.deepEqual(fn(given), expected); 7 | }); 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /test-app/tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from '../../resolver'; 2 | import config from '../../config/environment'; 3 | 4 | const resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix, 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /test-app/tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TestApp Tests 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | {{content-for "test-head"}} 12 | 13 | 14 | 15 | 16 | 17 | {{content-for "head-footer"}} 18 | {{content-for "test-head-footer"}} 19 | 20 | 21 | {{content-for "body"}} 22 | {{content-for "test-body"}} 23 | 24 |
25 |
26 |
27 |
28 |
29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | {{content-for "body-footer"}} 38 | {{content-for "test-body-footer"}} 39 | 40 | 41 | -------------------------------------------------------------------------------- /test-app/tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import Application from '../app'; 2 | import config from '../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 | -------------------------------------------------------------------------------- /test-app/tests/unit/classify_test.js: -------------------------------------------------------------------------------- 1 | import { module } from 'qunit'; 2 | import { classify } from 'ember-resolver/string/index'; 3 | import createTestFunction from '../helpers/create-test-function'; 4 | 5 | module('classify', function () { 6 | const test = createTestFunction(classify); 7 | 8 | test('my favorite items', 'MyFavoriteItems', 'classify normal string'); 9 | test('css-class-name', 'CssClassName', 'classify dasherized string'); 10 | test('action_name', 'ActionName', 'classify underscored string'); 11 | test( 12 | 'privateDocs/ownerInvoice', 13 | 'PrivateDocs/OwnerInvoice', 14 | 'classify namespaced camelized string' 15 | ); 16 | test( 17 | 'private_docs/owner_invoice', 18 | 'PrivateDocs/OwnerInvoice', 19 | 'classify namespaced underscored string' 20 | ); 21 | test( 22 | 'private-docs/owner-invoice', 23 | 'PrivateDocs/OwnerInvoice', 24 | 'classify namespaced dasherized string' 25 | ); 26 | test( 27 | '-view-registry', 28 | '_ViewRegistry', 29 | 'classify prefixed dasherized string' 30 | ); 31 | test( 32 | 'components/-text-field', 33 | 'Components/_TextField', 34 | 'classify namespaced prefixed dasherized string' 35 | ); 36 | test( 37 | '_Foo_Bar', 38 | '_FooBar', 39 | 'classify underscore-prefixed underscored string' 40 | ); 41 | test('_Foo-Bar', '_FooBar', 'classify underscore-prefixed dasherized string'); 42 | test( 43 | '_foo/_bar', 44 | '_Foo/_Bar', 45 | 'classify underscore-prefixed-namespaced underscore-prefixed string' 46 | ); 47 | test( 48 | '-foo/_bar', 49 | '_Foo/_Bar', 50 | 'classify dash-prefixed-namespaced underscore-prefixed string' 51 | ); 52 | test( 53 | '-foo/-bar', 54 | '_Foo/_Bar', 55 | 'classify dash-prefixed-namespaced dash-prefixed string' 56 | ); 57 | test('InnerHTML', 'InnerHTML', 'does nothing with classified string'); 58 | test('_FooBar', '_FooBar', 'does nothing with classified prefixed string'); 59 | }); 60 | -------------------------------------------------------------------------------- /test-app/tests/unit/dasherize_test.js: -------------------------------------------------------------------------------- 1 | import { module } from 'qunit'; 2 | import { dasherize } from 'ember-resolver/string/index'; 3 | import createTestFunction from '../helpers/create-test-function'; 4 | 5 | module('dasherize', function () { 6 | const test = createTestFunction(dasherize); 7 | 8 | test('my favorite items', 'my-favorite-items', 'dasherize normal string'); 9 | test( 10 | 'css-class-name', 11 | 'css-class-name', 12 | 'does nothing with dasherized string' 13 | ); 14 | test('action_name', 'action-name', 'dasherize underscored string'); 15 | test('innerHTML', 'inner-html', 'dasherize camelcased string'); 16 | test( 17 | 'toString', 18 | 'to-string', 19 | 'dasherize string that is the property name of Object.prototype' 20 | ); 21 | test( 22 | 'PrivateDocs/OwnerInvoice', 23 | 'private-docs/owner-invoice', 24 | 'dasherize namespaced classified string' 25 | ); 26 | test( 27 | 'privateDocs/ownerInvoice', 28 | 'private-docs/owner-invoice', 29 | 'dasherize namespaced camelized string' 30 | ); 31 | test( 32 | 'private_docs/owner_invoice', 33 | 'private-docs/owner-invoice', 34 | 'dasherize namespaced underscored string' 35 | ); 36 | }); 37 | -------------------------------------------------------------------------------- /test-app/tests/unit/decamelize_test.js: -------------------------------------------------------------------------------- 1 | import { module } from 'qunit'; 2 | import { decamelize } from 'ember-resolver/string/index'; 3 | import createTestFunction from '../helpers/create-test-function'; 4 | 5 | module('decamelize', function () { 6 | const test = createTestFunction(decamelize); 7 | 8 | test( 9 | 'my favorite items', 10 | 'my favorite items', 11 | 'does nothing with normal string' 12 | ); 13 | test( 14 | 'css-class-name', 15 | 'css-class-name', 16 | 'does nothing with dasherized string' 17 | ); 18 | test('action_name', 'action_name', 'does nothing with underscored string'); 19 | test( 20 | 'innerHTML', 21 | 'inner_html', 22 | 'converts a camelized string into all lower case separated by underscores.' 23 | ); 24 | test('size160Url', 'size160_url', 'decamelizes strings with numbers'); 25 | test( 26 | 'PrivateDocs/OwnerInvoice', 27 | 'private_docs/owner_invoice', 28 | 'decamelize namespaced classified string' 29 | ); 30 | test( 31 | 'privateDocs/ownerInvoice', 32 | 'private_docs/owner_invoice', 33 | 'decamelize namespaced camelized string' 34 | ); 35 | }); 36 | -------------------------------------------------------------------------------- /test-app/tests/unit/resolvers/classic/-setup-resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver, { ModuleRegistry } from 'ember-resolver'; 2 | 3 | import { setOwner } from '@ember/owner'; 4 | 5 | export let resolver; 6 | export let loader; 7 | 8 | export function setupResolver(options = {}) { 9 | let owner = options.owner; 10 | delete options.owner; 11 | 12 | if (!options.namespace) { 13 | options.namespace = { modulePrefix: 'appkit' }; 14 | } 15 | loader = { 16 | entries: Object.create(null), 17 | define(id, deps, callback) { 18 | if (deps.length > 0) { 19 | throw new Error('Test Module loader does not support dependencies'); 20 | } 21 | this.entries[id] = callback; 22 | }, 23 | }; 24 | options._moduleRegistry = new ModuleRegistry(loader.entries); 25 | options._moduleRegistry.get = function (moduleName) { 26 | return loader.entries[moduleName](); 27 | }; 28 | 29 | resolver = Resolver.create(options); 30 | 31 | if (owner) { 32 | setOwner(resolver, owner); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test-app/tests/unit/resolvers/classic/basic-test.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import { module, test } from 'qunit'; 4 | import { setupResolver, resolver, loader } from './-setup-resolver'; 5 | 6 | let originalConsoleInfo; 7 | 8 | module('ember-resolver/resolvers/classic', function (hooks) { 9 | hooks.beforeEach(function () { 10 | setupResolver(); 11 | }); 12 | 13 | hooks.afterEach(function () { 14 | if (originalConsoleInfo) { 15 | console.info = originalConsoleInfo; 16 | } 17 | }); 18 | 19 | // ember @ 3.3 breaks this: https://github.com/emberjs/ember.js/commit/b8613c20289cc8a730e181c4c51ecfc4b6836052#r29790209 20 | // ember @ 3.4.0-beta.1 restores this: https://github.com/emberjs/ember.js/commit/ddd8d9b9d9f6d315185a34802618a666bb3aeaac 21 | // test('does not require `namespace` to exist at `init` time', function(assert) { 22 | // assert.expect(0); 23 | 24 | // Resolver.create({ namespace: '' }); 25 | // }); 26 | 27 | test('can lookup something', function (assert) { 28 | assert.expect(2); 29 | 30 | loader.define('appkit/adapters/post', [], function () { 31 | assert.ok(true, 'adapter was invoked properly'); 32 | 33 | return {}; 34 | }); 35 | 36 | var adapter = resolver.resolve('adapter:post'); 37 | 38 | assert.ok(adapter, 'adapter was returned'); 39 | }); 40 | 41 | test('can lookup something in another namespace', function (assert) { 42 | assert.expect(3); 43 | 44 | let expected = {}; 45 | 46 | loader.define('other/adapters/post', [], function () { 47 | assert.ok(true, 'adapter was invoked properly'); 48 | 49 | return { 50 | default: expected, 51 | }; 52 | }); 53 | 54 | var adapter = resolver.resolve('other@adapter:post'); 55 | 56 | assert.ok(adapter, 'adapter was returned'); 57 | assert.equal(adapter, expected, 'default export was returned'); 58 | }); 59 | 60 | test('can lookup something in another namespace with an @ scope', function (assert) { 61 | assert.expect(3); 62 | 63 | let expected = {}; 64 | 65 | loader.define('@scope/other/adapters/post', [], function () { 66 | assert.ok(true, 'adapter was invoked properly'); 67 | 68 | return { 69 | default: expected, 70 | }; 71 | }); 72 | 73 | var adapter = resolver.resolve('@scope/other@adapter:post'); 74 | 75 | assert.ok(adapter, 'adapter was returned'); 76 | assert.equal(adapter, expected, 'default export was returned'); 77 | }); 78 | 79 | test('can lookup something with an @ sign', function (assert) { 80 | assert.expect(3); 81 | 82 | let expected = {}; 83 | loader.define('appkit/helpers/@content-helper', [], function () { 84 | assert.ok(true, 'helper was invoked properly'); 85 | 86 | return { default: expected }; 87 | }); 88 | 89 | var helper = resolver.resolve('helper:@content-helper'); 90 | 91 | assert.ok(helper, 'helper was returned'); 92 | assert.equal(helper, expected, 'default export was returned'); 93 | }); 94 | 95 | test('can lookup something in another namespace with different syntax', function (assert) { 96 | assert.expect(3); 97 | 98 | let expected = {}; 99 | loader.define('other/adapters/post', [], function () { 100 | assert.ok(true, 'adapter was invoked properly'); 101 | 102 | return { default: expected }; 103 | }); 104 | 105 | var adapter = resolver.resolve('adapter:other@post'); 106 | 107 | assert.ok(adapter, 'adapter was returned'); 108 | assert.equal(adapter, expected, 'default export was returned'); 109 | }); 110 | 111 | test('can lookup something in another namespace with an @ scope with different syntax', function (assert) { 112 | assert.expect(3); 113 | 114 | let expected = {}; 115 | loader.define('@scope/other/adapters/post', [], function () { 116 | assert.ok(true, 'adapter was invoked properly'); 117 | 118 | return { default: expected }; 119 | }); 120 | 121 | var adapter = resolver.resolve('adapter:@scope/other@post'); 122 | 123 | assert.ok(adapter, 'adapter was returned'); 124 | assert.equal(adapter, expected, 'default export was returned'); 125 | }); 126 | 127 | test('can lookup a view in another namespace', function (assert) { 128 | assert.expect(3); 129 | 130 | let expected = { isViewFactory: true }; 131 | loader.define('other/views/post', [], function () { 132 | assert.ok(true, 'view was invoked properly'); 133 | 134 | return { default: expected }; 135 | }); 136 | 137 | var view = resolver.resolve('other@view:post'); 138 | 139 | assert.ok(view, 'view was returned'); 140 | assert.equal(view, expected, 'default export was returned'); 141 | }); 142 | 143 | test('can lookup a view in another namespace with an @ scope', function (assert) { 144 | assert.expect(3); 145 | 146 | let expected = { isViewFactory: true }; 147 | loader.define('@scope/other/views/post', [], function () { 148 | assert.ok(true, 'view was invoked properly'); 149 | 150 | return { default: expected }; 151 | }); 152 | 153 | var view = resolver.resolve('@scope/other@view:post'); 154 | 155 | assert.ok(view, 'view was returned'); 156 | assert.equal(view, expected, 'default export was returned'); 157 | }); 158 | 159 | test('can lookup a view in another namespace with different syntax', function (assert) { 160 | assert.expect(3); 161 | 162 | let expected = { isViewFactory: true }; 163 | loader.define('other/views/post', [], function () { 164 | assert.ok(true, 'view was invoked properly'); 165 | 166 | return { default: expected }; 167 | }); 168 | 169 | var view = resolver.resolve('view:other@post'); 170 | 171 | assert.ok(view, 'view was returned'); 172 | assert.equal(view, expected, 'default export was returned'); 173 | }); 174 | 175 | test('can lookup a view in another namespace with an @ scope with different syntax', function (assert) { 176 | assert.expect(3); 177 | 178 | let expected = { isViewFactory: true }; 179 | loader.define('@scope/other/views/post', [], function () { 180 | assert.ok(true, 'view was invoked properly'); 181 | 182 | return { default: expected }; 183 | }); 184 | 185 | var view = resolver.resolve('view:@scope/other@post'); 186 | 187 | assert.ok(view, 'view was returned'); 188 | assert.equal(view, expected, 'default export was returned'); 189 | }); 190 | 191 | test('can lookup a component template in another namespace with different syntax', function (assert) { 192 | assert.expect(2); 193 | 194 | let expected = { isTemplate: true }; 195 | loader.define('other/templates/components/foo-bar', [], function () { 196 | assert.ok(true, 'template was looked up properly'); 197 | 198 | return { default: expected }; 199 | }); 200 | 201 | var template = resolver.resolve('template:components/other@foo-bar'); 202 | 203 | assert.equal(template, expected, 'default export was returned'); 204 | }); 205 | 206 | test('can lookup a component template in another namespace with an @ scope with different syntax', function (assert) { 207 | assert.expect(2); 208 | 209 | let expected = { isTemplate: true }; 210 | loader.define('@scope/other/templates/components/foo-bar', [], function () { 211 | assert.ok(true, 'template was looked up properly'); 212 | 213 | return { default: expected }; 214 | }); 215 | 216 | var template = resolver.resolve('template:components/@scope/other@foo-bar'); 217 | 218 | assert.equal(template, expected, 'default export was returned'); 219 | }); 220 | 221 | test('can lookup a view', function (assert) { 222 | assert.expect(3); 223 | 224 | let expected = { isViewFactory: true }; 225 | loader.define('appkit/views/queue-list', [], function () { 226 | assert.ok(true, 'view was invoked properly'); 227 | 228 | return { default: expected }; 229 | }); 230 | 231 | var view = resolver.resolve('view:queue-list'); 232 | 233 | assert.ok(view, 'view was returned'); 234 | assert.equal(view, expected, 'default export was returned'); 235 | }); 236 | 237 | test('can lookup a helper', function (assert) { 238 | assert.expect(3); 239 | 240 | let expected = { isHelperInstance: true }; 241 | loader.define('appkit/helpers/reverse-list', [], function () { 242 | assert.ok(true, 'helper was invoked properly'); 243 | 244 | return { default: expected }; 245 | }); 246 | 247 | var helper = resolver.resolve('helper:reverse-list'); 248 | 249 | assert.ok(helper, 'helper was returned'); 250 | assert.equal(helper, expected, 'default export was returned'); 251 | }); 252 | 253 | test('can lookup an engine', function (assert) { 254 | assert.expect(3); 255 | 256 | let expected = {}; 257 | loader.define('appkit/engine', [], function () { 258 | assert.ok(true, 'engine was invoked properly'); 259 | 260 | return { default: expected }; 261 | }); 262 | 263 | let engine = resolver.resolve('engine:appkit'); 264 | 265 | assert.ok(engine, 'engine was returned'); 266 | assert.equal(engine, expected, 'default export was returned'); 267 | }); 268 | 269 | test('can lookup an engine from a scoped package', function (assert) { 270 | assert.expect(3); 271 | 272 | let expected = {}; 273 | loader.define('@some-scope/some-module/engine', [], function () { 274 | assert.ok(true, 'engine was invoked properly'); 275 | 276 | return { default: expected }; 277 | }); 278 | 279 | var engine = resolver.resolve('engine:@some-scope/some-module'); 280 | 281 | assert.ok(engine, 'engine was returned'); 282 | assert.equal(engine, expected, 'default export was returned'); 283 | }); 284 | 285 | test('can lookup a route-map', function (assert) { 286 | assert.expect(3); 287 | 288 | let expected = { isRouteMap: true }; 289 | loader.define('appkit/routes', [], function () { 290 | assert.ok(true, 'route-map was invoked properly'); 291 | 292 | return { default: expected }; 293 | }); 294 | 295 | let routeMap = resolver.resolve('route-map:appkit'); 296 | 297 | assert.ok(routeMap, 'route-map was returned'); 298 | assert.equal(routeMap, expected, 'default export was returned'); 299 | }); 300 | 301 | // the assert.expectWarning helper no longer works 302 | test.skip('warns if looking up a camelCase helper that has a dasherized module present', function (assert) { 303 | assert.expect(1); 304 | 305 | loader.define('appkit/helpers/reverse-list', [], function () { 306 | return { default: { isHelperInstance: true } }; 307 | }); 308 | 309 | var helper = resolver.resolve('helper:reverseList'); 310 | 311 | assert.ok(!helper, 'no helper was returned'); 312 | // assert.expectWarning('Attempted to lookup "helper:reverseList" which was not found. In previous versions of ember-resolver, a bug would have caused the module at "appkit/helpers/reverse-list" to be returned for this camel case helper name. This has been fixed. Use the dasherized name to resolve the module that would have been returned in previous versions.'); 313 | }); 314 | 315 | test('errors if lookup of a route-map does not specify isRouteMap', function (assert) { 316 | assert.expect(2); 317 | 318 | let expected = { isRouteMap: false }; 319 | loader.define('appkit/routes', [], function () { 320 | assert.ok(true, 'route-map was invoked properly'); 321 | 322 | return { default: expected }; 323 | }); 324 | 325 | assert.throws(() => { 326 | resolver.resolve('route-map:appkit'); 327 | }, /The route map for appkit should be wrapped by 'buildRoutes' before exporting/); 328 | }); 329 | 330 | test("will return the raw value if no 'default' is available", function (assert) { 331 | loader.define('appkit/fruits/orange', [], function () { 332 | return 'is awesome'; 333 | }); 334 | 335 | assert.equal( 336 | resolver.resolve('fruit:orange'), 337 | 'is awesome', 338 | 'adapter was returned' 339 | ); 340 | }); 341 | 342 | test("will unwrap the 'default' export automatically", function (assert) { 343 | loader.define('appkit/fruits/orange', [], function () { 344 | return { default: 'is awesome' }; 345 | }); 346 | 347 | assert.equal( 348 | resolver.resolve('fruit:orange'), 349 | 'is awesome', 350 | 'adapter was returned' 351 | ); 352 | }); 353 | 354 | test('router:main is hard-coded to prefix/router.js', function (assert) { 355 | assert.expect(1); 356 | 357 | loader.define('appkit/router', [], function () { 358 | assert.ok(true, 'router:main was looked up'); 359 | return 'whatever'; 360 | }); 361 | 362 | resolver.resolve('router:main'); 363 | }); 364 | 365 | test('store:main is looked up as prefix/store', function (assert) { 366 | assert.expect(1); 367 | 368 | loader.define('appkit/store', [], function () { 369 | assert.ok(true, 'store:main was looked up'); 370 | return 'whatever'; 371 | }); 372 | 373 | resolver.resolve('store:main'); 374 | }); 375 | 376 | test('store:posts as prefix/stores/post', function (assert) { 377 | assert.expect(1); 378 | 379 | loader.define('appkit/stores/post', [], function () { 380 | assert.ok(true, 'store:post was looked up'); 381 | return 'whatever'; 382 | }); 383 | 384 | resolver.resolve('store:post'); 385 | }); 386 | 387 | test('will raise error if both dasherized and underscored modules exist', function (assert) { 388 | loader.define('appkit/big-bands/steve-miller-band', [], function () { 389 | assert.ok(true, 'dasherized version looked up'); 390 | return 'whatever'; 391 | }); 392 | 393 | loader.define('appkit/big_bands/steve_miller_band', [], function () { 394 | assert.ok(false, 'underscored version looked up'); 395 | return 'whatever'; 396 | }); 397 | 398 | try { 399 | resolver.resolve('big-band:steve-miller-band'); 400 | } catch (e) { 401 | assert.equal( 402 | e.message, 403 | `Ambiguous module names: 'appkit/big-bands/steve-miller-band' and 'appkit/big_bands/steve_miller_band'`, 404 | 'error with a descriptive value is thrown' 405 | ); 406 | } 407 | }); 408 | 409 | test('will lookup an underscored version of the module name when the dasherized version is not found', function (assert) { 410 | assert.expect(1); 411 | 412 | loader.define('appkit/big_bands/steve_miller_band', [], function () { 413 | assert.ok(true, 'underscored version looked up properly'); 414 | return 'whatever'; 415 | }); 416 | 417 | resolver.resolve('big-band:steve-miller-band'); 418 | }); 419 | 420 | test('it provides eachForType which invokes the callback for each item found', function (assert) { 421 | function orange() {} 422 | loader.define('appkit/fruits/orange', [], function () { 423 | return { default: orange }; 424 | }); 425 | 426 | function apple() {} 427 | loader.define('appkit/fruits/apple', [], function () { 428 | return { default: apple }; 429 | }); 430 | 431 | function other() {} 432 | loader.define('appkit/stuffs/other', [], function () { 433 | return { default: other }; 434 | }); 435 | 436 | var items = resolver.knownForType('fruit'); 437 | 438 | assert.deepEqual(items, { 439 | 'fruit:orange': true, 440 | 'fruit:apple': true, 441 | }); 442 | }); 443 | 444 | test('eachForType can find both pod and non-pod factories', function (assert) { 445 | function orange() {} 446 | loader.define('appkit/fruits/orange', [], function () { 447 | return { default: orange }; 448 | }); 449 | 450 | function lemon() {} 451 | loader.define('appkit/lemon/fruit', [], function () { 452 | return { default: lemon }; 453 | }); 454 | 455 | var items = resolver.knownForType('fruit'); 456 | 457 | assert.deepEqual(items, { 458 | 'fruit:orange': true, 459 | 'fruit:lemon': true, 460 | }); 461 | }); 462 | 463 | test('if shouldWrapInClassFactory returns true a wrapped object is returned', function (assert) { 464 | resolver.shouldWrapInClassFactory = function (defaultExport, parsedName) { 465 | assert.equal(defaultExport, 'foo'); 466 | assert.equal(parsedName.fullName, 'string:foo'); 467 | 468 | return true; 469 | }; 470 | 471 | loader.define('appkit/strings/foo', [], function () { 472 | return { default: 'foo' }; 473 | }); 474 | 475 | var value = resolver.resolve('string:foo'); 476 | 477 | assert.equal(value.create(), 'foo'); 478 | }); 479 | 480 | test('normalization', function (assert) { 481 | assert.ok(resolver.normalize, 'resolver#normalize is present'); 482 | 483 | assert.equal(resolver.normalize('foo:bar'), 'foo:bar'); 484 | 485 | assert.equal(resolver.normalize('controller:posts'), 'controller:posts'); 486 | assert.equal( 487 | resolver.normalize('controller:posts_index'), 488 | 'controller:posts-index' 489 | ); 490 | assert.equal( 491 | resolver.normalize('controller:posts.index'), 492 | 'controller:posts/index' 493 | ); 494 | assert.equal( 495 | resolver.normalize('controller:posts-index'), 496 | 'controller:posts-index' 497 | ); 498 | assert.equal( 499 | resolver.normalize('controller:posts.post.index'), 500 | 'controller:posts/post/index' 501 | ); 502 | assert.equal( 503 | resolver.normalize('controller:posts_post.index'), 504 | 'controller:posts-post/index' 505 | ); 506 | assert.equal( 507 | resolver.normalize('controller:posts.post_index'), 508 | 'controller:posts/post-index' 509 | ); 510 | assert.equal( 511 | resolver.normalize('controller:posts.post-index'), 512 | 'controller:posts/post-index' 513 | ); 514 | assert.equal( 515 | resolver.normalize('controller:postsIndex'), 516 | 'controller:posts-index' 517 | ); 518 | assert.equal( 519 | resolver.normalize('controller:blogPosts.index'), 520 | 'controller:blog-posts/index' 521 | ); 522 | assert.equal( 523 | resolver.normalize('controller:blog/posts.index'), 524 | 'controller:blog/posts/index' 525 | ); 526 | assert.equal( 527 | resolver.normalize('controller:blog/posts-index'), 528 | 'controller:blog/posts-index' 529 | ); 530 | assert.equal( 531 | resolver.normalize('controller:blog/posts.post.index'), 532 | 'controller:blog/posts/post/index' 533 | ); 534 | assert.equal( 535 | resolver.normalize('controller:blog/posts_post.index'), 536 | 'controller:blog/posts-post/index' 537 | ); 538 | assert.equal( 539 | resolver.normalize('controller:blog/posts_post-index'), 540 | 'controller:blog/posts-post-index' 541 | ); 542 | 543 | assert.equal( 544 | resolver.normalize('template:blog/posts_index'), 545 | 'template:blog/posts-index' 546 | ); 547 | assert.equal(resolver.normalize('service:userAuth'), 'service:user-auth'); 548 | 549 | // For helpers, we have special logic to avoid the situation of a template's 550 | // `{{someName}}` being surprisingly shadowed by a `some-name` helper 551 | assert.equal( 552 | resolver.normalize('helper:make-fabulous'), 553 | 'helper:make-fabulous' 554 | ); 555 | assert.equal(resolver.normalize('helper:fabulize'), 'helper:fabulize'); 556 | assert.equal( 557 | resolver.normalize('helper:make_fabulous'), 558 | 'helper:make-fabulous' 559 | ); 560 | assert.equal( 561 | resolver.normalize('helper:makeFabulous'), 562 | 'helper:makeFabulous' 563 | ); 564 | 565 | // The same applies to components 566 | assert.equal( 567 | resolver.normalize('component:fabulous-component'), 568 | 'component:fabulous-component' 569 | ); 570 | assert.equal( 571 | resolver.normalize('component:fabulousComponent'), 572 | 'component:fabulousComponent' 573 | ); 574 | assert.equal( 575 | resolver.normalize('template:components/fabulousComponent'), 576 | 'template:components/fabulousComponent' 577 | ); 578 | 579 | // and modifiers 580 | assert.equal( 581 | resolver.normalize('modifier:fabulous-component'), 582 | 'modifier:fabulous-component' 583 | ); 584 | 585 | // deprecated when fabulously-missing actually exists, but normalize still returns it 586 | assert.equal( 587 | resolver.normalize('modifier:fabulouslyMissing'), 588 | 'modifier:fabulouslyMissing' 589 | ); 590 | }); 591 | 592 | test('camel case modifier is not normalized', function (assert) { 593 | assert.expect(2); 594 | 595 | let expected = {}; 596 | loader.define('appkit/modifiers/other-thing', [], function () { 597 | assert.ok(false, 'appkit/modifiers/other-thing was accessed'); 598 | 599 | return { default: 'oh no' }; 600 | }); 601 | 602 | loader.define('appkit/modifiers/otherThing', [], function () { 603 | assert.ok(true, 'appkit/modifiers/otherThing was accessed'); 604 | 605 | return { default: expected }; 606 | }); 607 | 608 | let modifier = resolver.resolve('modifier:otherThing'); 609 | 610 | assert.strictEqual(modifier, expected); 611 | }); 612 | 613 | test('normalization is idempotent', function (assert) { 614 | let examples = [ 615 | 'controller:posts', 616 | 'controller:posts.post.index', 617 | 'controller:blog/posts.post_index', 618 | 'template:foo_bar', 619 | ]; 620 | 621 | examples.forEach((example) => { 622 | assert.equal( 623 | resolver.normalize(resolver.normalize(example)), 624 | resolver.normalize(example) 625 | ); 626 | }); 627 | }); 628 | }); 629 | -------------------------------------------------------------------------------- /test-app/tests/unit/resolvers/classic/custom-prefixes-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | 3 | import { setupResolver, resolver, loader } from './-setup-resolver'; 4 | 5 | module('custom prefixes by type', function (hooks) { 6 | hooks.beforeEach(function () { 7 | setupResolver(); 8 | }); 9 | 10 | test('will use the prefix specified for a given type if present', function (assert) { 11 | setupResolver({ 12 | namespace: { 13 | fruitPrefix: 'grovestand', 14 | modulePrefix: 'appkit', 15 | }, 16 | }); 17 | 18 | loader.define('grovestand/fruits/orange', [], function () { 19 | assert.ok(true, 'custom prefix used'); 20 | return 'whatever'; 21 | }); 22 | 23 | resolver.resolve('fruit:orange'); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /test-app/tests/unit/resolvers/classic/pods-test.js: -------------------------------------------------------------------------------- 1 | import { module, test } from 'qunit'; 2 | 3 | import { setupResolver, resolver, loader } from './-setup-resolver'; 4 | 5 | module('pods lookup structure', function (hooks) { 6 | hooks.beforeEach(function () { 7 | setupResolver(); 8 | }); 9 | 10 | test('will lookup modulePrefix/name/type before prefix/type/name', function (assert) { 11 | loader.define('appkit/controllers/foo', [], function () { 12 | assert.ok(false, 'appkit/controllers was used'); 13 | return 'whatever'; 14 | }); 15 | 16 | loader.define('appkit/foo/controller', [], function () { 17 | assert.ok(true, 'appkit/foo/controllers was used'); 18 | return 'whatever'; 19 | }); 20 | 21 | resolver.resolve('controller:foo'); 22 | }); 23 | 24 | test('will lookup names with slashes properly', function (assert) { 25 | loader.define('appkit/controllers/foo/index', [], function () { 26 | assert.ok(false, 'appkit/controllers was used'); 27 | return 'whatever'; 28 | }); 29 | 30 | loader.define('appkit/foo/index/controller', [], function () { 31 | assert.ok(true, 'appkit/foo/index/controller was used'); 32 | return 'whatever'; 33 | }); 34 | 35 | resolver.resolve('controller:foo/index'); 36 | }); 37 | 38 | test('specifying a podModulePrefix overrides the general modulePrefix', function (assert) { 39 | setupResolver({ 40 | namespace: { 41 | modulePrefix: 'appkit', 42 | podModulePrefix: 'appkit/pods', 43 | }, 44 | }); 45 | 46 | loader.define('appkit/controllers/foo', [], function () { 47 | assert.ok(false, 'appkit/controllers was used'); 48 | return 'whatever'; 49 | }); 50 | 51 | loader.define('appkit/foo/controller', [], function () { 52 | assert.ok(false, 'appkit/foo/controllers was used'); 53 | return 'whatever'; 54 | }); 55 | 56 | loader.define('appkit/pods/foo/controller', [], function () { 57 | assert.ok(true, 'appkit/pods/foo/controllers was used'); 58 | return 'whatever'; 59 | }); 60 | 61 | resolver.resolve('controller:foo'); 62 | }); 63 | 64 | test('will not use custom type prefix when using POD format', function (assert) { 65 | resolver.namespace['controllerPrefix'] = 'foobar'; 66 | 67 | loader.define('foobar/controllers/foo', [], function () { 68 | assert.ok(false, 'foobar/controllers was used'); 69 | return 'whatever'; 70 | }); 71 | 72 | loader.define('foobar/foo/controller', [], function () { 73 | assert.ok(false, 'foobar/foo/controllers was used'); 74 | return 'whatever'; 75 | }); 76 | 77 | loader.define('appkit/foo/controller', [], function () { 78 | assert.ok(true, 'appkit/foo/controllers was used'); 79 | return 'whatever'; 80 | }); 81 | 82 | resolver.resolve('controller:foo'); 83 | }); 84 | 85 | test('it will find components nested in app/components/name/index.js', function (assert) { 86 | loader.define('appkit/components/foo-bar/index', [], function () { 87 | assert.ok(true, 'appkit/components/foo-bar was used'); 88 | 89 | return 'whatever'; 90 | }); 91 | 92 | resolver.resolve('component:foo-bar'); 93 | }); 94 | 95 | test('will lookup a components template without being rooted in `components/`', function (assert) { 96 | loader.define('appkit/components/foo-bar/template', [], function () { 97 | assert.ok(false, 'appkit/components was used'); 98 | return 'whatever'; 99 | }); 100 | 101 | loader.define('appkit/foo-bar/template', [], function () { 102 | assert.ok(true, 'appkit/foo-bar/template was used'); 103 | return 'whatever'; 104 | }); 105 | 106 | resolver.resolve('template:components/foo-bar'); 107 | }); 108 | 109 | test('will use pods format to lookup components in components/', function (assert) { 110 | assert.expect(3); 111 | 112 | let expectedComponent = { isComponentFactory: true }; 113 | loader.define('appkit/components/foo-bar/template', [], function () { 114 | assert.ok(true, 'appkit/components was used'); 115 | return 'whatever'; 116 | }); 117 | 118 | loader.define('appkit/components/foo-bar/component', [], function () { 119 | assert.ok(true, 'appkit/components was used'); 120 | return { default: expectedComponent }; 121 | }); 122 | 123 | resolver.resolve('template:components/foo-bar'); 124 | let component = resolver.resolve('component:foo-bar'); 125 | 126 | assert.equal(component, expectedComponent, 'default export was returned'); 127 | }); 128 | 129 | test('will not lookup routes in components/', function (assert) { 130 | assert.expect(1); 131 | 132 | loader.define('appkit/components/foo-bar/route', [], function () { 133 | assert.ok(false, 'appkit/components was used'); 134 | return { isRouteFactory: true }; 135 | }); 136 | 137 | loader.define('appkit/routes/foo-bar', [], function () { 138 | assert.ok(true, 'appkit/routes was used'); 139 | return { isRouteFactory: true }; 140 | }); 141 | 142 | resolver.resolve('route:foo-bar'); 143 | }); 144 | 145 | test('will not lookup non component templates in components/', function (assert) { 146 | assert.expect(1); 147 | 148 | loader.define('appkit/components/foo-bar/template', [], function () { 149 | assert.ok(false, 'appkit/components was used'); 150 | return 'whatever'; 151 | }); 152 | 153 | loader.define('appkit/templates/foo-bar', [], function () { 154 | assert.ok(true, 'appkit/templates was used'); 155 | return 'whatever'; 156 | }); 157 | 158 | resolver.resolve('template:foo-bar'); 159 | }); 160 | 161 | module('custom pluralization'); 162 | 163 | test('will use the pluralization specified for a given type', function (assert) { 164 | assert.expect(1); 165 | 166 | setupResolver({ 167 | namespace: { 168 | modulePrefix: 'appkit', 169 | }, 170 | 171 | pluralizedTypes: { 172 | sheep: 'sheep', 173 | octipus: 'octipii', 174 | }, 175 | }); 176 | 177 | loader.define('appkit/sheep/baaaaaa', [], function () { 178 | assert.ok(true, 'custom pluralization used'); 179 | return 'whatever'; 180 | }); 181 | 182 | resolver.resolve('sheep:baaaaaa'); 183 | }); 184 | 185 | test("will pluralize 'config' as 'config' by default", function (assert) { 186 | assert.expect(1); 187 | 188 | setupResolver(); 189 | 190 | loader.define('appkit/config/environment', [], function () { 191 | assert.ok(true, 'config/environment is found'); 192 | return 'whatever'; 193 | }); 194 | 195 | resolver.resolve('config:environment'); 196 | }); 197 | 198 | test("'config' can be overridden", function (assert) { 199 | assert.expect(1); 200 | 201 | setupResolver({ 202 | namespace: { 203 | modulePrefix: 'appkit', 204 | }, 205 | 206 | pluralizedTypes: { 207 | config: 'super-duper-config', 208 | }, 209 | }); 210 | 211 | loader.define('appkit/super-duper-config/environment', [], function () { 212 | assert.ok(true, 'super-duper-config/environment is found'); 213 | return 'whatever'; 214 | }); 215 | 216 | resolver.resolve('config:environment'); 217 | }); 218 | }); 219 | -------------------------------------------------------------------------------- /test-app/tests/unit/resolvers/classic/with-modues-test.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import { module, test } from 'qunit'; 4 | import Resolver from 'ember-resolver'; 5 | 6 | module('ember-resolver withModules', function () { 7 | test('explicit withModules', function (assert) { 8 | let resolver = Resolver.withModules({ 9 | 'alpha/components/hello': { 10 | default: function () { 11 | return 'it works'; 12 | }, 13 | }, 14 | }).create({ namespace: { modulePrefix: 'alpha' } }); 15 | 16 | assert.strictEqual((0, resolver.resolve('component:hello'))(), 'it works'); 17 | }); 18 | 19 | test('can resolve self', function (assert) { 20 | let resolver = Resolver.create({ namespace: { modulePrefix: 'alpha' } }); 21 | assert.strictEqual(resolver, resolver.resolve('resolver:current').create()); 22 | }); 23 | 24 | test('can addModules', function (assert) { 25 | let startingModules = {}; 26 | let resolver = Resolver.withModules({}).create({ 27 | namespace: { modulePrefix: 'alpha' }, 28 | }); 29 | 30 | resolver.addModules({ 31 | 'alpha/components/hello': { 32 | default: function () { 33 | return 'it works'; 34 | }, 35 | }, 36 | }); 37 | 38 | assert.strictEqual((0, resolver.resolve('component:hello'))(), 'it works'); 39 | assert.deepEqual( 40 | [], 41 | Object.keys(startingModules), 42 | 'did not mutate starting modules' 43 | ); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /test-app/tests/unit/underscore_test.js: -------------------------------------------------------------------------------- 1 | import { module } from 'qunit'; 2 | import { underscore } from 'ember-resolver/string/index'; 3 | import createTestFunction from '../helpers/create-test-function'; 4 | 5 | module('underscore', function () { 6 | const test = createTestFunction(underscore); 7 | 8 | test('my favorite items', 'my_favorite_items', 'with normal string'); 9 | test('css-class-name', 'css_class_name', 'with dasherized string'); 10 | test('action_name', 'action_name', 'does nothing with underscored string'); 11 | test('innerHTML', 'inner_html', 'with camelcased string'); 12 | test( 13 | 'PrivateDocs/OwnerInvoice', 14 | 'private_docs/owner_invoice', 15 | 'underscore namespaced classified string' 16 | ); 17 | test( 18 | 'privateDocs/ownerInvoice', 19 | 'private_docs/owner_invoice', 20 | 'underscore namespaced camelized string' 21 | ); 22 | test( 23 | 'private-docs/owner-invoice', 24 | 'private_docs/owner_invoice', 25 | 'underscore namespaced dasherized string' 26 | ); 27 | }); 28 | --------------------------------------------------------------------------------