Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mainmatter/ember-intl-analyzer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1.0
Choose a base ref
...
head repository: mainmatter/ember-intl-analyzer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 6,081 additions and 4,867 deletions.
  1. +14 −0 .editorconfig
  2. +0 −3 .eslintignore
  3. +0 −25 .eslintrc.js
  4. +9 −39 .github/workflows/ci.yml
  5. +90 −0 .github/workflows/plan-release.yml
  6. +60 −0 .github/workflows/publish.yml
  7. +3 −5 .gitignore
  8. +171 −22 CHANGELOG.md
  9. +1 −1 LICENSE.md
  10. +155 −24 README.md
  11. +27 −0 RELEASE.md
  12. +0 −176 __snapshots__/test.js.snap
  13. +40 −0 eslint.config.mjs
  14. +298 −74 index.js
  15. +3 −0 jest.config.js
  16. +23 −17 package.json
  17. +4,552 −0 pnpm-lock.yaml
  18. +334 −0 tests/__snapshots__/basic.test.js.snap
  19. +44 −2 test.js → tests/basic.test.js
  20. +7 −0 tests/fixtures/chosen-translations/app/controllers/application.js
  21. +1 −0 tests/fixtures/chosen-translations/app/templates/application.hbs
  22. +1 −0 tests/fixtures/chosen-translations/translations/en.yaml
  23. +3 −0 tests/fixtures/chosen-translations/translations/nl.yaml
  24. +10 −0 tests/fixtures/concat-expression/app/templates/application.hbs
  25. +23 −0 tests/fixtures/concat-expression/translations/en.yaml
  26. 0 {fixtures/missing-translations → tests/fixtures/custom-t-helpers}/app/controllers/application.js
  27. +2 −0 tests/fixtures/custom-t-helpers/app/templates/application.hbs
  28. +5 −0 tests/fixtures/custom-t-helpers/translations/de.json
  29. +4 −0 tests/fixtures/custom-t-helpers/translations/en.json
  30. 0 { → tests}/fixtures/decorators/app/controllers/application.js
  31. 0 { → tests}/fixtures/decorators/translations/en.json
  32. 0 { → tests}/fixtures/embedded-conditionals/app/controllers/application.js
  33. 0 { → tests}/fixtures/embedded-conditionals/app/templates/application.hbs
  34. 0 { → tests}/fixtures/embedded-conditionals/translations/de.json
  35. 0 { → tests}/fixtures/embedded-conditionals/translations/en.json
  36. 0 { → tests}/fixtures/emblem/app/templates/application.emblem
  37. 0 { → tests}/fixtures/emblem/translations/en.json
  38. +7 −0 tests/fixtures/external-addon-translations/app/controllers/application.js
  39. +4 −0 tests/fixtures/external-addon-translations/app/templates/application.hbs
  40. +1 −0 ...fixtures/external-addon-translations/node_modules/@company/scoped-addon/templates/application.hbs
  41. +4 −0 tests/fixtures/external-addon-translations/node_modules/@company/scoped-addon/translations/en.yaml
  42. +1 −0 tests/fixtures/external-addon-translations/node_modules/external-addon/templates/application.hbs
  43. +3 −0 tests/fixtures/external-addon-translations/node_modules/external-addon/translations/en.yaml
  44. +2 −0 tests/fixtures/external-addon-translations/node_modules/other-external-addon/translations/en.yaml
  45. 0 {fixtures/yaml-translations → tests/fixtures/external-addon-translations}/translations/en.yaml
  46. +13 −0 tests/fixtures/first-class-component-templates/app/templates/class-based.gjs
  47. +13 −0 tests/fixtures/first-class-component-templates/app/templates/class-based.gts
  48. +17 −0 tests/fixtures/first-class-component-templates/app/templates/multiple-templates.gjs
  49. +16 −0 tests/fixtures/first-class-component-templates/translations/en.json
  50. +7 −0 tests/fixtures/in-repo-translations/app/controllers/application.js
  51. +2 −0 tests/fixtures/in-repo-translations/app/templates/application.hbs
  52. +7 −0 tests/fixtures/in-repo-translations/lib/in-repo-addon/addon/controllers/addon.js
  53. +3 −0 tests/fixtures/in-repo-translations/lib/in-repo-addon/addon/templates/addon.hbs
  54. +7 −0 tests/fixtures/in-repo-translations/lib/in-repo-addon/app/controllers/application.js
  55. +3 −0 tests/fixtures/in-repo-translations/lib/in-repo-addon/app/templates/application.hbs
  56. +9 −0 tests/fixtures/in-repo-translations/lib/in-repo-addon/translations/en.yaml
  57. +8 −0 tests/fixtures/in-repo-translations/package.json
  58. +4 −0 tests/fixtures/in-repo-translations/translations/en.yaml
  59. +10 −0 tests/fixtures/just-t-func/app/controllers/application.js
  60. +1 −0 tests/fixtures/just-t-func/app/templates/application.hbs
  61. +3 −0 tests/fixtures/just-t-func/translations/de.json
  62. +3 −0 tests/fixtures/just-t-func/translations/en.json
  63. 0 ...-unused-translations-nested → tests/fixtures/missing-translations}/app/controllers/application.js
  64. 0 { → tests}/fixtures/missing-translations/app/templates/application.hbs
  65. 0 { → tests}/fixtures/missing-translations/translations/de.json
  66. 0 { → tests}/fixtures/missing-translations/translations/en.json
  67. +9 −0 tests/fixtures/nested-keys/app/controllers/application.js
  68. +2 −0 tests/fixtures/nested-keys/app/templates/application.hbs
  69. +3 −0 tests/fixtures/nested-keys/translations/foo/bar/de-at.yaml
  70. +3 −0 tests/fixtures/nested-keys/translations/foo/bar/en.yaml
  71. 0 { → tests}/fixtures/no-issues/app/controllers/application.js
  72. +2 −0 tests/fixtures/no-issues/app/templates/application.hbs
  73. 0 { → tests}/fixtures/no-issues/translations/de.json
  74. 0 { → tests}/fixtures/no-issues/translations/en.json
  75. +7 −0 tests/fixtures/plugin-config/app/controllers/application.ts
  76. 0 {fixtures/no-issues → tests/fixtures/plugin-config}/app/templates/application.hbs
  77. +2 −0 tests/fixtures/plugin-config/translations/en.yaml
  78. 0 ...d-translations → tests/fixtures/remove-unused-translations-nested}/app/controllers/application.js
  79. 0 { → tests}/fixtures/remove-unused-translations-nested/app/templates/application.hbs
  80. +5 −0 { → tests}/fixtures/remove-unused-translations-nested/translations/de.json
  81. +5 −0 { → tests}/fixtures/remove-unused-translations-nested/translations/en.json
  82. 0 ...s/unused-translations → tests/fixtures/remove-unused-translations}/app/controllers/application.js
  83. 0 { → tests}/fixtures/remove-unused-translations/app/templates/application.hbs
  84. 0 { → tests}/fixtures/remove-unused-translations/translations/de.json
  85. 0 { → tests}/fixtures/remove-unused-translations/translations/en.json
  86. 0 {fixtures/yaml-translations → tests/fixtures/unused-translations}/app/controllers/application.js
  87. 0 { → tests}/fixtures/unused-translations/app/templates/application.hbs
  88. 0 { → tests}/fixtures/unused-translations/translations/de.json
  89. 0 { → tests}/fixtures/unused-translations/translations/en.json
  90. +3 −0 tests/fixtures/unused-whitelist/app/templates/application.hbs
  91. +3 −0 tests/fixtures/unused-whitelist/translations/en.yaml
  92. +7 −0 tests/fixtures/yaml-translations/app/controllers/application.js
  93. 0 { → tests}/fixtures/yaml-translations/app/templates/application.hbs
  94. 0 { → tests}/fixtures/yaml-translations/translations/de.yaml
  95. +2 −0 tests/fixtures/yaml-translations/translations/en.yaml
  96. +0 −4,479 yarn.lock
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# http://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

[*.{diff,md}]
trim_trailing_whitespace = false
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

48 changes: 9 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,26 @@
name: CI

on:
push:
branches:
- master
- main
- "v*"
tags:
- "v*"
pull_request:
schedule:
- cron: '0 3 * * *' # daily, at 3am
types: [opened, synchronize, reopened]

jobs:
tests:
name: "Tests on Node.js ${{ matrix.node-version }}"
name: 'Tests on Node.js ${{ matrix.node-version }}'
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
node-version: ["10", "12", "14"]
node-version: ['18', '20', '22']

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- run: yarn install
- run: yarn lint
- run: yarn test --coverage

release:
name: Release
runs-on: ubuntu-latest
needs:
- tests

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 10
registry-url: 'https://registry.npmjs.org'

- run: yarn install --frozen-lockfile

- run: npx auto-dist-tag@1 --write

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm install
- run: pnpm lint
- run: pnpm test
90 changes: 90 additions & 0 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Release Plan Review
on:
push:
branches:
- master
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/
types:
- labeled
- unlabeled

concurrency:
group: plan-release # only the latest one of these should ever be running
cancel-in-progress: true

jobs:
check-plan:
name: 'Check Release Plan'
runs-on: ubuntu-latest
outputs:
command: ${{ steps.check-release.outputs.command }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'master'
# This will only cause the `check-plan` job to have a "command" of `release`
# when the .release-plan.json file was changed on the last commit.
- id: check-release
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT

prepare-release-notes:
name: Prepare Release Notes
runs-on: ubuntu-latest
timeout-minutes: 5
needs: check-plan
permissions:
contents: write
issues: read
pull-requests: write
outputs:
explanation: ${{ steps.explanation.outputs.text }}
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
# only run on labeled event if the PR has already been merged
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)

steps:
- uses: actions/checkout@v4
# We need to download lots of history so that
# github-changelog can discover what's changed since the last release
with:
fetch-depth: 0
ref: 'master'
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: 'Generate Explanation and Prep Changelogs'
id: explanation
run: |
set +e
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
if [ $? -ne 0 ]; then
echo 'text<<EOF' >> $GITHUB_OUTPUT
cat release-plan-stderr.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
else
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
rm release-plan-stderr.txt
fi
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

- uses: peter-evans/create-pull-request@v7
with:
commit-message: "Prepare Release using 'release-plan'"
labels: 'internal'
branch: release-preview
title: Prepare Release
body: |
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 👍
-----------------------------------------
${{ steps.explanation.outputs.text }}
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# For every push to the master branch, this checks if the release-plan was
# updated and if it was it will publish stable npm packages based on the
# release plan

name: Publish Stable

on:
workflow_dispatch:
push:
branches:
- master

concurrency:
group: publish-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
check-plan:
name: 'Check Release Plan'
runs-on: ubuntu-latest
outputs:
command: ${{ steps.check-release.outputs.command }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'master'
# This will only cause the `check-plan` job to have a result of `success`
# when the .release-plan.json file was changed on the last commit. This
# plus the fact that this action only runs on main will be enough of a guard
- id: check-release
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT

publish:
name: 'NPM Publish'
runs-on: ubuntu-latest
needs: check-plan
if: needs.check-plan.outputs.command == 'release'
permissions:
contents: write
pull-requests: write
id-token: write
attestations: write

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: npm publish
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
@@ -36,6 +34,9 @@ build/Release
node_modules/
jspm_packages/

# Include node modules used in tests
!fixtures/**/node_modules

# TypeScript v1 declaration files
typings/

@@ -51,9 +52,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

Loading