Skip to content

Set up shared Prettier configuration from @upfluence/w-conf#22

Merged
phndiaye merged 8 commits into
mainfrom
copilot/setup-prettier-configuration
Apr 1, 2026
Merged

Set up shared Prettier configuration from @upfluence/w-conf#22
phndiaye merged 8 commits into
mainfrom
copilot/setup-prettier-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 5, 2026

Introduces the shared Upfluence Prettier setup (@upfluence/w-conf) with import sorting, replacing the bespoke .prettierrc.

Changes

  • prettier.config.mjs — New ESM config using buildConfiguration from @upfluence/w-conf/prettier, with sortImport scoped to @upfluence/hyperevents
  • package.json — Added @upfluence/w-conf@^0.2.0, @trivago/prettier-plugin-sort-imports@^4.3.0; bumped prettier to ^3.0.0
  • .prettierrc — Deleted (superseded by prettier.config.mjs)
  • .prettierignore — Added pnpm-lock.yaml
  • Reformatted files — Markdown, HBS templates, tsconfig.json, and HTML files updated to match new config output
// prettier.config.mjs
import { buildConfiguration } from '@upfluence/w-conf/prettier';

export default buildConfiguration({
  sortImport: {
    packages: ['@upfluence/hyperevents']
  }
});

What are the observable changes?

Running pnpm prettier --check . will pass. Import order in .js/.ts files is now enforced: Ember/Glimmer internals → third-party → @upfluence/hyperevents → relative.

🧑‍💻 Developer Heads Up

⚡ Since we are using Ember Octane now:

  • Feel free to migrate existing components to Glimmer Components.
  • Write new ones exclusively in it.

Useful Resource : Ember Octane vs Classic Cheat Sheet

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Properly labeled

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/orgs/upfluence/packages/npm/w-conf/versions
    • Triggering command: /usr/bin/curl curl -H Authorization: ****** REDACTED (http block)
    • Triggering command: /usr/bin/curl curl -s -H Authorization: ****** REDACTED (http block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Summary

Set up the shared Prettier configuration from @upfluence/w-conf for this repository, following the same pattern as done in upfluence/identity-web#787 and already present in upfluence/hyperstream.

Changes required

1. Add prettier.config.mjs

Create a new file prettier.config.mjs at the root of the repository with the following content:

import { buildConfiguration } from '@upfluence/w-conf/prettier';

export default buildConfiguration({
  sortImport: {
    packages: ['@upfluence/hyperevents']
  }
});

The package name @upfluence/hyperevents comes from the "name" field in package.json.

2. Update package.json devDependencies

Add the following packages to devDependencies in package.json (they are not currently present):

  • "@upfluence/w-conf": "^0.2.0"
  • "@trivago/prettier-plugin-sort-imports": "^4.3.0"
  • "prettier": "^3.0.0"

3. Run pnpm prettier --write

After adding the config file and installing dependencies, run:

pnpm prettier --write .

Commit all files reformatted by Prettier as part of this PR.

Notes

  • The config file must use ESM syntax (import/export default) — do NOT use require/module.exports
  • The file must be named prettier.config.mjs (not .prettierrc.js or prettier.config.js)
  • Do not add a .prettierrc.js file — this repo doesn't have one to remove, just add the new .mjs config

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: phndiaye <4022350+phndiaye@users.noreply.github.com>
Copilot AI changed the title [WIP] Set up shared Prettier configuration from @upfluence/w-conf Set up shared Prettier configuration from @upfluence/w-conf Mar 5, 2026
Copilot AI and others added 3 commits March 6, 2026 10:04
Co-authored-by: phndiaye <4022350+phndiaye@users.noreply.github.com>
chore: run pnpm prettier **/*.{js,ts,hbs} --write
@phndiaye phndiaye marked this pull request as ready for review March 26, 2026 13:10
@phndiaye phndiaye requested review from a team and Miexil as code owners March 26, 2026 13:10
@phndiaye phndiaye requested review from nathalieArnoux and removed request for a team March 26, 2026 13:10
Copy link
Copy Markdown

@aprentout aprentout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre approved

import { run } from '@ember/runloop';
import { inject as service } from '@ember/service';

import ActivityTracking from '../services/activity-tracking';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question here, isn't it better to do the following ?

Suggested change
import ActivityTracking from '../services/activity-tracking';
import ActivityTracking from '@upfluence/hyperevents/services/activity-tracking';

Copy link
Copy Markdown
Member

@phndiaye phndiaye Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't change anything.
and it's actually better like this and it will also end up being relative imports when we land v2 addon format as the "package name as prefix" is part of Ember's weird magic ^^

@phndiaye phndiaye merged commit 9ccfd6c into main Apr 1, 2026
3 checks passed
@phndiaye phndiaye deleted the copilot/setup-prettier-configuration branch April 1, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants