From f8d5794c2cdd04014adcedbfdde4318984fb988a Mon Sep 17 00:00:00 2001 From: Sergey Astapov Date: Tue, 29 Oct 2024 23:33:23 -0400 Subject: [PATCH] Switch to monorepo --- .github/workflows/ci.yml | 12 +- .github/workflows/push-dist.yml | 34 ++++++ .gitignore | 26 ++-- .npmrc | 9 ++ .prettierignore | 11 +- .prettierrc.js | 10 +- package.json | 108 ++--------------- pnpm-lock.yaml | 41 +++++++ pnpm-workspace.yaml | 2 + test-app/.editorconfig | 19 +++ .ember-cli => test-app/.ember-cli | 0 .eslintignore => test-app/.eslintignore | 0 .eslintrc.js => test-app/.eslintrc.js | 0 test-app/.gitignore | 25 ++++ .npmignore => test-app/.npmignore | 0 test-app/.prettierignore | 13 ++ test-app/.prettierrc.js | 12 ++ .stylelintignore => test-app/.stylelintignore | 0 .stylelintrc.js => test-app/.stylelintrc.js | 0 .../.template-lintrc.js | 0 .watchmanconfig => test-app/.watchmanconfig | 0 .../addon}/helpers/changeset-get.js | 0 .../addon}/helpers/changeset-set.js | 0 .../addon}/helpers/changeset.js | 0 {addon => test-app/addon}/index.js | 0 {addon => test-app/addon}/utils/is-object.js | 0 {addon => test-app/addon}/utils/merge-deep.js | 0 .../addon}/validated-changeset.js | 0 .../app}/helpers/changeset-get.js | 0 .../app}/helpers/changeset-set.js | 0 {app => test-app/app}/helpers/changeset.js | 0 {assets => test-app/assets}/title.svg | 0 .../ember-cli-build.js | 0 index.d.ts => test-app/index.d.ts | 0 index.js => test-app/index.js | 0 test-app/package.json | 113 ++++++++++++++++++ testem.js => test-app/testem.js | 0 .../tests}/dummy/app/adapters/application.js | 0 {tests => test-app/tests}/dummy/app/app.js | 0 .../dummy/app/components/changeset-form.hbs | 0 .../dummy/app/components/changeset-form.js | 0 .../dummy/app/components/validated-form.hbs | 0 .../dummy/app/components/validated-form.js | 0 .../tests}/dummy/app/controllers/.gitkeep | 0 .../tests}/dummy/app/helpers/.gitkeep | 0 .../tests}/dummy/app/index.html | 0 .../tests}/dummy/app/models/.gitkeep | 0 .../tests}/dummy/app/models/dog.js | 0 .../tests}/dummy/app/models/profile.js | 0 .../tests}/dummy/app/models/sync-user.js | 0 .../tests}/dummy/app/models/user.js | 0 {tests => test-app/tests}/dummy/app/router.js | 0 .../tests}/dummy/app/routes/.gitkeep | 0 .../tests}/dummy/app/routes/index.js | 0 .../tests}/dummy/app/routes/validated.js | 0 .../dummy/app/serializers/application.js | 0 .../tests}/dummy/app/services/store.js | 0 .../tests}/dummy/app/styles/app.css | 0 .../dummy/app/templates/application.hbs | 0 .../tests}/dummy/app/templates/index.hbs | 0 .../tests}/dummy/app/templates/validated.hbs | 0 .../tests}/dummy/config/ember-cli-update.json | 0 .../tests}/dummy/config/ember-try.js | 18 ++- .../tests}/dummy/config/environment.js | 0 .../dummy/config/optional-features.json | 0 .../tests}/dummy/config/targets.js | 0 .../tests}/dummy/public/robots.txt | 0 {tests => test-app/tests}/helpers/index.js | 0 {tests => test-app/tests}/index.html | 0 .../components/changeset-form-test.js | 0 .../components/validated-form-test.js | 0 .../integration/helpers/changeset-get-test.js | 0 .../integration/helpers/changeset-test.js | 0 .../tests}/integration/main-test.js | 0 {tests => test-app/tests}/test-helper.js | 0 .../tests}/unit/changeset-test.js | 0 .../tests}/unit/utils/merge-deep-test.js | 0 {types => test-app/types}/index.d.ts | 0 78 files changed, 315 insertions(+), 138 deletions(-) create mode 100644 .github/workflows/push-dist.yml create mode 100644 .npmrc create mode 100644 pnpm-workspace.yaml create mode 100644 test-app/.editorconfig rename .ember-cli => test-app/.ember-cli (100%) rename .eslintignore => test-app/.eslintignore (100%) rename .eslintrc.js => test-app/.eslintrc.js (100%) create mode 100644 test-app/.gitignore rename .npmignore => test-app/.npmignore (100%) create mode 100644 test-app/.prettierignore create mode 100644 test-app/.prettierrc.js rename .stylelintignore => test-app/.stylelintignore (100%) rename .stylelintrc.js => test-app/.stylelintrc.js (100%) rename .template-lintrc.js => test-app/.template-lintrc.js (100%) rename .watchmanconfig => test-app/.watchmanconfig (100%) rename {addon => test-app/addon}/helpers/changeset-get.js (100%) rename {addon => test-app/addon}/helpers/changeset-set.js (100%) rename {addon => test-app/addon}/helpers/changeset.js (100%) rename {addon => test-app/addon}/index.js (100%) rename {addon => test-app/addon}/utils/is-object.js (100%) rename {addon => test-app/addon}/utils/merge-deep.js (100%) rename {addon => test-app/addon}/validated-changeset.js (100%) rename {app => test-app/app}/helpers/changeset-get.js (100%) rename {app => test-app/app}/helpers/changeset-set.js (100%) rename {app => test-app/app}/helpers/changeset.js (100%) rename {assets => test-app/assets}/title.svg (100%) rename ember-cli-build.js => test-app/ember-cli-build.js (100%) rename index.d.ts => test-app/index.d.ts (100%) rename index.js => test-app/index.js (100%) create mode 100644 test-app/package.json rename testem.js => test-app/testem.js (100%) rename {tests => test-app/tests}/dummy/app/adapters/application.js (100%) rename {tests => test-app/tests}/dummy/app/app.js (100%) rename {tests => test-app/tests}/dummy/app/components/changeset-form.hbs (100%) rename {tests => test-app/tests}/dummy/app/components/changeset-form.js (100%) rename {tests => test-app/tests}/dummy/app/components/validated-form.hbs (100%) rename {tests => test-app/tests}/dummy/app/components/validated-form.js (100%) rename {tests => test-app/tests}/dummy/app/controllers/.gitkeep (100%) rename {tests => test-app/tests}/dummy/app/helpers/.gitkeep (100%) rename {tests => test-app/tests}/dummy/app/index.html (100%) rename {tests => test-app/tests}/dummy/app/models/.gitkeep (100%) rename {tests => test-app/tests}/dummy/app/models/dog.js (100%) rename {tests => test-app/tests}/dummy/app/models/profile.js (100%) rename {tests => test-app/tests}/dummy/app/models/sync-user.js (100%) rename {tests => test-app/tests}/dummy/app/models/user.js (100%) rename {tests => test-app/tests}/dummy/app/router.js (100%) rename {tests => test-app/tests}/dummy/app/routes/.gitkeep (100%) rename {tests => test-app/tests}/dummy/app/routes/index.js (100%) rename {tests => test-app/tests}/dummy/app/routes/validated.js (100%) rename {tests => test-app/tests}/dummy/app/serializers/application.js (100%) rename {tests => test-app/tests}/dummy/app/services/store.js (100%) rename {tests => test-app/tests}/dummy/app/styles/app.css (100%) rename {tests => test-app/tests}/dummy/app/templates/application.hbs (100%) rename {tests => test-app/tests}/dummy/app/templates/index.hbs (100%) rename {tests => test-app/tests}/dummy/app/templates/validated.hbs (100%) rename {tests => test-app/tests}/dummy/config/ember-cli-update.json (100%) rename {tests => test-app/tests}/dummy/config/ember-try.js (82%) rename {tests => test-app/tests}/dummy/config/environment.js (100%) rename {tests => test-app/tests}/dummy/config/optional-features.json (100%) rename {tests => test-app/tests}/dummy/config/targets.js (100%) rename {tests => test-app/tests}/dummy/public/robots.txt (100%) rename {tests => test-app/tests}/helpers/index.js (100%) rename {tests => test-app/tests}/index.html (100%) rename {tests => test-app/tests}/integration/components/changeset-form-test.js (100%) rename {tests => test-app/tests}/integration/components/validated-form-test.js (100%) rename {tests => test-app/tests}/integration/helpers/changeset-get-test.js (100%) rename {tests => test-app/tests}/integration/helpers/changeset-test.js (100%) rename {tests => test-app/tests}/integration/main-test.js (100%) rename {tests => test-app/tests}/test-helper.js (100%) rename {tests => test-app/tests}/unit/changeset-test.js (100%) rename {tests => test-app/tests}/unit/utils/merge-deep-test.js (100%) rename {types => test-app/types}/index.d.ts (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f37b33d..8fd357aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - with: - version: 9 - name: Install Node uses: actions/setup-node@v4 with: @@ -31,8 +29,10 @@ jobs: run: pnpm install --frozen-lockfile - name: Lint run: pnpm lint + working-directory: test-app - name: Run Tests run: pnpm test:ember + working-directory: test-app floating: name: "Floating Dependencies" @@ -42,8 +42,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - with: - version: 9 - uses: actions/setup-node@v4 with: node-version: 18 @@ -52,6 +50,7 @@ jobs: run: pnpm install --no-lockfile - name: Run Tests run: pnpm test:ember + working-directory: test-app try-scenarios: name: ${{ matrix.try-scenario }} @@ -82,8 +81,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - with: - version: 9 - name: Install Node uses: actions/setup-node@v4 with: @@ -92,4 +89,5 @@ jobs: - name: Install Dependencies run: pnpm install --frozen-lockfile - name: Run Tests - run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} + run: ../node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup + working-directory: test-app diff --git a/.github/workflows/push-dist.yml b/.github/workflows/push-dist.yml new file mode 100644 index 00000000..aa767345 --- /dev/null +++ b/.github/workflows/push-dist.yml @@ -0,0 +1,34 @@ +# Because this library needs to be built, +# we can't easily point package.json files at the git repo for easy cross-repo testing. +# +# This workflow brings back that capability by placing the compiled assets on a "dist" branch +# (configurable via the "branch" option below) +name: Push dist + +on: + push: + branches: + - main + - master + +jobs: + push-dist: + name: Push dist + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: pnpm + - name: Install Dependencies + run: pnpm install --frozen-lockfile + - uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0 + with: + branch: dist + token: ${{ secrets.GITHUB_TOKEN }} + working-directory: 'test-app' diff --git a/.gitignore b/.gitignore index 71ad79d0..dbe5764f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,21 @@ -# compiled output -/dist/ -/declarations/ +# See https://help.github.com/ignore-files/ for more about ignoring files. # dependencies -/node_modules/ +node_modules/ # misc -/.env* -/.pnp* -/.eslintcache -/coverage/ -/npm-debug.log* -/testem.log -/yarn-error.log +.env* +.pnp* +.pnpm-debug.log +.sass-cache +.eslintcache +coverage/ +npm-debug.log* +yarn-error.log # ember-try /.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try /package.json.ember-try /package-lock.json.ember-try /yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ +/pnpm-lock.ember-try.yaml diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..bc74982c --- /dev/null +++ b/.npmrc @@ -0,0 +1,9 @@ +# Docs: https://pnpm.io/npmrc +# https://github.com/emberjs/rfcs/pull/907 + +# we don't want addons to be bad citizens of the ecosystem +auto-install-peers=false + +# we want true isolation, +# if a dependency is not declared, we want an error +resolve-peers-from-workspace-root=false diff --git a/.prettierignore b/.prettierignore index 9385391f..e8f376b0 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,13 +1,10 @@ -# unconventional js -/blueprints/*/files/ - -# compiled output -/dist/ +# Prettier is also run from each package, so the ignores here +# protect against files that may not be within a package # misc -/coverage/ !.* -.*/ +.lint-todo/ # ember-try /.node_modules.ember-try/ +/pnpm-lock.ember-try.yaml diff --git a/.prettierrc.js b/.prettierrc.js index e5f7b6d1..d6a52956 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,12 +1,6 @@ 'use strict'; module.exports = { - overrides: [ - { - files: '*.{js,ts}', - options: { - singleQuote: true, - }, - }, - ], + plugins: ['prettier-plugin-ember-template-tag'], + singleQuote: true, }; diff --git a/package.json b/package.json index 13f4b94d..8fe61c28 100644 --- a/package.json +++ b/package.json @@ -1,114 +1,22 @@ { - "name": "ember-changeset", - "version": "4.1.2", - "description": "Changesets for Ember", - "keywords": [ - "ember-addon", - "changeset" - ], - "homepage": "https://github.com/adopted-ember-addons/ember-changeset", - "bugs": "https://github.com/adopted-ember-addons/ember-changeset/issues", + "private": true, "repository": "https://github.com/adopted-ember-addons/ember-changeset", "license": "MIT", "author": "Lauren Tan ", - "contributors": [ - { - "name": "Scott Newcomer", - "url": "https://github.com/snewcomer" - } - ], - "types": "./index.d.ts", - "directories": { - "doc": "doc", - "test": "tests" - }, "scripts": { - "build": "ember build --environment=production", - "contributors": "pnpm dlx contributor-faces -e \"(*-bot|*\\[bot\\]|*-tomster|homu|bors)\"", - "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", - "lint:css": "stylelint \"**/*.css\"", - "lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"", - "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", - "lint:hbs": "ember-template-lint .", - "lint:hbs:fix": "ember-template-lint . --fix", - "lint:js": "eslint . --cache", - "lint:js:fix": "eslint . --fix", - "start": "ember serve", - "test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\"", - "test:ember": "ember test", - "test:ember-compatibility": "ember try:each" - }, - "dependencies": { - "@babel/core": "^7.25.2", - "@embroider/macros": "^1.0.0", - "@glimmer/tracking": "^1.1.2", - "ember-auto-import": "^2.8.1", - "ember-cli-babel": "^7.26.11", - "validated-changeset": "~1.3.4" + "lint": "pnpm --filter '*' lint", + "lint:fix": "pnpm --filter '*' lint:fix", + "test": "pnpm --filter '*' test", + "test:ember": "pnpm --filter '*' test:ember" }, "devDependencies": { - "@babel/eslint-parser": "^7.25.1", - "@babel/plugin-proposal-decorators": "^7.24.7", - "@ember/optional-features": "^2.1.0", - "@ember/string": "^3.0.1", - "@ember/test-helpers": "^3.3.1", - "@embroider/test-setup": "^4.0.0", - "@glimmer/component": "^1.1.2", - "@glimmer/tracking": "^1.1.2", - "broccoli-asset-rev": "^3.0.0", - "concurrently": "^8.2.2", - "ember-cli": "~5.12.0", - "ember-cli-clean-css": "^3.0.0", - "ember-cli-dependency-checker": "^3.3.2", - "ember-cli-htmlbars": "^6.3.0", - "ember-cli-inject-live-reload": "^2.1.0", - "ember-cli-sri": "^2.1.1", - "ember-cli-terser": "^4.0.2", - "ember-data": "~4.12.8", - "ember-load-initializers": "^2.1.2", - "ember-qunit": "^8.1.0", - "ember-resolver": "^12.0.1", - "ember-source": "~5.12.0", - "ember-source-channel-url": "^3.0.0", - "ember-template-lint": "^6.0.0", - "ember-try": "^3.0.0", - "eslint": "^8.57.1", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-ember": "^12.2.1", - "eslint-plugin-n": "^16.6.2", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-qunit": "^8.1.2", - "loader.js": "^4.7.0", + "concurrently": "^9.1.0", "prettier": "^3.3.3", - "qunit": "^2.22.0", - "qunit-dom": "^3.2.1", - "release-plan": "^0.10.0", - "stylelint": "^15.11.0", - "stylelint-config-standard": "^34.0.0", - "stylelint-prettier": "^4.1.0", - "webpack": "^5.95.0", - "yup": "^0.32.11" - }, - "peerDependencies": { - "ember-data": "*", - "ember-source": ">=3.20.0" - }, - "peerDependenciesMeta": { - "ember-data": { - "optional": true - } - }, - "engines": { - "node": "18.* || 20.* || >= 22" + "prettier-plugin-ember-template-tag": "^2.0.2" }, + "packageManager": "pnpm@9.12.3", "volta": { "node": "18.20.4", "pnpm": "9.12.3" - }, - "ember": { - "edition": "octane" - }, - "ember-addon": { - "configPath": "tests/dummy/config" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5499bb13..72ed79fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,18 @@ settings: importers: .: + devDependencies: + concurrently: + specifier: ^9.1.0 + version: 9.1.0 + prettier: + specifier: ^3.3.3 + version: 3.3.3 + prettier-plugin-ember-template-tag: + specifier: ^2.0.2 + version: 2.0.4(prettier@3.3.3) + + test-app: dependencies: '@babel/core': specifier: ^7.25.2 @@ -2184,6 +2196,11 @@ packages: engines: {node: ^14.13.0 || >=16.0.0} hasBin: true + concurrently@9.1.0: + resolution: {integrity: sha512-VxkzwMAn4LP7WyMnJNbHN5mKV9L2IbyDjpzemKr99sXNR3GqRNMMHdm7prV1ws9wg7ETj6WUkNOigZVsptwbgg==} + engines: {node: '>=18'} + hasBin: true + config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} @@ -5040,6 +5057,12 @@ packages: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} + prettier-plugin-ember-template-tag@2.0.4: + resolution: {integrity: sha512-Ude3MJyPBMr/Er5aSS9Y0dsnHWX3prpJB+Jj/BKKUT/EvG2ftnIMBsZXmRu68RJA62JJB8MdKBloYmCu2pTRNg==} + engines: {node: 18.* || >= 20} + peerDependencies: + prettier: '>= 3.0.0' + prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -9168,6 +9191,16 @@ snapshots: tree-kill: 1.2.2 yargs: 17.7.2 + concurrently@9.1.0: + dependencies: + chalk: 4.1.2 + lodash: 4.17.21 + rxjs: 7.8.1 + shell-quote: 1.8.1 + supports-color: 8.1.1 + tree-kill: 1.2.2 + yargs: 17.7.2 + config-chain@1.1.13: dependencies: ini: 1.3.8 @@ -12506,6 +12539,14 @@ snapshots: dependencies: fast-diff: 1.3.0 + prettier-plugin-ember-template-tag@2.0.4(prettier@3.3.3): + dependencies: + '@babel/core': 7.26.0 + content-tag: 2.0.3 + prettier: 3.3.3 + transitivePeerDependencies: + - supports-color + prettier@2.8.8: {} prettier@3.3.3: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000..4ec84f98 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'test-app' diff --git a/test-app/.editorconfig b/test-app/.editorconfig new file mode 100644 index 00000000..c35a0024 --- /dev/null +++ b/test-app/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.hbs] +insert_final_newline = false + +[*.{diff,md}] +trim_trailing_whitespace = false diff --git a/.ember-cli b/test-app/.ember-cli similarity index 100% rename from .ember-cli rename to test-app/.ember-cli diff --git a/.eslintignore b/test-app/.eslintignore similarity index 100% rename from .eslintignore rename to test-app/.eslintignore diff --git a/.eslintrc.js b/test-app/.eslintrc.js similarity index 100% rename from .eslintrc.js rename to test-app/.eslintrc.js diff --git a/test-app/.gitignore b/test-app/.gitignore new file mode 100644 index 00000000..71ad79d0 --- /dev/null +++ b/test-app/.gitignore @@ -0,0 +1,25 @@ +# compiled output +/dist/ +/declarations/ + +# dependencies +/node_modules/ + +# misc +/.env* +/.pnp* +/.eslintcache +/coverage/ +/npm-debug.log* +/testem.log +/yarn-error.log + +# ember-try +/.node_modules.ember-try/ +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try + +# broccoli-debug +/DEBUG/ diff --git a/.npmignore b/test-app/.npmignore similarity index 100% rename from .npmignore rename to test-app/.npmignore diff --git a/test-app/.prettierignore b/test-app/.prettierignore new file mode 100644 index 00000000..9385391f --- /dev/null +++ b/test-app/.prettierignore @@ -0,0 +1,13 @@ +# unconventional js +/blueprints/*/files/ + +# compiled output +/dist/ + +# misc +/coverage/ +!.* +.*/ + +# ember-try +/.node_modules.ember-try/ diff --git a/test-app/.prettierrc.js b/test-app/.prettierrc.js new file mode 100644 index 00000000..e5f7b6d1 --- /dev/null +++ b/test-app/.prettierrc.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = { + overrides: [ + { + files: '*.{js,ts}', + options: { + singleQuote: true, + }, + }, + ], +}; diff --git a/.stylelintignore b/test-app/.stylelintignore similarity index 100% rename from .stylelintignore rename to test-app/.stylelintignore diff --git a/.stylelintrc.js b/test-app/.stylelintrc.js similarity index 100% rename from .stylelintrc.js rename to test-app/.stylelintrc.js diff --git a/.template-lintrc.js b/test-app/.template-lintrc.js similarity index 100% rename from .template-lintrc.js rename to test-app/.template-lintrc.js diff --git a/.watchmanconfig b/test-app/.watchmanconfig similarity index 100% rename from .watchmanconfig rename to test-app/.watchmanconfig diff --git a/addon/helpers/changeset-get.js b/test-app/addon/helpers/changeset-get.js similarity index 100% rename from addon/helpers/changeset-get.js rename to test-app/addon/helpers/changeset-get.js diff --git a/addon/helpers/changeset-set.js b/test-app/addon/helpers/changeset-set.js similarity index 100% rename from addon/helpers/changeset-set.js rename to test-app/addon/helpers/changeset-set.js diff --git a/addon/helpers/changeset.js b/test-app/addon/helpers/changeset.js similarity index 100% rename from addon/helpers/changeset.js rename to test-app/addon/helpers/changeset.js diff --git a/addon/index.js b/test-app/addon/index.js similarity index 100% rename from addon/index.js rename to test-app/addon/index.js diff --git a/addon/utils/is-object.js b/test-app/addon/utils/is-object.js similarity index 100% rename from addon/utils/is-object.js rename to test-app/addon/utils/is-object.js diff --git a/addon/utils/merge-deep.js b/test-app/addon/utils/merge-deep.js similarity index 100% rename from addon/utils/merge-deep.js rename to test-app/addon/utils/merge-deep.js diff --git a/addon/validated-changeset.js b/test-app/addon/validated-changeset.js similarity index 100% rename from addon/validated-changeset.js rename to test-app/addon/validated-changeset.js diff --git a/app/helpers/changeset-get.js b/test-app/app/helpers/changeset-get.js similarity index 100% rename from app/helpers/changeset-get.js rename to test-app/app/helpers/changeset-get.js diff --git a/app/helpers/changeset-set.js b/test-app/app/helpers/changeset-set.js similarity index 100% rename from app/helpers/changeset-set.js rename to test-app/app/helpers/changeset-set.js diff --git a/app/helpers/changeset.js b/test-app/app/helpers/changeset.js similarity index 100% rename from app/helpers/changeset.js rename to test-app/app/helpers/changeset.js diff --git a/assets/title.svg b/test-app/assets/title.svg similarity index 100% rename from assets/title.svg rename to test-app/assets/title.svg diff --git a/ember-cli-build.js b/test-app/ember-cli-build.js similarity index 100% rename from ember-cli-build.js rename to test-app/ember-cli-build.js diff --git a/index.d.ts b/test-app/index.d.ts similarity index 100% rename from index.d.ts rename to test-app/index.d.ts diff --git a/index.js b/test-app/index.js similarity index 100% rename from index.js rename to test-app/index.js diff --git a/test-app/package.json b/test-app/package.json new file mode 100644 index 00000000..63d38770 --- /dev/null +++ b/test-app/package.json @@ -0,0 +1,113 @@ +{ + "name": "ember-changeset", + "version": "4.1.2", + "description": "Changesets for Ember", + "keywords": [ + "ember-addon", + "changeset" + ], + "homepage": "https://github.com/adopted-ember-addons/ember-changeset", + "bugs": "https://github.com/adopted-ember-addons/ember-changeset/issues", + "repository": "https://github.com/adopted-ember-addons/ember-changeset", + "license": "MIT", + "author": "Lauren Tan ", + "contributors": [ + { + "name": "Scott Newcomer", + "url": "https://github.com/snewcomer" + } + ], + "types": "./index.d.ts", + "directories": { + "doc": "doc", + "test": "tests" + }, + "scripts": { + "build": "ember build --environment=production", + "contributors": "pnpm dlx contributor-faces -e \"(*-bot|*\\[bot\\]|*-tomster|homu|bors)\"", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"", + "lint:css": "stylelint \"**/*.css\"", + "lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"", + "lint:hbs": "ember-template-lint .", + "lint:hbs:fix": "ember-template-lint . --fix", + "lint:js": "eslint . --cache", + "lint:js:fix": "eslint . --fix", + "start": "ember serve", + "test": "concurrently \"pnpm:lint\" \"pnpm:test:*\" --names \"lint,test:\"", + "test:ember": "ember test", + "test:ember-compatibility": "ember try:each" + }, + "dependencies": { + "@babel/core": "^7.25.2", + "@embroider/macros": "^1.0.0", + "@glimmer/tracking": "^1.1.2", + "ember-auto-import": "^2.8.1", + "ember-cli-babel": "^7.26.11", + "validated-changeset": "~1.3.4" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.25.1", + "@babel/plugin-proposal-decorators": "^7.24.7", + "@ember/optional-features": "^2.1.0", + "@ember/string": "^3.0.1", + "@ember/test-helpers": "^3.3.1", + "@embroider/test-setup": "^4.0.0", + "@glimmer/component": "^1.1.2", + "@glimmer/tracking": "^1.1.2", + "broccoli-asset-rev": "^3.0.0", + "concurrently": "^8.2.2", + "ember-cli": "~5.12.0", + "ember-cli-clean-css": "^3.0.0", + "ember-cli-dependency-checker": "^3.3.2", + "ember-cli-htmlbars": "^6.3.0", + "ember-cli-inject-live-reload": "^2.1.0", + "ember-cli-sri": "^2.1.1", + "ember-cli-terser": "^4.0.2", + "ember-data": "~4.12.8", + "ember-load-initializers": "^2.1.2", + "ember-qunit": "^8.1.0", + "ember-resolver": "^12.0.1", + "ember-source": "~5.12.0", + "ember-source-channel-url": "^3.0.0", + "ember-template-lint": "^6.0.0", + "ember-try": "^3.0.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-ember": "^12.2.1", + "eslint-plugin-n": "^16.6.2", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-qunit": "^8.1.2", + "loader.js": "^4.7.0", + "prettier": "^3.3.3", + "qunit": "^2.22.0", + "qunit-dom": "^3.2.1", + "release-plan": "^0.10.0", + "stylelint": "^15.11.0", + "stylelint-config-standard": "^34.0.0", + "stylelint-prettier": "^4.1.0", + "webpack": "^5.95.0", + "yup": "^0.32.11" + }, + "peerDependencies": { + "ember-data": "*", + "ember-source": ">=3.20.0" + }, + "peerDependenciesMeta": { + "ember-data": { + "optional": true + } + }, + "engines": { + "node": "18.* || 20.* || >= 22" + }, + "volta": { + "extends": "../package.json" + }, + "ember": { + "edition": "octane" + }, + "ember-addon": { + "configPath": "tests/dummy/config" + } +} diff --git a/testem.js b/test-app/testem.js similarity index 100% rename from testem.js rename to test-app/testem.js diff --git a/tests/dummy/app/adapters/application.js b/test-app/tests/dummy/app/adapters/application.js similarity index 100% rename from tests/dummy/app/adapters/application.js rename to test-app/tests/dummy/app/adapters/application.js diff --git a/tests/dummy/app/app.js b/test-app/tests/dummy/app/app.js similarity index 100% rename from tests/dummy/app/app.js rename to test-app/tests/dummy/app/app.js diff --git a/tests/dummy/app/components/changeset-form.hbs b/test-app/tests/dummy/app/components/changeset-form.hbs similarity index 100% rename from tests/dummy/app/components/changeset-form.hbs rename to test-app/tests/dummy/app/components/changeset-form.hbs diff --git a/tests/dummy/app/components/changeset-form.js b/test-app/tests/dummy/app/components/changeset-form.js similarity index 100% rename from tests/dummy/app/components/changeset-form.js rename to test-app/tests/dummy/app/components/changeset-form.js diff --git a/tests/dummy/app/components/validated-form.hbs b/test-app/tests/dummy/app/components/validated-form.hbs similarity index 100% rename from tests/dummy/app/components/validated-form.hbs rename to test-app/tests/dummy/app/components/validated-form.hbs diff --git a/tests/dummy/app/components/validated-form.js b/test-app/tests/dummy/app/components/validated-form.js similarity index 100% rename from tests/dummy/app/components/validated-form.js rename to test-app/tests/dummy/app/components/validated-form.js diff --git a/tests/dummy/app/controllers/.gitkeep b/test-app/tests/dummy/app/controllers/.gitkeep similarity index 100% rename from tests/dummy/app/controllers/.gitkeep rename to test-app/tests/dummy/app/controllers/.gitkeep diff --git a/tests/dummy/app/helpers/.gitkeep b/test-app/tests/dummy/app/helpers/.gitkeep similarity index 100% rename from tests/dummy/app/helpers/.gitkeep rename to test-app/tests/dummy/app/helpers/.gitkeep diff --git a/tests/dummy/app/index.html b/test-app/tests/dummy/app/index.html similarity index 100% rename from tests/dummy/app/index.html rename to test-app/tests/dummy/app/index.html diff --git a/tests/dummy/app/models/.gitkeep b/test-app/tests/dummy/app/models/.gitkeep similarity index 100% rename from tests/dummy/app/models/.gitkeep rename to test-app/tests/dummy/app/models/.gitkeep diff --git a/tests/dummy/app/models/dog.js b/test-app/tests/dummy/app/models/dog.js similarity index 100% rename from tests/dummy/app/models/dog.js rename to test-app/tests/dummy/app/models/dog.js diff --git a/tests/dummy/app/models/profile.js b/test-app/tests/dummy/app/models/profile.js similarity index 100% rename from tests/dummy/app/models/profile.js rename to test-app/tests/dummy/app/models/profile.js diff --git a/tests/dummy/app/models/sync-user.js b/test-app/tests/dummy/app/models/sync-user.js similarity index 100% rename from tests/dummy/app/models/sync-user.js rename to test-app/tests/dummy/app/models/sync-user.js diff --git a/tests/dummy/app/models/user.js b/test-app/tests/dummy/app/models/user.js similarity index 100% rename from tests/dummy/app/models/user.js rename to test-app/tests/dummy/app/models/user.js diff --git a/tests/dummy/app/router.js b/test-app/tests/dummy/app/router.js similarity index 100% rename from tests/dummy/app/router.js rename to test-app/tests/dummy/app/router.js diff --git a/tests/dummy/app/routes/.gitkeep b/test-app/tests/dummy/app/routes/.gitkeep similarity index 100% rename from tests/dummy/app/routes/.gitkeep rename to test-app/tests/dummy/app/routes/.gitkeep diff --git a/tests/dummy/app/routes/index.js b/test-app/tests/dummy/app/routes/index.js similarity index 100% rename from tests/dummy/app/routes/index.js rename to test-app/tests/dummy/app/routes/index.js diff --git a/tests/dummy/app/routes/validated.js b/test-app/tests/dummy/app/routes/validated.js similarity index 100% rename from tests/dummy/app/routes/validated.js rename to test-app/tests/dummy/app/routes/validated.js diff --git a/tests/dummy/app/serializers/application.js b/test-app/tests/dummy/app/serializers/application.js similarity index 100% rename from tests/dummy/app/serializers/application.js rename to test-app/tests/dummy/app/serializers/application.js diff --git a/tests/dummy/app/services/store.js b/test-app/tests/dummy/app/services/store.js similarity index 100% rename from tests/dummy/app/services/store.js rename to test-app/tests/dummy/app/services/store.js diff --git a/tests/dummy/app/styles/app.css b/test-app/tests/dummy/app/styles/app.css similarity index 100% rename from tests/dummy/app/styles/app.css rename to test-app/tests/dummy/app/styles/app.css diff --git a/tests/dummy/app/templates/application.hbs b/test-app/tests/dummy/app/templates/application.hbs similarity index 100% rename from tests/dummy/app/templates/application.hbs rename to test-app/tests/dummy/app/templates/application.hbs diff --git a/tests/dummy/app/templates/index.hbs b/test-app/tests/dummy/app/templates/index.hbs similarity index 100% rename from tests/dummy/app/templates/index.hbs rename to test-app/tests/dummy/app/templates/index.hbs diff --git a/tests/dummy/app/templates/validated.hbs b/test-app/tests/dummy/app/templates/validated.hbs similarity index 100% rename from tests/dummy/app/templates/validated.hbs rename to test-app/tests/dummy/app/templates/validated.hbs diff --git a/tests/dummy/config/ember-cli-update.json b/test-app/tests/dummy/config/ember-cli-update.json similarity index 100% rename from tests/dummy/config/ember-cli-update.json rename to test-app/tests/dummy/config/ember-cli-update.json diff --git a/tests/dummy/config/ember-try.js b/test-app/tests/dummy/config/ember-try.js similarity index 82% rename from tests/dummy/config/ember-try.js rename to test-app/tests/dummy/config/ember-try.js index 1975f0e0..9d2a53ee 100644 --- a/tests/dummy/config/ember-try.js +++ b/test-app/tests/dummy/config/ember-try.js @@ -1,6 +1,20 @@ 'use strict'; -const getChannelURL = require('ember-source-channel-url'); +// @todo uncomment when https://github.com/emberjs/ember.js/issues/20777 resolved +// const getChannelURL = require('ember-source-channel-url'); +async function getChannelURL(channelType) { + let HOST = + process.env.EMBER_SOURCE_CHANNEL_URL_HOST || 'https://s3.amazonaws.com'; + let PATH = 'builds.emberjs.com'; + + const response = await fetch(`${HOST}/${PATH}/${channelType}.json`); + const result = await response.json(); + + return result.version + .replace('.canary', '') + .replace('.beta', '') + .replace('-release', ''); +} const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup'); module.exports = async function () { @@ -112,6 +126,7 @@ module.exports = async function () { npm: { devDependencies: { 'ember-source': await getChannelURL('beta'), + '@ember/test-helpers': '^4.0.0', }, }, }, @@ -120,6 +135,7 @@ module.exports = async function () { npm: { devDependencies: { 'ember-source': await getChannelURL('canary'), + '@ember/test-helpers': '^4.0.0', }, }, }, diff --git a/tests/dummy/config/environment.js b/test-app/tests/dummy/config/environment.js similarity index 100% rename from tests/dummy/config/environment.js rename to test-app/tests/dummy/config/environment.js diff --git a/tests/dummy/config/optional-features.json b/test-app/tests/dummy/config/optional-features.json similarity index 100% rename from tests/dummy/config/optional-features.json rename to test-app/tests/dummy/config/optional-features.json diff --git a/tests/dummy/config/targets.js b/test-app/tests/dummy/config/targets.js similarity index 100% rename from tests/dummy/config/targets.js rename to test-app/tests/dummy/config/targets.js diff --git a/tests/dummy/public/robots.txt b/test-app/tests/dummy/public/robots.txt similarity index 100% rename from tests/dummy/public/robots.txt rename to test-app/tests/dummy/public/robots.txt diff --git a/tests/helpers/index.js b/test-app/tests/helpers/index.js similarity index 100% rename from tests/helpers/index.js rename to test-app/tests/helpers/index.js diff --git a/tests/index.html b/test-app/tests/index.html similarity index 100% rename from tests/index.html rename to test-app/tests/index.html diff --git a/tests/integration/components/changeset-form-test.js b/test-app/tests/integration/components/changeset-form-test.js similarity index 100% rename from tests/integration/components/changeset-form-test.js rename to test-app/tests/integration/components/changeset-form-test.js diff --git a/tests/integration/components/validated-form-test.js b/test-app/tests/integration/components/validated-form-test.js similarity index 100% rename from tests/integration/components/validated-form-test.js rename to test-app/tests/integration/components/validated-form-test.js diff --git a/tests/integration/helpers/changeset-get-test.js b/test-app/tests/integration/helpers/changeset-get-test.js similarity index 100% rename from tests/integration/helpers/changeset-get-test.js rename to test-app/tests/integration/helpers/changeset-get-test.js diff --git a/tests/integration/helpers/changeset-test.js b/test-app/tests/integration/helpers/changeset-test.js similarity index 100% rename from tests/integration/helpers/changeset-test.js rename to test-app/tests/integration/helpers/changeset-test.js diff --git a/tests/integration/main-test.js b/test-app/tests/integration/main-test.js similarity index 100% rename from tests/integration/main-test.js rename to test-app/tests/integration/main-test.js diff --git a/tests/test-helper.js b/test-app/tests/test-helper.js similarity index 100% rename from tests/test-helper.js rename to test-app/tests/test-helper.js diff --git a/tests/unit/changeset-test.js b/test-app/tests/unit/changeset-test.js similarity index 100% rename from tests/unit/changeset-test.js rename to test-app/tests/unit/changeset-test.js diff --git a/tests/unit/utils/merge-deep-test.js b/test-app/tests/unit/utils/merge-deep-test.js similarity index 100% rename from tests/unit/utils/merge-deep-test.js rename to test-app/tests/unit/utils/merge-deep-test.js diff --git a/types/index.d.ts b/test-app/types/index.d.ts similarity index 100% rename from types/index.d.ts rename to test-app/types/index.d.ts