[
  {
    "path": ".editorconfig",
    "content": "# EditorConfig helps developers define and maintain consistent\n# coding styles between different editors and IDEs\n# editorconfig.org\n\nroot = true\n\n[*]\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\nindent_style = space\nindent_size = 2\n\n[*.hbs]\ninsert_final_newline = false\n\n[*.{diff,md}]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".ember-cli",
    "content": "{\n  /**\n    Ember CLI sends analytics information by default. The data is completely\n    anonymous, but there are times when you might want to disable this behavior.\n\n    Setting `disableAnalytics` to true will prevent any data from being sent.\n  */\n  \"disableAnalytics\": false\n}\n"
  },
  {
    "path": ".eslintignore",
    "content": "# unconventional js\n/blueprints/*/files/\n/vendor/\n\n# compiled output\n/dist/\n/tmp/\n\n# dependencies\n/bower_components/\n/node_modules/\n\n# misc\n/coverage/\n!.*\n.*/\n.eslintcache\n\n# ember-try\n/.node_modules.ember-try/\n/bower.json.ember-try\n/package.json.ember-try\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "'use strict';\n\nmodule.exports = {\n  root: true,\n  parser: 'babel-eslint',\n  parserOptions: {\n    ecmaVersion: 2018,\n    sourceType: 'module',\n    ecmaFeatures: {\n      legacyDecorators: true,\n    },\n  },\n  plugins: ['ember'],\n  extends: [\n    'eslint:recommended',\n    'plugin:ember/recommended',\n    'plugin:prettier/recommended',\n  ],\n  env: {\n    browser: true,\n  },\n  rules: {},\n  overrides: [\n    // node files\n    {\n      files: [\n        './.eslintrc.js',\n        './.prettierrc.js',\n        './.template-lintrc.js',\n        './ember-cli-build.js',\n        './index.js',\n        './testem.js',\n        './blueprints/*/index.js',\n        './config/**/*.js',\n        './tests/dummy/config/**/*.js',\n        './node-tests/**/*.js',\n      ],\n      parserOptions: {\n        sourceType: 'script',\n      },\n      env: {\n        browser: false,\n        node: true,\n      },\n      plugins: ['node'],\n      extends: ['plugin:node/recommended'],\n    },\n    {\n      // Test files:\n      files: ['tests/**/*-test.{js,ts}'],\n      extends: ['plugin:qunit/recommended'],\n    },\n  ],\n};\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  push:\n    branches:\n      - master\n      - main\n  pull_request:\n\njobs:\n  test:\n    name: Tests\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n      - uses: pnpm/action-setup@v4\n        with:\n          version: 8\n      - name: Setup node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: 16\n          cache: pnpm\n      - name: Install dependencies\n        run: pnpm i --frozen-lockfile\n      - name: Lint\n        run: pnpm lint\n      - name: Test\n        run: pnpm test\n\n  test-no-lock:\n    name: Floating Dependencies\n    runs-on: ubuntu-latest\n    needs:\n      - test\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n      - uses: pnpm/action-setup@v4\n        with:\n          version: 8\n      - name: Setup node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: 16\n          cache: pnpm\n      - name: Install dependencies\n        run: pnpm i --no-lockfile\n      - name: Test\n        run: pnpm test\n\n  test-try:\n    name: Additional Tests\n    runs-on: ubuntu-latest\n    needs:\n      - test\n    strategy:\n      fail-fast: false\n      matrix:\n        scenario:\n          - ember-lts-3.20\n          - ember-lts-3.24\n          - ember-release\n          - ember-beta\n          - ember-canary\n          - embroider-safe\n          - embroider-optimized\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n      - uses: pnpm/action-setup@v4\n        with:\n          version: 8\n      - name: Setup node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: 16\n          cache: pnpm\n      - name: Install dependencies\n        run: pnpm i --frozen-lockfile\n      - name: Test\n        run: pnpm ember try:one ${{ matrix.scenario }}\n"
  },
  {
    "path": ".github/workflows/plan-release.yml",
    "content": "name: Release Plan Review\non:\n  push:\n    branches:\n      - main\n      - master\n  pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/\n    types:\n      - labeled\n      - unlabeled\n\nconcurrency:\n  group: plan-release # only the latest one of these should ever be running\n  cancel-in-progress: true\n\njobs:\n  check-plan:\n    name: \"Check Release Plan\"\n    runs-on: ubuntu-latest\n    outputs:\n      command: ${{ steps.check-release.outputs.command }}\n\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n          ref: 'master'\n      # This will only cause the `check-plan` job to have a \"command\" of `release`\n      # when the .release-plan.json file was changed on the last commit.\n      - id: check-release\n        run: if git diff --name-only HEAD HEAD~1 | grep -w -q \".release-plan.json\"; then echo \"command=release\"; fi >> $GITHUB_OUTPUT\n\n  prepare_release_notes:\n    name: Prepare Release Notes\n    runs-on: ubuntu-latest\n    timeout-minutes: 5\n    needs: check-plan\n    permissions:\n      contents: write\n      pull-requests: write\n    outputs:\n      explanation: ${{ steps.explanation.outputs.text }}\n    # only run on push event if plan wasn't updated (don't create a release plan when we're releasing)\n    # only run on labeled event if the PR has already been merged\n    if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)\n\n    steps:\n      - uses: actions/checkout@v4\n        # We need to download lots of history so that\n        # github-changelog can discover what's changed since the last release\n        with:\n          fetch-depth: 0\n          ref: 'master'\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 18\n      \n      - uses: pnpm/action-setup@v3\n        with:\n          version: 8\n      - run: pnpm install --frozen-lockfile\n      \n      - name: \"Generate Explanation and Prep Changelogs\"\n        id: explanation\n        run: |\n          set +e\n          \n          pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)\n          \n\n          if [ $? -ne 0 ]; then\n            echo 'text<<EOF' >> $GITHUB_OUTPUT\n            cat release-plan-stderr.txt >> $GITHUB_OUTPUT\n            echo 'EOF' >> $GITHUB_OUTPUT\n          else\n            echo 'text<<EOF' >> $GITHUB_OUTPUT\n            jq .description .release-plan.json -r >> $GITHUB_OUTPUT\n            echo 'EOF' >> $GITHUB_OUTPUT\n            rm release-plan-stderr.txt\n          fi\n        env:\n          GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}\n\n      - uses: peter-evans/create-pull-request@v6\n        with:\n          commit-message: \"Prepare Release using 'release-plan'\"\n          labels: \"internal\"\n          branch: release-preview\n          title: Prepare Release\n          body: |\n            This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍\n\n            -----------------------------------------\n\n            ${{ steps.explanation.outputs.text }}\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "# For every push to the master branch, this checks if the release-plan was\n# updated and if it was it will publish stable npm packages based on the\n# release plan\n\nname: Publish Stable\n\non:\n  workflow_dispatch:\n  push:\n    branches:\n      - main\n      - master\n\nconcurrency:\n  group: publish-${{ github.head_ref || github.ref }}\n  cancel-in-progress: true\n\njobs:\n  check-plan:\n    name: \"Check Release Plan\"\n    runs-on: ubuntu-latest\n    outputs:\n      command: ${{ steps.check-release.outputs.command }}\n\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n          ref: 'master'\n      # This will only cause the `check-plan` job to have a result of `success`\n      # when the .release-plan.json file was changed on the last commit. This\n      # plus the fact that this action only runs on main will be enough of a guard\n      - id: check-release\n        run: if git diff --name-only HEAD HEAD~1 | grep -w -q \".release-plan.json\"; then echo \"command=release\"; fi >> $GITHUB_OUTPUT\n\n  publish:\n    name: \"NPM Publish\"\n    runs-on: ubuntu-latest\n    needs: check-plan\n    if: needs.check-plan.outputs.command == 'release'\n    permissions:\n      contents: write\n      pull-requests: write\n\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 18\n          # This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable\n          registry-url: 'https://registry.npmjs.org'\n      \n      - uses: pnpm/action-setup@v3\n        with:\n          version: 8\n      - run: pnpm install --frozen-lockfile\n      - name: npm publish\n        run: pnpm release-plan publish\n      \n        env:\n          GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}\n          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# See https://help.github.com/ignore-files/ for more about ignoring files.\n\n# compiled output\n/dist/\n/tmp/\n\n# dependencies\n/bower_components/\n/node_modules/\n\n# misc\n/.env*\n/.pnp*\n/.sass-cache\n/.eslintcache\n/connect.lock\n/coverage/\n/libpeerconnection.log\n/npm-debug.log*\n/testem.log\n/yarn-error.log\n\n# ember-try\n/.node_modules.ember-try/\n/bower.json.ember-try\n/package.json.ember-try\n"
  },
  {
    "path": ".npmignore",
    "content": "# compiled output\n/dist/\n/tmp/\n\n# dependencies\n/bower_components/\n\n# misc\n/.bowerrc\n/.editorconfig\n/.ember-cli\n/.env*\n/.eslintcache\n/.eslintignore\n/.eslintrc.js\n/.git/\n/.gitignore\n/.prettierignore\n/.prettierrc.js\n/.template-lintrc.js\n/.travis.yml\n/.watchmanconfig\n/bower.json\n/config/ember-try.js\n/CONTRIBUTING.md\n/ember-cli-build.js\n/testem.js\n/tests/\n/node-tests\n/yarn-error.log\n/yarn.lock\n.gitkeep\n\n# ember-try\n/.node_modules.ember-try/\n/bower.json.ember-try\n/package.json.ember-try\n"
  },
  {
    "path": ".prettierignore",
    "content": "# unconventional js\n/blueprints/*/files/\n/vendor/\n\n# compiled output\n/dist/\n/tmp/\n\n# dependencies\n/bower_components/\n/node_modules/\n\n# misc\n/coverage/\n!.*\n.eslintcache\n\n# ember-try\n/.node_modules.ember-try/\n/bower.json.ember-try\n/package.json.ember-try\n"
  },
  {
    "path": ".prettierrc.js",
    "content": "'use strict';\n\nmodule.exports = {\n  singleQuote: true,\n};\n"
  },
  {
    "path": ".release-plan.json",
    "content": "{\n  \"solution\": {\n    \"prember\": {\n      \"impact\": \"minor\",\n      \"oldVersion\": \"2.0.0\",\n      \"newVersion\": \"2.1.0\",\n      \"constraints\": [\n        {\n          \"impact\": \"minor\",\n          \"reason\": \"Appears in changelog section :rocket: Enhancement\"\n        },\n        {\n          \"impact\": \"patch\",\n          \"reason\": \"Appears in changelog section :house: Internal\"\n        }\n      ],\n      \"pkgJSONPath\": \"./package.json\"\n    }\n  },\n  \"description\": \"## Release (2024-07-05)\\n\\nprember 2.1.0 (minor)\\n\\n#### :rocket: Enhancement\\n* `prember`\\n  * [#82](https://github.com/ef4/prember/pull/82) recycle the fastboot instance after 1k requests ([@mansona](https://github.com/mansona))\\n\\n#### :house: Internal\\n* `prember`\\n  * [#84](https://github.com/ef4/prember/pull/84) add release-plan ([@mansona](https://github.com/mansona))\\n  * [#83](https://github.com/ef4/prember/pull/83) switch to pnpm and fix tests ([@mansona](https://github.com/mansona))\\n\\n#### Committers: 1\\n- Chris Manson ([@mansona](https://github.com/mansona))\\n\"\n}\n"
  },
  {
    "path": ".watchmanconfig",
    "content": "{\n  \"ignore_dirs\": [\"tmp\", \"dist\"]\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\n## Release (2024-07-05)\n\nprember 2.1.0 (minor)\n\n#### :rocket: Enhancement\n* `prember`\n  * [#82](https://github.com/ef4/prember/pull/82) recycle the fastboot instance after 1k requests ([@mansona](https://github.com/mansona))\n\n#### :house: Internal\n* `prember`\n  * [#84](https://github.com/ef4/prember/pull/84) add release-plan ([@mansona](https://github.com/mansona))\n  * [#83](https://github.com/ef4/prember/pull/83) switch to pnpm and fix tests ([@mansona](https://github.com/mansona))\n\n#### Committers: 1\n- Chris Manson ([@mansona](https://github.com/mansona))\n\n# 1.1.1 - 2022-08-10\n\nBUGFIX: ensure we always run after ember-auto-import. As of ember-auto-import 2.0, things can break if we run before.\n\n## 1.1.0 - 2021-12-23\n\nENHANCEMENT: Add embroider support by @simonihmig\n\n## 1.0.5 - 2020-07-01\n\nBUGFIX: Use rootUrl for static files #57 from @mansona\n\n## 1.0.4 - 2020-05-03 \n\nENHANCEMENT: Allow passing urls from prember\n\n## 1.0.3 - 2019-05-29\n\nENHANCEMENT: Support to ember-engines out of the box\n\n## 1.0.2 - 2019-01-06\n\nBUGFIX: The protocol bugfix in 1.0.1 was not quite right and caused a regresion.\n\n## 1.0.1 - 2018-12-20\n\nBUGFIX: Shutdown express server after build (thanks @astronomersiva)\nBUGFIX: Add protocol to fastboot requests for improved compatibility (thanks @xg-wang)\n\n## 1.0.0 - 2018-10-28\n\nBREAKING: We now require ember-cli-fastboot >= 2.0.0, and if you're using broccoli-asset-rev it should be >= 2.7.0. This is to fix the order in which these run relative to prember, so that all asset links will get correct handling.\n\n## 0.4.0 - 2018-04-25\n\nBREAKING: the signature for custom url discovery functions has changed from\n\n    async function(distDir, visit) { return [...someURLs] }\n\nto\n\n    async function({ distDir, visit }) { return [...someURLs] }\n\nThis makes it nicer to compose multiple URL discovery strategies.\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# How To Contribute\n\n## Installation\n\n* `git clone <repository-url>`\n* `cd prember`\n* `yarn install`\n\n## Linting\n\n* `yarn lint`\n* `yarn lint:fix`\n\n## Running tests\n\n* `ember test` – Runs the test suite on the current Ember version\n* `ember test --server` – Runs the test suite in \"watch mode\"\n* `ember try:each` – Runs the test suite against multiple Ember versions\n\n## Running the dummy application\n\n* `ember serve`\n* Visit the dummy application at [http://localhost:4200](http://localhost:4200).\n\nFor more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2018\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n"
  },
  {
    "path": "README.md",
    "content": "# prember = Pre Render Ember\n\nA **progressive static-site generator** for Ember\n\n\nThis Ember addon allows you to pre-render any list of URLs into static HTML files *at build time*. It has no opinions about how you generate the list of URLs.\n\n## Features\n\n- 💯100% Ember\n- 🚀 [Blazing](https://runspired.com/2018/06/03/ember-in-2018-part-2/) optimized for speed.\n- 🚚 Data Agnostic. Supply your site with data from anywhere, however you want!\n- 💥 Instant navigation and page views\n- ☔️ Progressively Enhanced and mobile-ready\n- 🎯 SEO Friendly.\n- 🥇 Ember-centric developer experience.\n- 😌 Painless project setup & migration.\n- 📦 Embroider support\n\n## Quick Start\n\nAdd these packages to your app:\n\n```sh\nember install ember-cli-fastboot\nember install prember\n```\n\nAnd configure some URLs that you would like to prerender:\n\n```\n// In ember-cli-build.js\nlet app = new EmberApp(defaults, {\n  prember: {\n    urls: [\n      '/',\n      '/about',\n      '/contact'\n    ]\n  }\n});\n```\n\nWhen you do `ember build --environment=production`, your built app will include fastboot-rendered HTML in the following files:\n\n```\n/index.html\n/about/index.html\n/contact/index.html\n```\n\n## Explanation\n\nWhen you build a normal ember app (`ember build --environment=production`) you get a structure something like this:\n\n```\ndist/\n├── assets\n│   ├── my-app-0d31988c08747007cb982909a0b2c9db.css\n│   ├── my-app-bdaaa766a1077911a7dae138cbd9e39d.js\n│   ├── vendor-553c722f80bed2ea90c42b2c6a54238a.js\n│   └── vendor-9eda64f0de2569c64ba0d33f08940fbf.css\n├── index.html\n└── robots.txt\n```\n\nTo serve this app to users, you just need to configure a webserver to use `index.html` in response to *all* URLs that don't otherwise map to files (because the Ember app will boot and take care of the routing).\n\nIf you add [ember-cli-fastboot](https://github.com/ember-fastboot/ember-cli-fastboot) to your app, it augments your build with a few things that are needed to run the app within node via [fastboot](https://github.com/ember-fastboot/fastboot):\n\n```\ndist/\n├── assets\n│   ├── assetMap.json\n│   ├── my-app-0d31988c08747007cb982909a0b2c9db.css\n│   ├── my-app-a72732b0d2468246920fa5401610caf4.js\n│   ├── my-app-fastboot-af717865dadf95003aaf6903aefcd125.js\n│   ├── vendor-553c722f80bed2ea90c42b2c6a54238a.js\n│   └── vendor-9eda64f0de2569c64ba0d33f08940fbf.css\n├── index.html\n├── package.json\n└── robots.txt\n```\n\nYou can still serve the resulting app in the normal way, but to get the benefits of server-side rendering you would probably serve it from a fastboot server that knows how to combine the JS files and the `index.html` file and generate unique output per URL. The downside of this is that your fastboot server is now in the critical path, which increases your ops complexity and is necessarily slower than serving static files.\n\n`prember` starts with an app that's already capable of running in fastboot and augments it further. You configure it with a source of URLs to prerender, and it uses Fastboot to visit each one *during the build process*, saving the resulting HTML files:\n\n```\ndist/\n├── _empty.html            <--------- A copy of the original index.html\n├── about\n│   └── index.html         <--------- Pre-rendered content\n├── assets\n│   ├── assetMap.json\n│   ├── my-app-0d31988c08747007cb982909a0b2c9db.css\n│   ├── my-app-a72732b0d2468246920fa5401610caf4.js\n│   ├── my-app-fastboot-af717865dadf95003aaf6903aefcd125.js\n│   ├── vendor-553c722f80bed2ea90c42b2c6a54238a.js\n│   └── vendor-9eda64f0de2569c64ba0d33f08940fbf.css\n├── contact\n│   └── index.html         <--------- Pre-rendered content\n├── index.html             <--------- Rewritten with pre-rendered content\n├── package.json\n└── robots.txt\n```\n\nThe resulting application can be served entirely statically, like a normal Ember app. But it has the fast-first-paint and SEO benefits of a Fastboot-rendered application for all of the URLs that you pre-rendered.\n\n## Configuring Your Webserver\n\nYour webserver needs to do two things correctly for this to work:\n\n1. It should use a file like `about/index.html` to respond to URLs like `/about`. This is a pretty normal default behavior.\n2. It should use `_empty.html` to respond to unknown URLs (404s). In a normal Ember app, you would configure `index.html` here instead, but we may have already overwritten `index.html` with content that only belongs on the homepage, not on every route. This is why `prember` gives you a separate `_empty.html` file with no prerendered content.\n\n## Options\n\nYou pass options to `prember` by setting them in `ember-cli-build.js`:\n\n```\n// In ember-cli-build.js\nlet app = new EmberApp(defaults, {\n  prember: {\n    urls: [\n      '/',\n      '/about',\n      '/contact'\n    ]\n  }\n});\n```\n\nThe supported options are:\n\n - `urls`: this can be an array or a promise-returning function that resolves to an array. How you generate the list of URLs is up to you, there are many valid strategies. See next section about using a custom url discovery function.\n - `enabled`: defaults to `environment === 'production'` so that `prember` only runs during production builds.\n - `indexFile`: defaults to `\"index.html\"`. This is the name we will give to each of the files we create during pre-rendering.\n - `emptyFile`: defaults to `\"_empty.html\"`. This is where we will put a copy of your empty `index.html` as it was before any pre-rendering.\n - `requestsPerFastboot`: defaults to `1000`. This tells prember how many requests to pass to a single fastboot instance before creating a new one. This can be useful for memory management.\n\n## Using a custom URL discovery function\n\nIf you pass a function as the `urls` option, prember will invoke it like:\n\n```js\nlet listOfUrls = await yourUrlFunction({ distDir, visit });\n```\n\n`distDir` is the directory containing your built application. This allows your function to inspect the build output to discover URLs.\n\n`visit` is an asynchronous function that takes a URL string and resolves to a response from a running fastboot server. This lets your function crawl the running application to discover URLs.\n\nFor an example of both these strategies in action, see `./node-tests/url-tester.js` in this repo's test suite.\n\n## Using prember in development\n\nIn addition to the `enabled` option, you can temporarily turn `prember` on by setting the environment variable `PREMBER=true`, like:\n\n```sh\nPREMBER=true ember serve\n```\n\n**However**, by default ember-cli doesn't understand that it should use a file like `about/index.html` to respond to a URL like `/about`. So you should do:\n\n```sh\nember install prember-middleware\n```\n\nIt's harmless to keep prember-middleware permanently installed in your app, it has no impact on your production application.\n\nWhen running in development, you will see console output from ember-cli that distinguishes whether a given page was handled by prember vs handled on-the-fly by fastboot:\n\n```\nprember: serving prerendered static HTML for /about       <--- served by prember\n2017-10-27T05:25:02.161Z 200 OK /some-other-page          <--- served by fastboot\n```\n\n## Using prember from an addon\n\nAddon authors may declare urls *for* prember during compilation. To do so, you will want to:\n\n- Add `prember-plugin` to your addon's package.json `keywords` array;\n    - Consider also using package.json's `ember-addon` object to configure your addon to run `before: 'prember'`\n- Define a `urlsForPrember(distDir, visit)` function in your addon's main file;\n    - This function shares an interface with the \"custom URL discovery\" function, as defined above; and\n- Advise your addon's users to install & configure `prember` in the host application.\n\nAddon authors may also get access to urls *from* prember. To do so, you will want to:\n\n- Add `prember-plugin` to your addon's package.json `keywords` array;\n    - Consider also using package.json's `ember-addon` object to configure your addon to run `before: 'prember'`\n- Define a `urlsFromPrember(urls)` function in your addon's main file;\n    - This function will receive the array of urls prember knows about as the only argument; and\n- Advise your addon's users to install & configure `prember` in the host application.\n\n## Using prember with Embroider\n\nYou can use prember in an Embroider-based build, however you must apply some changes to your `ember-cli-build.js` for it to work. \nEmbroider does not support the `postprocessTree` (type `all`) hook that this addon uses to *implicitly* hook into the build pipeline.\nBut it exposes a `prerender` function to do so *explicitly*. \n\nIn a [typical Embroider setup](https://github.com/embroider-build/embroider), your `ember-cli-build.js` will look like this:\n\n```js\nconst { Webpack } = require('@embroider/webpack');\nreturn require('@embroider/compat').compatBuild(app, Webpack);\n```\n\nFor prember to add its prerendered HTML pages on top of what Embroider already emitted, wrap the compiled output with the `prerender` function like this:\n\n```diff\nconst { Webpack } = require('@embroider/webpack');\n- return require('@embroider/compat').compatBuild(app, Webpack);\n+ const compiledApp = require('@embroider/compat').compatBuild(app, Webpack);\n+ \n+ return require('prember').prerender(app, compiledApp);\n```\n\n# Deployment\n\nYou shouldn't need to do much special -- just make sure the html files get copied along with all your other files.\n\nIf you're using `ember-cli-deploy-s3`, you just need to customize the `filePattern` setting so it includes `.html` files. For example:\n\n```js\n    ENV.s3 = {\n      bucket: 'cardstack.com',\n      region: 'us-east-1',\n      filePattern: '**/*.{js,css,png,gif,ico,jpg,map,xml,txt,svg,swf,eot,ttf,woff,woff2,otf,html}'\n      allowOverwrite: true\n    };\n```\n\n# Compared to other addons\n\nThere are other ways to pre-render content:\n\n - [ember-prerender](https://github.com/zipfworks/ember-prerender) depends on having a real browser to do prerendering, which is heavy and complex. It's old and unmaintained.\n - [ember-cli-prerender](https://github.com/Motokaptia/ember-cli-prerender) uses Fastboot like we do, but it is not integrated with the build pipeline (so it's harder to make it Just Work™ with things like [ember-cli-deploy](http://ember-cli-deploy.com/)) and it has stronger opinions about what URLs it will discover, including blueprint-driven sitemap configuration.\n - [ember-cli-staticboot](https://github.com/robwebdev/ember-cli-staticboot) is quite similar to this addon, and I didn't realize it existed before I started making this one. I do think `prember` does a better job of integrating the static build output with the existing ember app in a way that requires the minimal webserver configuration. \n \n \n Contributing\n ------------------------------------------------------------------------------\n \n See the [Contributing](CONTRIBUTING.md) guide for details.\n \n \n License\n ------------------------------------------------------------------------------\n \n This project is licensed under the [MIT License](LICENSE.md).\n"
  },
  {
    "path": "RELEASE.md",
    "content": "# Release Process\n\nReleases in this repo are mostly automated using [release-plan](https://github.com/embroider-build/release-plan/). Once you label all your PRs correctly (see below) you will have an automatically generated PR that updates your CHANGELOG.md file and a `.release-plan.json` that is used to prepare the release once the PR is merged.\n\n## Preparation\n\nSince the majority of the actual release process is automated, the remaining tasks before releasing are: \n\n-  correctly labeling **all** pull requests that have been merged since the last release\n-  updating pull request titles so they make sense to our users\n\nSome great information on why this is important can be found at [keepachangelog.com](https://keepachangelog.com/en/1.1.0/), but the overall\nguiding principle here is that changelogs are for humans, not machines.\n\nWhen reviewing merged PR's the labels to be used are:\n\n* breaking - Used when the PR is considered a breaking change.\n* enhancement - Used when the PR adds a new feature or enhancement.\n* bug - Used when the PR fixes a bug included in a previous release.\n* documentation - Used when the PR adds or updates documentation.\n* internal - Internal changes or things that don't fit in any other category.\n\n**Note:** `release-plan` requires that **all** PRs are labeled. If a PR doesn't fit in a category it's fine to label it as `internal`\n\n## Release\n\nOnce the prep work is completed, the actual release is straight forward: you just need to merge the open [Plan Release](https://github.com/ef4/prember/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR\n"
  },
  {
    "path": "addon/.gitkeep",
    "content": ""
  },
  {
    "path": "app/.gitkeep",
    "content": ""
  },
  {
    "path": "config/ember-try.js",
    "content": "'use strict';\n\nconst getChannelURL = require('ember-source-channel-url');\nconst { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');\n\nmodule.exports = async function () {\n  return {\n    usePnpm: true,\n    command: 'pnpm test',\n    scenarios: [\n      {\n        name: 'ember-lts-3.20',\n        npm: {\n          devDependencies: {\n            'ember-source': '~3.20.5',\n          },\n        },\n      },\n      {\n        name: 'ember-lts-3.24',\n        npm: {\n          devDependencies: {\n            'ember-source': '~3.24.3',\n          },\n        },\n      },\n      {\n        name: 'ember-release',\n        npm: {\n          devDependencies: {\n            'ember-source': await getChannelURL('release'),\n          },\n        },\n      },\n      {\n        name: 'ember-beta',\n        npm: {\n          devDependencies: {\n            'ember-source': await getChannelURL('beta'),\n          },\n        },\n      },\n      {\n        name: 'ember-canary',\n        npm: {\n          devDependencies: {\n            'ember-source': await getChannelURL('canary'),\n          },\n        },\n      },\n      {\n        name: 'ember-default-with-jquery',\n        env: {\n          EMBER_OPTIONAL_FEATURES: JSON.stringify({\n            'jquery-integration': true,\n          }),\n        },\n        npm: {\n          devDependencies: {\n            '@ember/jquery': '^1.1.0',\n          },\n        },\n      },\n      {\n        name: 'ember-classic',\n        env: {\n          EMBER_OPTIONAL_FEATURES: JSON.stringify({\n            'application-template-wrapper': true,\n            'default-async-observers': false,\n            'template-only-glimmer-components': false,\n          }),\n        },\n        npm: {\n          devDependencies: {\n            'ember-source': '~3.28.0',\n          },\n          ember: {\n            edition: 'classic',\n          },\n        },\n      },\n      embroiderSafe(),\n      embroiderOptimized(),\n    ],\n  };\n};\n"
  },
  {
    "path": "config/environment.js",
    "content": "'use strict';\n\nmodule.exports = function (/* environment, appConfig */) {\n  return {};\n};\n"
  },
  {
    "path": "ember-cli-build.js",
    "content": "'use strict';\n\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\nconst urls = require('./node-tests/url-tester');\n\nmodule.exports = function (defaults) {\n  let app = new EmberAddon(defaults, {\n    // This is the configuration for Prember's dummy app that we use\n    // to test prember. You would do something similar to this in your\n    // own app's ember-cli-build.js to configure prember, see the\n    // README.\n    prember: {\n      enabled: true,\n      urls,\n    },\n  });\n\n  const { maybeEmbroider } = require('@embroider/test-setup');\n  const appTree = maybeEmbroider(app, {\n    skipBabel: [\n      {\n        package: 'qunit',\n      },\n    ],\n  });\n\n  if ('@embroider/core' in app.dependencies()) {\n    return require('./index').prerender(app, appTree);\n  } else {\n    return appTree;\n  }\n};\n"
  },
  {
    "path": "index.js",
    "content": "'use strict';\n\nconst premberConfig = require('./lib/config');\nconst path = require('path');\nconst fs = require('fs');\n\nmodule.exports = {\n  name: require('./package').name,\n  premberConfig,\n\n  included(app) {\n    this.fastbootOptions = fastbootOptionsFor(app.env, app.project);\n  },\n\n  postprocessTree(type, tree) {\n    if (type !== 'all') {\n      return tree;\n    }\n\n    return this._prerenderTree(tree);\n  },\n\n  /**\n   * This function is *not* called by ember-cli directly, but supposed to be imported by an app to wrap the app's\n   * tree, to add the prerendered HTML files. This workaround is currently needed for Embroider-based builds that\n   * don't support the `postprocessTree('all', tree)` hook used here.\n   */\n  prerender(app, tree) {\n    let premberAddon = app.project.addons.find(\n      ({ name }) => name === 'prember'\n    );\n\n    if (!premberAddon) {\n      throw new Error(\n        \"Could not find initialized prember addon. It must be part of your app's dependencies!\"\n      );\n    }\n\n    return premberAddon._prerenderTree(tree);\n  },\n\n  _prerenderTree(tree) {\n    let config = this.premberConfig();\n    if (!config.enabled) {\n      return tree;\n    }\n\n    config.fastbootOptions = this.fastbootOptions;\n\n    let Prerender = require('./lib/prerender');\n    let BroccoliDebug = require('broccoli-debug');\n    let Merge = require('broccoli-merge-trees');\n    let debug = BroccoliDebug.buildDebugCallback(`prember`);\n    let ui = this.project.ui;\n    let plugins = loadPremberPlugins(this);\n\n    return debug(\n      new Merge(\n        [\n          tree,\n          new Prerender(\n            debug(tree, 'input'),\n            config,\n            ui,\n            plugins,\n            this._rootURL\n          ),\n        ],\n        {\n          overwrite: true,\n        }\n      ),\n      'output'\n    );\n  },\n\n  config: function (env, baseConfig) {\n    this._rootURL = baseConfig.rootURL;\n  },\n};\n\nfunction loadPremberPlugins(context) {\n  let addons = context.project.addons || [];\n\n  return addons\n    .filter((addon) => addon.pkg.keywords.includes('prember-plugin'))\n    .filter((addon) => {\n      return (\n        typeof addon.urlsForPrember === 'function' ||\n        typeof addon.urlsFromPrember === 'function'\n      );\n    })\n    .map((addon) => {\n      const premberPlugin = {};\n\n      if (addon.urlsForPrember) {\n        premberPlugin.urlsForPrember = addon.urlsForPrember.bind(addon);\n      }\n\n      if (addon.urlsFromPrember) {\n        premberPlugin.urlsFromPrember = addon.urlsFromPrember.bind(addon);\n      }\n\n      return premberPlugin;\n    });\n}\n\nfunction fastbootOptionsFor(environment, project) {\n  const configPath = path.join(\n    path.dirname(project.configPath()),\n    'fastboot.js'\n  );\n\n  if (fs.existsSync(configPath)) {\n    return require(configPath)(environment);\n  }\n  return {};\n}\n"
  },
  {
    "path": "lib/.eslintrc.js",
    "content": "module.exports = {\n  env: {\n    node: true,\n    browser: false,\n  },\n};\n"
  },
  {
    "path": "lib/config.js",
    "content": "function findHost(context) {\n  var current = context;\n  var app;\n\n  // Keep iterating upward until we don't have a grandparent.\n  // Has to do this grandparent check because at some point we hit the project.\n  do {\n    app = current.app || app;\n  } while (\n    current.parent &&\n    current.parent.parent &&\n    (current = current.parent)\n  );\n\n  return app;\n}\n\nfunction loadConfig(context) {\n  let app = findHost(context);\n  let config = app.options.prember || {};\n  if (config.enabled == null) {\n    config.enabled = app.env === 'production';\n  }\n  if (process.env.PREMBER) {\n    config.enabled = true;\n  }\n  return config;\n}\n\nmodule.exports = function () {\n  if (!this._premberConfig) {\n    this._premberConfig = loadConfig(this);\n  }\n  return this._premberConfig;\n};\n"
  },
  {
    "path": "lib/prerender.js",
    "content": "const Plugin = require('broccoli-plugin');\nconst FastBoot = require('fastboot');\nconst { writeFile, readFile } = require('fs/promises');\nconst { mkdirp } = require('mkdirp');\nconst path = require('path');\nconst chalk = require('chalk');\nconst express = require('express');\nconst { URL } = require('url');\nconst protocol = 'http';\nconst port = 7784;\n\n// We need to have some origin for the purpose of serving redirects\n// and static assets\n\nclass Prerender extends Plugin {\n  constructor(\n    builtAppTree,\n    { urls, indexFile, emptyFile, fastbootOptions, requestsPerFastboot },\n    ui,\n    plugins,\n    rootURL\n  ) {\n    super([builtAppTree], { name: 'prember', needsCache: false });\n    this.urls = urls || [];\n    this.indexFile = indexFile || 'index.html';\n    this.emptyFile = emptyFile || '_empty.html';\n    this.ui = ui;\n    this.plugins = plugins;\n    this.rootURL = rootURL;\n    this.protocol = protocol;\n    this.port = port;\n    this.host = `localhost:${port}`;\n    this.fastbootOptions = fastbootOptions || {};\n    this.requestsPerFastboot = requestsPerFastboot || 1000;\n    this.app = undefined;\n    this.visitCounter = 0;\n  }\n\n  async listUrls(protocol, host) {\n    let visit = async (url) => {\n      return this._visit(protocol, host, url);\n    };\n\n    if (typeof this.urls === 'function') {\n      this.urls = await this.urls({ distDir: this.inputPaths[0], visit });\n    }\n\n    for (let plugin of this.plugins) {\n      if (plugin.urlsForPrember) {\n        this.urls = this.urls.concat(\n          await plugin.urlsForPrember(this.inputPaths[0], visit)\n        );\n      }\n    }\n\n    for (let plugin of this.plugins) {\n      if (plugin.urlsFromPrember) {\n        await plugin.urlsFromPrember(this.urls);\n      }\n    }\n\n    return this.urls;\n  }\n\n  async build() {\n    let pkg;\n    try {\n      pkg = require(path.join(this.inputPaths[0], 'package.json'));\n    } catch (err) {\n      throw new Error(\n        `Unable to load package.json from within your built application. Did you forget to add ember-cli-fastboot to your app? ${err}`\n      );\n    }\n\n    /* Move the original \"empty\" index.html HTML file to an\n       out-of-the-way place, and rewrite the fastboot manifest to\n       point at it. This ensures that:\n\n       (1) even if you have prerendered the contents of your homepage,\n           causing the empty \"index.html\" to get replaced with actual\n           content, we still keep a copy of the original empty\n           index.html file that can be used to serve URLs that don't\n           have a prerendered version. You wouldn't want a flash of\n           your homepage content to appear on every non-prerendered\n           route.\n\n       (2) if you choose to run the prerendered app inside a fastboot\n           server for some reason (this happens in development by\n           default), fastboot will still work correctly because it can\n           find the empty index.html file.\n    */\n\n    let fastbootManifestSchema = pkg.fastboot.schemaVersion;\n    let htmlFilename =\n      fastbootManifestSchema < 5\n        ? pkg.fastboot.manifest.htmlFile\n        : pkg.fastboot.htmlEntrypoint;\n    let htmlFile = await readFile(\n      path.join(this.inputPaths[0], htmlFilename),\n      'utf8'\n    );\n    await writeFile(path.join(this.outputPath, this.emptyFile), htmlFile);\n    pkg = JSON.parse(JSON.stringify(pkg));\n    if (fastbootManifestSchema < 5) {\n      pkg.fastboot.manifest.htmlFile = this.emptyFile;\n    } else {\n      pkg.fastboot.htmlEntrypoint = this.emptyFile;\n    }\n\n    await writeFile(\n      path.join(this.outputPath, 'package.json'),\n      JSON.stringify(pkg)\n    );\n\n    let expressServer = express()\n      .use(this.rootURL, express.static(this.inputPaths[0]))\n      .listen(this.port);\n\n    let hadFailures = false;\n\n    for (let url of await this.listUrls(this.protocol, this.host)) {\n      try {\n        hadFailures =\n          !(await this._prerender(this.protocol, this.host, url)) ||\n          hadFailures;\n      } catch (err) {\n        hadFailures = true;\n        this.ui.writeLine(\n          `pre-render ${url} ${chalk.red('failed with exception')}: ${err}`\n        );\n      }\n    }\n\n    expressServer.close();\n\n    if (hadFailures) {\n      throw new Error('Some pre-rendered URLs had failures');\n    }\n  }\n\n  async _visit(protocol, host, url) {\n    // keep track of calls to visit so we know when we can recycle the fastboot instance\n    this.visitCounter++;\n\n    if (!this.app || this.visitCounter > this.requestsPerFastboot) {\n      this.visitCounter = 0;\n      this.app = new FastBoot(\n        Object.assign({}, this.fastbootOptions, {\n          distPath: this.inputPaths[0],\n        })\n      );\n    }\n\n    let opts = {\n      request: {\n        url,\n        protocol,\n        headers: {\n          host,\n          'x-broccoli': {\n            outputPath: this.inputPaths[0],\n          },\n        },\n      },\n    };\n    return await this.app.visit(url, opts);\n  }\n\n  async _prerender(protocol, host, url) {\n    let page = await this._visit(protocol, host, url);\n    if (page.statusCode === 200) {\n      let html = await page.html();\n      await this._writeFile(url, html);\n      this.ui.writeLine(`pre-render ${url} ${chalk.green('200 OK')}`);\n      return true;\n    } else if (page.statusCode >= 300 && page.statusCode < 400) {\n      let location = page.headers.headers.location[0];\n      let redirectTo = new URL(location, `http://${host}${this.rootURL}`)\n        .pathname;\n      let html = `<meta http-equiv=\"refresh\" content=\"0;url=${redirectTo}\"><link rel=\"canonical\" href=\"${redirectTo}\" />`;\n      await this._writeFile(url, html);\n      this.ui.writeLine(\n        `pre-render ${url} ${chalk.yellow(page.statusCode)} ${location}`\n      );\n      return true;\n    } else {\n      this.ui.writeLine(`pre-render ${url} ${chalk.red(page.statusCode)}`);\n    }\n  }\n\n  async _writeFile(url, html) {\n    let filename = path.join(\n      this.outputPath,\n      url.replace(this.rootURL, '/'),\n      this.indexFile\n    );\n    await mkdirp(path.dirname(filename));\n    await writeFile(filename, html);\n  }\n}\n\nmodule.exports = Prerender;\n"
  },
  {
    "path": "node-tests/basic-test.js",
    "content": "const { execFileSync } = require('child_process');\nconst { module: Qmodule, test } = require('qunit');\nconst jsdom = require('jsdom');\nconst { JSDOM } = jsdom;\nconst fs = require('fs');\n\nfunction findDocument(filename) {\n  let dom = new JSDOM(fs.readFileSync(`dist/${filename}`));\n  return dom.window.document;\n}\n\nQmodule('Prember', function (hooks) {\n  hooks.before(async function () {\n    if (!process.env.REUSE_FASTBOOT_BUILD) {\n      execFileSync('pnpm', ['ember', 'build']);\n    }\n    process.env.REUSE_FASTBOOT_BUILD = true;\n  });\n\n  test('it renders /', function (assert) {\n    let doc = findDocument('index.html');\n    assert.equal(\n      doc.querySelector('[data-test-id=\"index-content\"]').textContent,\n      'This is some content'\n    );\n  });\n\n  test('it works with ember-cli-head', function (assert) {\n    let doc = findDocument('index.html');\n    assert.equal(\n      doc.querySelector('meta[property=\"og:description\"]').content,\n      'OG Description from Index Route'\n    );\n  });\n\n  test('it works with ember-page-title', function (assert) {\n    let doc = findDocument('index.html');\n    assert.equal(\n      doc.querySelector('title').textContent,\n      'Document Title from page-title'\n    );\n  });\n\n  test('the URL discovery function can crawl the running app', function (assert) {\n    // this test is relying on configuration in our ember-cli-build.js\n    let doc = findDocument('discovered/index.html');\n    assert.equal(doc.querySelector('h1').textContent, 'Discovered');\n  });\n\n  test('the URL discovery function can inspect the app build output', function (assert) {\n    // this test is relying on configuration in our ember-cli-build.js\n    let doc = findDocument('from-sample-data/index.html');\n    assert.equal(doc.querySelector('h1').textContent, 'From Sample Data');\n  });\n\n  test('fastboot-rendered routes have access to static assets', function (assert) {\n    // this test is relying on configuration in our ember-cli-build.js\n    let doc = findDocument('use-static-asset/index.html');\n    assert.equal(\n      doc.querySelector('.message').textContent,\n      'This is from static json'\n    );\n  });\n\n  test('redirects via meta http-eqiv refresh', function (assert) {\n    // this test is relying on configuration in our ember-cli-build.js\n    let doc = findDocument('redirects/index.html');\n    assert.equal(\n      doc.querySelector('meta[http-equiv=refresh]').getAttribute('content'),\n      '0;url=/from-sample-data'\n    );\n  });\n\n  test('redirects have rel canonical', function (assert) {\n    // this test is relying on configuration in our ember-cli-build.js\n    let doc = findDocument('redirects/index.html');\n    assert.equal(\n      doc.querySelector('link[rel=canonical]').getAttribute('href'),\n      '/from-sample-data'\n    );\n  });\n});\n"
  },
  {
    "path": "node-tests/url-tester.js",
    "content": "const jsdom = require('jsdom');\nconst { JSDOM } = jsdom;\n\nmodule.exports = async function ({ distDir, visit }) {\n  let urls = ['/', '/redirects', '/use-static-asset'];\n\n  // Here we exercise the ability to make requests against the\n  // fastboot app in order to discover more urls\n  let page = await visit('/');\n  if (page.statusCode === 200) {\n    let html = await page.html();\n    let dom = new JSDOM(html);\n    for (let aTag of [...dom.window.document.querySelectorAll('a')]) {\n      if (aTag.href) {\n        urls.push(aTag.href);\n      }\n    }\n  }\n\n  // Here we exercise the ability to inspect the build output of the\n  // app to discover more urls\n  let sampleData = require(distDir + '/sample-data.json');\n  for (let entry of sampleData) {\n    urls.push(entry.url);\n  }\n\n  return urls;\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"prember\",\n  \"version\": \"2.1.0\",\n  \"description\": \"Prerender Ember apps using Fastboot at build time.\",\n  \"keywords\": [\n    \"ember-addon\",\n    \"fastboot\",\n    \"prerender\"\n  ],\n  \"repository\": \"https://github.com/ef4/prember\",\n  \"license\": \"MIT\",\n  \"author\": \"Edward Faulkner <edward@eaf4.com>\",\n  \"directories\": {\n    \"doc\": \"doc\",\n    \"test\": \"tests\"\n  },\n  \"scripts\": {\n    \"build\": \"ember build --environment=production\",\n    \"lint\": \"npm-run-all --aggregate-output --continue-on-error --parallel \\\"lint:!(fix)\\\"\",\n    \"lint:fix\": \"npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix\",\n    \"lint:js\": \"eslint . --cache\",\n    \"lint:js:fix\": \"eslint . --fix\",\n    \"start\": \"ember serve\",\n    \"test\": \"qunit node-tests/*-test.js\"\n  },\n  \"dependencies\": {\n    \"broccoli-debug\": \"^0.6.3\",\n    \"broccoli-merge-trees\": \"^4.2.0\",\n    \"broccoli-plugin\": \"^4.0.7\",\n    \"chalk\": \"^4.0.0\",\n    \"ember-cli-babel\": \"^7.26.11\",\n    \"express\": \"^4.18.2\",\n    \"fastboot\": \"^4.1.1\",\n    \"mkdirp\": \"^3.0.1\"\n  },\n  \"devDependencies\": {\n    \"@ember/optional-features\": \"^2.0.0\",\n    \"@ember/string\": \"^3.0.1\",\n    \"@ember/test-helpers\": \"^2.4.2\",\n    \"@embroider/test-setup\": \"^0.43.5\",\n    \"@glimmer/component\": \"^1.0.4\",\n    \"@glimmer/tracking\": \"^1.0.4\",\n    \"babel-eslint\": \"^10.1.0\",\n    \"broccoli-asset-rev\": \"^3.0.0\",\n    \"ember-auto-import\": \"^2.2.3\",\n    \"ember-cli\": \"~3.28.3\",\n    \"ember-cli-dependency-checker\": \"^3.2.0\",\n    \"ember-cli-fastboot\": \"^4.1.1\",\n    \"ember-cli-head\": \"^2.0.0\",\n    \"ember-cli-htmlbars\": \"^5.7.1\",\n    \"ember-cli-inject-live-reload\": \"^2.1.0\",\n    \"ember-cli-sri\": \"^2.1.1\",\n    \"ember-cli-terser\": \"^4.0.2\",\n    \"ember-disable-prototype-extensions\": \"^1.1.3\",\n    \"ember-fetch\": \"^8.1.1\",\n    \"ember-load-initializers\": \"^2.1.2\",\n    \"ember-maybe-import-regenerator\": \"^1.0.0\",\n    \"ember-page-title\": \"^7.0.0\",\n    \"ember-qunit\": \"^5.1.4\",\n    \"ember-resolver\": \"^8.0.3\",\n    \"ember-source\": \"~3.28.0\",\n    \"ember-source-channel-url\": \"^3.0.0\",\n    \"ember-try\": \"^3.0.0\",\n    \"eslint\": \"^7.32.0\",\n    \"eslint-config-prettier\": \"^8.3.0\",\n    \"eslint-plugin-ember\": \"^10.5.4\",\n    \"eslint-plugin-node\": \"^11.1.0\",\n    \"eslint-plugin-prettier\": \"^3.4.1\",\n    \"eslint-plugin-qunit\": \"^6.2.0\",\n    \"jsdom\": \"^11.5.1\",\n    \"loader.js\": \"^4.7.0\",\n    \"npm-run-all\": \"^4.1.5\",\n    \"prettier\": \"^2.3.2\",\n    \"qunit\": \"^2.16.0\",\n    \"qunit-dom\": \"^1.6.0\",\n    \"release-plan\": \"^0.9.0\",\n    \"webpack\": \"^5.59.0\"\n  },\n  \"engines\": {\n    \"node\": \"12.* || 14.* || >= 16\"\n  },\n  \"ember\": {\n    \"edition\": \"octane\"\n  },\n  \"ember-addon\": {\n    \"configPath\": \"tests/dummy/config\",\n    \"after\": [\n      \"ember-cli-fastboot\",\n      \"ember-engines\",\n      \"ember-auto-import\"\n    ],\n    \"before\": [\n      \"broccoli-asset-rev\"\n    ]\n  }\n}\n"
  },
  {
    "path": "testem.js",
    "content": "'use strict';\n\nmodule.exports = {\n  test_page: 'tests/index.html?hidepassed',\n  disable_watching: true,\n  launch_in_ci: ['Chrome'],\n  launch_in_dev: ['Chrome'],\n  browser_start_timeout: 120,\n  browser_args: {\n    Chrome: {\n      ci: [\n        // --no-sandbox is needed when running Chrome inside a container\n        process.env.CI ? '--no-sandbox' : null,\n        '--headless',\n        '--disable-dev-shm-usage',\n        '--disable-software-rasterizer',\n        '--mute-audio',\n        '--remote-debugging-port=0',\n        '--window-size=1440,900',\n      ].filter(Boolean),\n    },\n  },\n};\n"
  },
  {
    "path": "tests/dummy/app/app.js",
    "content": "import Application from '@ember/application';\nimport Resolver from 'ember-resolver';\nimport loadInitializers from 'ember-load-initializers';\nimport config from 'dummy/config/environment';\n\nexport default class App extends Application {\n  modulePrefix = config.modulePrefix;\n  podModulePrefix = config.podModulePrefix;\n  Resolver = Resolver;\n}\n\nloadInitializers(App, config.modulePrefix);\n"
  },
  {
    "path": "tests/dummy/app/components/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/controllers/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/helpers/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/index.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <meta name=\"description\" content=\"\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n    {{content-for \"head\"}}\n\n    <link integrity=\"\" rel=\"stylesheet\" href=\"{{rootURL}}assets/vendor.css\">\n    <link integrity=\"\" rel=\"stylesheet\" href=\"{{rootURL}}assets/dummy.css\">\n\n    {{content-for \"head-footer\"}}\n  </head>\n  <body>\n    {{content-for \"body\"}}\n\n    <script src=\"{{rootURL}}assets/vendor.js\"></script>\n    <script src=\"{{rootURL}}assets/dummy.js\"></script>\n\n    {{content-for \"body-footer\"}}\n  </body>\n</html>\n"
  },
  {
    "path": "tests/dummy/app/models/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/router.js",
    "content": "import EmberRouter from '@ember/routing/router';\nimport config from 'dummy/config/environment';\nimport { inject } from '@ember/service';\n\nexport default class Router extends EmberRouter {\n  location = config.locationType;\n  rootURL = config.rootURL;\n\n  // This implements is the standard instructions from ember-cli-document-title\n  // for making it play nicely with ember-cli-head\n  @inject()\n  headData;\n\n  setTitle(title) {\n    this.headData.set('title', title);\n  }\n}\n\nRouter.map(function () {\n  this.route('discovered');\n  this.route('from-sample-data');\n  this.route('use-static-asset');\n  this.route('redirects');\n});\n"
  },
  {
    "path": "tests/dummy/app/routes/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/dummy/app/routes/index.js",
    "content": "import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class IndexRoute extends Route {\n  @service\n  headData;\n\n  afterModel() {\n    this.headData.description = 'OG Description from Index Route';\n  }\n}\n"
  },
  {
    "path": "tests/dummy/app/routes/redirects.js",
    "content": "import Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class RedirectsRoute extends Route {\n  @service router;\n  beforeModel() {\n    return this.router.transitionTo('from-sample-data');\n  }\n}\n"
  },
  {
    "path": "tests/dummy/app/routes/use-static-asset.js",
    "content": "import Route from '@ember/routing/route';\nimport fetch from 'fetch';\nimport { inject as service } from '@ember/service';\n\nexport default class UseStaticAssetRoute extends Route {\n  @service\n  fastboot;\n\n  async model() {\n    let url;\n    if (this.fastboot.isFastBoot) {\n      url = `http://${this.fastboot.request.host}/static.json`;\n    } else {\n      url = '/static.json';\n    }\n    let response = await fetch(url);\n    let json = await response.json();\n    return json;\n  }\n}\n"
  },
  {
    "path": "tests/dummy/app/styles/app.css",
    "content": ""
  },
  {
    "path": "tests/dummy/app/templates/application.hbs",
    "content": "{{head-layout}}\n\n<h2 id=\"title\">Welcome to Ember</h2>\n\n{{outlet}}"
  },
  {
    "path": "tests/dummy/app/templates/discovered.hbs",
    "content": "<h1>Discovered</h1>"
  },
  {
    "path": "tests/dummy/app/templates/from-sample-data.hbs",
    "content": "<h1>From Sample Data</h1>"
  },
  {
    "path": "tests/dummy/app/templates/head.hbs",
    "content": "<title>{{this.model.title}}</title>\n<meta property=\"og:description\" content={{this.model.description}} />"
  },
  {
    "path": "tests/dummy/app/templates/index.hbs",
    "content": "{{page-title \"Document Title from page-title\"}}\n\n<div data-test-id=\"index-content\">This is some content</div>\n<a href=\"/discovered\">discovered</a>\n"
  },
  {
    "path": "tests/dummy/app/templates/use-static-asset.hbs",
    "content": "<div class=\"message\">{{this.model.message}}</div>"
  },
  {
    "path": "tests/dummy/config/ember-cli-update.json",
    "content": "{\n  \"schemaVersion\": \"1.0.0\",\n  \"packages\": [\n    {\n      \"name\": \"ember-cli\",\n      \"version\": \"3.28.3\",\n      \"blueprints\": [\n        {\n          \"name\": \"addon\",\n          \"outputRepo\": \"https://github.com/ember-cli/ember-addon-output\",\n          \"codemodsSource\": \"ember-addon-codemods-manifest@1\",\n          \"isBaseBlueprint\": true,\n          \"options\": [\n            \"--yarn\",\n            \"--no-welcome\"\n          ]\n        }\n      ]\n    }\n  ]\n}\n"
  },
  {
    "path": "tests/dummy/config/environment.js",
    "content": "'use strict';\n\nmodule.exports = function (environment) {\n  let ENV = {\n    modulePrefix: 'dummy',\n    environment,\n    rootURL: '/',\n    locationType: 'auto',\n    EmberENV: {\n      FEATURES: {\n        // Here you can enable experimental features on an ember canary build\n        // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true\n      },\n      EXTEND_PROTOTYPES: {\n        // Prevent Ember Data from overriding Date.parse.\n        Date: false,\n      },\n    },\n\n    APP: {\n      // Here you can pass flags/options to your application instance\n      // when it is created\n    },\n\n    fastboot: {\n      hostWhitelist: [/^localhost:\\d+$/],\n    },\n  };\n\n  if (environment === 'development') {\n    // ENV.APP.LOG_RESOLVER = true;\n    // ENV.APP.LOG_ACTIVE_GENERATION = true;\n    // ENV.APP.LOG_TRANSITIONS = true;\n    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;\n    // ENV.APP.LOG_VIEW_LOOKUPS = true;\n  }\n\n  if (environment === 'test') {\n    // Testem prefers this...\n    ENV.locationType = 'none';\n\n    // keep test console output quieter\n    ENV.APP.LOG_ACTIVE_GENERATION = false;\n    ENV.APP.LOG_VIEW_LOOKUPS = false;\n\n    ENV.APP.rootElement = '#ember-testing';\n    ENV.APP.autoboot = false;\n  }\n\n  if (environment === 'production') {\n    // here you can enable a production-specific feature\n  }\n\n  return ENV;\n};\n"
  },
  {
    "path": "tests/dummy/config/optional-features.json",
    "content": "{\n  \"application-template-wrapper\": false,\n  \"default-async-observers\": true,\n  \"jquery-integration\": false,\n  \"template-only-glimmer-components\": true\n}\n"
  },
  {
    "path": "tests/dummy/config/targets.js",
    "content": "'use strict';\n\nconst browsers = [\n  'last 1 Chrome versions',\n  'last 1 Firefox versions',\n  'last 1 Safari versions',\n];\n\n// Ember's browser support policy is changing, and IE11 support will end in\n// v4.0 onwards.\n//\n// See https://deprecations.emberjs.com/v3.x#toc_3-0-browser-support-policy\n//\n// If you need IE11 support on a version of Ember that still offers support\n// for it, uncomment the code block below.\n//\n// const isCI = Boolean(process.env.CI);\n// const isProduction = process.env.EMBER_ENV === 'production';\n//\n// if (isCI || isProduction) {\n//   browsers.push('ie 11');\n// }\n\nmodule.exports = {\n  browsers,\n  node: true,\n};\n"
  },
  {
    "path": "tests/dummy/public/robots.txt",
    "content": "# http://www.robotstxt.org\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "tests/dummy/public/sample-data.json",
    "content": "[\n  {\n    \"url\": \"/from-sample-data\"\n  }\n]\n"
  },
  {
    "path": "tests/dummy/public/static.json",
    "content": "{\n  \"message\": \"This is from static json\"\n}\n"
  },
  {
    "path": "tests/helpers/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/index.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <title>Dummy Tests</title>\n    <meta name=\"description\" content=\"\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n    {{content-for \"head\"}}\n    {{content-for \"test-head\"}}\n\n    <link rel=\"stylesheet\" href=\"{{rootURL}}assets/vendor.css\">\n    <link rel=\"stylesheet\" href=\"{{rootURL}}assets/dummy.css\">\n    <link rel=\"stylesheet\" href=\"{{rootURL}}assets/test-support.css\">\n\n    {{content-for \"head-footer\"}}\n    {{content-for \"test-head-footer\"}}\n  </head>\n  <body>\n    {{content-for \"body\"}}\n    {{content-for \"test-body\"}}\n\n    <div id=\"qunit\"></div>\n    <div id=\"qunit-fixture\">\n      <div id=\"ember-testing-container\">\n        <div id=\"ember-testing\"></div>\n      </div>\n    </div>\n\n    <script src=\"/testem.js\" integrity=\"\" data-embroider-ignore></script>\n    <script src=\"{{rootURL}}assets/vendor.js\"></script>\n    <script src=\"{{rootURL}}assets/test-support.js\"></script>\n    <script src=\"{{rootURL}}assets/dummy.js\"></script>\n    <script src=\"{{rootURL}}assets/tests.js\"></script>\n\n    {{content-for \"body-footer\"}}\n    {{content-for \"test-body-footer\"}}\n  </body>\n</html>\n"
  },
  {
    "path": "tests/integration/.gitkeep",
    "content": ""
  },
  {
    "path": "tests/test-helper.js",
    "content": "import Application from 'dummy/app';\nimport config from 'dummy/config/environment';\nimport * as QUnit from 'qunit';\nimport { setApplication } from '@ember/test-helpers';\nimport { setup } from 'qunit-dom';\nimport { start } from 'ember-qunit';\n\nsetApplication(Application.create(config.APP));\n\nsetup(QUnit.assert);\n\nstart();\n"
  },
  {
    "path": "tests/unit/.gitkeep",
    "content": ""
  },
  {
    "path": "vendor/.gitkeep",
    "content": ""
  }
]