Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:

- run: pnpm build

- run: pnpm test:all
- run: pnpm test
32 changes: 9 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
.env
# compiled output
dist/
dist-for-testing/
tmp/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# dependencies
node_modules/

node_modules
dist
dist-ssr
*.local
.eslintcache
.npmrc

# Editor directories and files
.idea
# misc
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env*
.eslintcache
24 changes: 18 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# compiled output
/dist-for-testing/
/tmp/

# dependencies
/node_modules/

# misc
/.DS_Store
/.env*
/.eslintcache
/.git/
/.github/
/.vscode/
/examples/
/src/
/tests/
/.gitignore
/.pnpm-debug.log
/.prettierignore
/.release-it.json
/.release-plan.json
/.vscode/
/src/
/tests/
/tests-vitest/
/CODE_OF_CONDUCT.md
/CONTRIBUTING.md
/RELEASE.md
Expand All @@ -17,6 +30,5 @@
/pnpm-lock.yaml
/pnpm-workspace.yaml
/prettier.config.mjs
/tsconfig.build.json
/tsconfig.json
/tsconfig.lint.json
/vite.config.ts
6 changes: 3 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
pnpm-lock.yaml

# specific to this package
/examples/
/tests/__snapshots__/
/tests/cases/
/tests/fixtures/
/tests-vitest/__snapshots__/
/tests-vitest/cases/
CHANGELOG.md
README.md
RELEASE.md
2 changes: 1 addition & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"tokenRef": "GITHUB_AUTH"
},
"hooks": {
"before:init": ["npm run lint", "npm run test:run"],
"before:init": ["npm run lint", "npm run test"],
"after:bump": "npm run build",
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
}
Expand Down
5 changes: 0 additions & 5 deletions @types/prettier/plugins/estree.d.ts

This file was deleted.

30 changes: 3 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,15 @@ Find me on the [Ember Discord](https://discord.com/invite/emberjs) at `hm_krysta
1. Install dependencies:

```bash
pnpm install --recursive
pnpm install
```

1. Run the tests to ensure your development environment is working properly:

Watch mode:

```bash
pnpm test
```

Single run:

```bash
pnpm test:run
```

Watch mode with a cute UI in the browser:

```bash
pnpm test:ui
```

## Pull Requests

We love pull requests. Here's a quick guide:
Expand Down Expand Up @@ -79,25 +65,15 @@ We love pull requests. Here's a quick guide:

NOTE: Partially copied from https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md

## Examples

1. Follow the [Development](#development) guide above to set up your environment.

1. Edit `example.gjs` or `example.gts` to make the ugliest component file you can think of.

1. Run `pnpm run example` or `pnpm run example-ts` to prettify your ugly file. 😍 (Note that `run example` will also build the project, so it may take a second.)

1. Don't commit your changes to the example files.

## Tests

Most of the tests are generated by formatting example files from the `cases` directory and comparing the output to [Vitest snapshots](https://vitest.dev/guide/snapshot.html).
Most of the tests are generated by formatting example files from the `tests-vitest/cases` directory and comparing the output to [Vitest snapshots](https://vitest.dev/guide/snapshot.html).

To add a new case, add your case file(s) in the appropriate place(s) here: https://github.com/gitKrystan/prettier-plugin-ember-template-tag/tree/main/tests/cases

New cases will be tested against a variety of configs. If you also want to test against for "ambiguous expressions" issues as described [here](https://github.com/gitKrystan/prettier-plugin-ember-template-tag/issues/1), you can include the comment `/*AMBIGUOUS*/` anywhere in your test cases and it will be replaced by the ambiguous cases listed [here](https://github.com/gitKrystan/prettier-plugin-ember-template-tag/tree/main/tests/helpers/ambiguous.ts) in a variety of generated tests. If you find a new ambiguous case, add it to that list.

Once you make your changes and/or add new cases `pnpm test:run -u` to update the snapshots then carefully inspect the results to ensure the output matches your expectations.
Once you make your changes and/or add new cases `pnpm test:vitest -u` to update the snapshots then carefully inspect the results to ensure the output matches your expectations.

## Prior Art and Useful Resources

Expand Down
25 changes: 25 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env sh

ENVIRONMENT=$1

if [ $ENVIRONMENT = "--production" ]
then
# Clean slate
rm -rf "dist"

# Compile TypeScript
tsc --project "tsconfig.build.json"

echo "SUCCESS: Built dist.\n"

elif [ $ENVIRONMENT = "--test" ]
then
# Clean slate
rm -rf "dist-for-testing"

# Compile TypeScript
tsc --project "tsconfig.json"

echo "SUCCESS: Built dist-for-testing.\n"

fi
8 changes: 4 additions & 4 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const customRules = {
rules: {
'jsdoc/check-param-names': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-jsdoc': ['error', { publicOnly: true }],
'jsdoc/require-param': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns': 'off',
Expand Down Expand Up @@ -55,11 +54,12 @@ export default tseslint.config(
{
ignores: [
'dist/',
'dist-for-testing/',
'node_modules/',
'tests-vitest/__snapshots__/',
'tests-vitest/cases/',
'tmp/',
'.*/',
'tests/__snapshots__/',
'tests/cases/',
'vite.config.ts',
],
},
{
Expand Down
117 changes: 0 additions & 117 deletions examples/bin/test.mjs

This file was deleted.

17 changes: 0 additions & 17 deletions examples/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions examples/pnpm-lock.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions examples/prettier.config.mjs

This file was deleted.

Loading