Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a5d2595
Migrate to pnpm
NullVoxPopuli Mar 15, 2025
a7e4a79
Lockfile
NullVoxPopuli Mar 21, 2025
dfec2f1
Cleanup
NullVoxPopuli Mar 21, 2025
c3c1d00
Remove overrides
NullVoxPopuli Mar 21, 2025
3d62eb2
Lockfile
NullVoxPopuli Mar 21, 2025
49b80e5
Add missing dependencies
NullVoxPopuli Mar 21, 2025
2dc7135
Dep changes, more upgrades
NullVoxPopuli Mar 21, 2025
d060934
Update deps
NullVoxPopuli Mar 21, 2025
cb47a12
A lot more successes
NullVoxPopuli Mar 21, 2025
23b011a
Format
NullVoxPopuli Mar 21, 2025
7b44bd3
Don't include node types in ember projects
NullVoxPopuli Mar 21, 2025
5a237ff
Don't include node types in ember projects
NullVoxPopuli Mar 21, 2025
43d96b4
Our test projects cannot use tsconfigs from the monorepo root, becaus…
NullVoxPopuli Mar 21, 2025
b1cb466
SNAPSHOT UPDATE -- review this carefully
NullVoxPopuli Mar 21, 2025
673bc55
lint:fix
NullVoxPopuli Mar 21, 2025
5fad6e7
Commit the generated-meta because it's easier
NullVoxPopuli Mar 21, 2025
fff0b36
Ensure everything is always comitted, and we don't get diffs in ci
NullVoxPopuli Mar 21, 2025
6e343a0
Update CI
NullVoxPopuli Mar 21, 2025
0247ba9
Specify types for the test-utils
NullVoxPopuli Mar 21, 2025
b4777ef
Resolve some peer dependency issues
NullVoxPopuli Mar 21, 2025
9156858
Try to fix missing glint-monorepo-test-utils
NullVoxPopuli Mar 21, 2025
1ffa77e
Lint:fix
NullVoxPopuli Mar 21, 2025
4b290b1
Define __dirname since it doesn't exist in ESM
NullVoxPopuli Mar 21, 2025
c8dac80
Somehow esmoduleinterop got removed
NullVoxPopuli Mar 21, 2025
b4a0c8f
make a require
NullVoxPopuli Mar 21, 2025
c234ad7
Use require.resolve instead of hard-coded paths
NullVoxPopuli Mar 21, 2025
a84327f
No .js.js
NullVoxPopuli Mar 21, 2025
3bf0f0a
Move types directly into their packages, do not share
NullVoxPopuli Mar 22, 2025
913b360
Not sure if progress or not
NullVoxPopuli Mar 22, 2025
64ae5bb
This is an improvement
NullVoxPopuli Mar 22, 2025
e9c236e
lint:fix
NullVoxPopuli Mar 22, 2025
e5a4915
Set injected on all consuming packages
NullVoxPopuli Mar 22, 2025
a0ce584
Done
NullVoxPopuli Mar 22, 2025
a6a3aa2
Simplify reset script
NullVoxPopuli Mar 22, 2025
392f3bb
Update CONTRIBUTING
NullVoxPopuli Mar 22, 2025
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

dist/
__fixtures__

2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
},
{
"files": ["*.ts", "*.cts", "*.mts"],
"files": ["**/*.{ts,cts,mts}"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
Expand Down
68 changes: 40 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint
- uses: wyvox/action-setup-pnpm@v3

- run: yarn install --frozen-lockfile
- run: yarn lint


# tracking for re-enablement here: https://github.com/typed-ember/glint/issues/728
Expand All @@ -42,29 +43,32 @@ jobs:
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: yarn
# cache: pnpm

# - run: yarn install --frozen-lockfile
# - run: "yarn build"
# - run: "yarn workspaces run test:typecheck"
# - run: "yarn workspaces run test:tsc"
# - uses: pnpm/action-setup@v2
# with:
# version: 10.6.2
# run_install: true
# - run: "pnpm build"
# - run: "pnpm --filter '*' run test:typecheck"
# - run: "pnpm --filter '*' run test:tsc"

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
- run: yarn install --frozen-lockfile
- name: Build
run: yarn build
cache: 'pnpm'
- run: pnpm reset
- name: Run Tests
uses: coactions/setup-xvfb@v1
with:
run: yarn test
run: pnpm test
- uses: wyvox/action-setup-pnpm@v3


# The Windows runner can be super flaky both with Yarn installs and
# when launching browser tests, so we allow for retries in those steps.
Expand All @@ -84,21 +88,23 @@ jobs:
# with:
# max_attempts: 2
# timeout_minutes: 10
# command: yarn install --frozen-lockfile
# command: pnpm install
# - name: Build
# run: yarn build
# run: pnpm build
# - name: Test @glint/core
# uses: nick-fields/retry@v2
# with:
# max_attempts: 2
# timeout_minutes: 20
# command: yarn workspace @glint/core test
# command: pnpm --filter @glint/core test
# - name: Test glint-vscode
# uses: nick-fields/retry@v2
# with:
# max_attempts: 2
# timeout_minutes: 10
# command: yarn workspace glint-vscode test
# command: pnpm --filter glint-vscode test
# - name: Test @glint/scripts
# run: pnpm --filter @glint/scripts test

# tracking for re-enablement here: https://github.com/typed-ember/glint/issues/728
# test-floating-deps:
Expand All @@ -109,14 +115,17 @@ jobs:
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: yarn
# - run: yarn install --no-lockfile
# cache: 'pnpm'
# - uses: pnpm/action-setup@v2
# with:
# version: 10.6.2
# run_install: true
# - name: Build
# run: yarn build
# run: pnpm build
# - name: Run Tests
# uses: coactions/setup-xvfb@v1
# with:
# run: yarn test
# run: pnpm test

# tracking for re-enablement here: https://github.com/typed-ember/glint/issues/728
# test-ts-nightly:
Expand All @@ -127,12 +136,15 @@ jobs:
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: yarn
# - run: yarn install --frozen-lockfile
# - run: yarn add --dev -W typescript@next
# cache: 'pnpm'
# - uses: pnpm/action-setup@v2
# with:
# version: 10.6.2
# run_install: true
# - run: pnpm add -D typescript@next
# - name: Build
# run: yarn build
# run: pnpm build
# - name: Run Tests
# uses: coactions/setup-xvfb@v1
# with:
# run: yarn test
# run: pnpm test
20 changes: 8 additions & 12 deletions .github/workflows/publish-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,17 @@ jobs:
node-version: 18
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'
- name: Locate Yarn Cache
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
cache: 'pnpm'

- uses: pnpm/action-setup@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --frozen-lockfile
version: 10.6.2
run_install: true

# - name: Lint
# run: yarn lint
# run: pnpm lint
- name: Build
run: yarn build
run: pnpm build


- name: set versions
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
yarn-error.log
pnpm-debug.log
.eslintcache
*.tsbuildinfo
*.js.map
Expand Down
80 changes: 80 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
ignore-scripts=true


# Libraries should never have this enabled,
# else we can break consumers
auto-install-peers=false

## Make sure we don't troll ourselves when updating deps
##
verify-deps-before-run=true


## If a dependency is not declared, we do not want to accidentally
## resolve it from the workspace root. This is a common source of
## bugs in monorepos.
##
resolve-peers-from-workspace-root=false

## We use so many similarly grouped peers, we want to make the
## peer-groups easier to distinguish.
## This forces a shorter sha for all groups (vs the default of 1000)
##
peers-suffix-max-length=40
virtual-store-dir-max-length=40

# We don't want to inject *all* dependencies.
# only the ones that are peers.
inject-workspace-packages=false


## This also means we do not want to hoist them to the root
## As this would both expose them to all other packages AND
## results in them using symlinks instead of hardlinks
##
hoist-workspace-packages=false


## We use the `workspace:*` protocol for all workspace
## packages.
## In theory it would be nice to use `deep` here just in case
## we missed something so that we could tell pnpm to use the
## workspace version of a package if it exists. At any depth.
##
## However, it seems that deep/true result in workspace packages
## that are dependencies being symlinked instead of hardlinked
## more often, even at the top-level of a package, which is not
## what we want.
##
link-workspace-packages=false # deep

## Update injected dependencies when needed
## This will rerun after various "build" scripts
## In our published packages.
##
## Unfortunately, this does not run after scripts in
## the monorepo root, so we have added a special "sync"
## script to handle this.
##
sync-injected-deps-after-scripts[]=build
sync-injected-deps-after-scripts[]=sync


## In keeping with our "no hoisting" and "no auto-peers" and
## "isolated dep trees", we also want to avoid other things
## that lead to reliance on hoisting.
## In general, deduping leads to hoisting. This particular
## setting causes direct-dependencies to resolve from the
## workspace root if already in root. We don't want this.
##
dedupe-direct-deps=false

## We do not want to dedupe peer dependencies as this
## results in hoisting and violates optional peer isolation.
##
dedupe-peer-dependents=false

## We do not want to dedupe injected dependencies as this
## results in hoisting and violates optional peer isolation.
##
dedupe-injected-deps=false
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/packages/*/lib
/test-packages/*/lib
dist/
*.yaml
*.yml

# Hidden directories
.*/
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Debug Extension (Glint + TS)",
"type": "extensionHost",
"request": "launch",
// this errors. Run `yarn build` before launching this task
// this errors. Run `pnpm build` before launching this task
// "preLaunchTask": "npm: build",
"autoAttachChildProcesses": true,
"runtimeExecutable": "${execPath}",
Expand Down Expand Up @@ -58,7 +58,7 @@
// },
{
// For this to work, make sure you're runninc `tsc --build --watch` at the root, AND
// `yarn bundle:watch` from within vscode directory.
// `pnpm bundle:watch` from within vscode directory.
"name": "Debug Extension (TS Plugin, .gts)",
"type": "extensionHost",
"request": "launch",
Expand All @@ -77,7 +77,7 @@
},
{
// For this to work, make sure you're runninc `tsc --build --watch` at the root, AND
// `yarn bundle:watch` from within vscode directory.
// `pnpm bundle:watch` from within vscode directory.
"name": "Debug Extension (TS Plugin, ember-app-loose-and-gts)",
"type": "extensionHost",
"request": "launch",
Expand Down
11 changes: 6 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ We welcome contributions to Glint! To help us help you be successful, please fol

## Working on the project

Glint is a family of packages which all live in this repo as a Yarn workspace. To be most successful here, you should:
Glint is a family of packages which all live in this repo as a pnpm workspace. To be most successful here, you should:

- Install [Volta](https://volta.sh), a JavaScript toolchain manager we use to make sure everyone working on the project is using the same versions of Node and Yarn.
- Install [Volta](https://volta.sh), a JavaScript toolchain manager we use to make sure everyone working on the project is using the same versions of Node and pnpm.
- Clone the repo.
- Run `yarn` in the root of the repo to install all the package dependencies. If you have Volta installed, it will automatically fetch and use the correct versions of Node and Yarn for you.
- Run `yarn build` in the root of the repository to build all of the projects the first time. This will make sure that once you start working on one of the packages, you are working with an up to date version of the other packages in the project it depends on.
- Run `pnpm install` in the root of the repo to install all the package dependencies. If you have Volta installed, it will automatically fetch and use the correct versions of Node and pnpm for you.
- Run `pnpm build` in the root of the repository to build all of the projects the first time. This will make sure that once you start working on one of the packages, you are working with an up to date version of the other packages in the project it depends on.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding a comment here in case some docs here might answer my question:

Don't have all the implications of peer deps and pnpm injected dependencies in my head, but I'm wondering what is the particular workflow when working on a workspace that uses injected deps? i.e. if I add or remove a file from one of the packages, what is the mechanism that add/removes that file from all of their referencing packages' node_moduies hard links? Is it a manual mechanism i need to periodically remember to run, or is it tied to some kind of watch script?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added a note to the CONTRIBUTING.md about sync, if needed.

but I'm wondering what is the particular workflow when working on a workspace that uses injected deps? i.e. if I add or remove a file from one of the packages, what is the mechanism that add/removes that file from all of their referencing packages' node_moduies hard links?

the either pnpm build or pnpm sync will update those hard links. This is configured in the .npmrc.

Is it a manual mechanism i need to periodically remember to run, or is it tied to some kind of watch script?

Unfortunately, there is no ability to have syncing in a watch script built in. I made this https://github.com/NullVoxPopuli/pnpm-sync-dependencies-meta-injected, but I don't yet know if it works with pnpm 10, and probably needs some tweaks to read the .npmrc, etc.

For now, the hard-links are synced whenever:

  • pnpm build
  • pnpm sync (a no-op, just syncs)

- Before running tests, you may need to make sure either `pnpm build` ( or `pnpm sync` if you're using `pnpm build --watch` in a separate terminal) is ran. This "installs" the core dependencies into the test packages so that peerDependencies resolve correctly.
- Read the project’s [ARCHITECTURE.md](./ARCHITECTURE.md) to understand the basics of how the code base works.

Once you have made changes and added tests to confirm they work correctly, you can then open a PR and we'll work with you to polish it up and get it landed!
Expand Down Expand Up @@ -53,7 +54,7 @@ These launch configurations can be run via the Run and Debug tab in VSCode.
Firstly, there is an entire suite of integration tests that will spin up instances of VSCode and test out the VSCode Glint extension. These can be run from the `packages/vscode` directory via:

```
yarn run test
pnpm run test
```

Secondly, the Launch Configurations described above (I believe) will run your client-side extension code in debug mode, along with the language server.
Expand Down
9 changes: 8 additions & 1 deletion docs/ember/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ To use Glint with [Ember](https://github.com/emberjs/ember.js) v3.24 or higher,
Read on for a more detailed explanation of each of these steps.

{% tabs %}
{% tab title="pnpm" %}

```sh
pnpm add -D @glint/core @glint/template @glint/environment-ember-loose
```

{% endtab %}
{% tab title="Yarn" %}

```sh
yarn add --dev @glint/core @glint/template @glint/environment-ember-loose
pnpm add -D @glint/core @glint/template @glint/environment-ember-loose
```

{% endtab %}
Expand Down
9 changes: 8 additions & 1 deletion docs/ember/template-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ When adding Glint to an Ember project with `ember-template-imports` installed, t
In addition to the `@glint/core`, `@glint/template` and `@glint/environment-ember-loose` packages, you also need to install the `@glint/environment-ember-template-imports` package and configure it in `tsconfig.json` under `glint.environment`:

{% tabs %}
{% tab title="pnpm" %}

```sh
pnpm add -D @glint/core @glint/template @glint/environment-ember-loose @glint/environment-ember-template-imports
```

{% endtab %}
{% tab title="Yarn" %}

```sh
yarn add --dev @glint/core @glint/template @glint/environment-ember-loose @glint/environment-ember-template-imports
pnpm add -D @glint/core @glint/template @glint/environment-ember-loose @glint/environment-ember-template-imports
```

{% endtab %}
Expand Down
8 changes: 7 additions & 1 deletion docs/with-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ We do mean _identical_: unlike most existing JavaScript projects, you will need
Thus, installation for a JS setup looks like this:

{% tabs %}
{% tab title="pnpm" %}
```shell-session
pnpm add -D typescript @glint/core @glint/template @glint/environment-ember-loose
```
{% endtab %}

{% tab title="Yarn" %}
```shell-session
yarn add --dev typescript @glint/core @glint/template @glint/environment-ember-loose
pnpm add -D typescript @glint/core @glint/template @glint/environment-ember-loose
```
{% endtab %}

Expand Down
Loading
Loading