Skip to content
Draft
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
65 changes: 37 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,42 @@ job_defaults_var: &job_defaults
docker:
- image: cimg/node:22.16.0-browsers

# Yarn cache key
cache_var: &cache_key yarn-packages-v5-{{ .Branch }}-{{ checksum "yarn.lock" }}
# PNPM cache key
cache_var: &cache_key pnpm-packages-v5-{{ .Branch }}-{{ checksum "pnpm-lock.yaml" }}

# Install yarn packages
yarn_install_var: &yarn_install
# Install pnpm
install_pnpm_var: &install_pnpm
run:
name: Yarn Install Packages
# We install deps based on the frozen yarn file, so we know it's always the same
name: Install pnpm
command: |
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn --non-interactive
yarn tutorials:install
corepack enable
corepack prepare pnpm@10.19.0 --activate

# Save yarn cache
# Install pnpm packages
pnpm_install_var: &pnpm_install
run:
name: PNPM Install Packages
# We install deps based on the frozen pnpm file, so we know it's always the same
command: |
pnpm install --frozen-lockfile
pnpm tutorials:install

# Save pnpm cache
save_cache_var: &save_cache
save_cache:
name: Save Yarn Package Cache and Cypress binary
name: Save Pnpm Package Cache and Cypress binary
key: *cache_key
paths:
- ~/.cache/yarn
- ~/.local/share/pnpm/store

# Restore yarn cache
# Restore pnpm cache
restore_cache_var: &restore_cache
restore_cache:
name: Restore Yarn Package Cache
name: Restore Pnpm Package Cache
keys:
- *cache_key
- yarn-packages-v5-master
- yarn-packages-v5
- pnpm-packages-v6-master
- pnpm-packages-v6

# Persist the whole working space so we can share it between jobs
persist_workspace_var: &persist_workspace
Expand Down Expand Up @@ -65,17 +73,18 @@ jobs:
- run:
name: Set NPM global path
command: echo 'prefix = ~/.npm' > ~/.npmrc
- *install_pnpm
- checkout
# The Circle CI caching for yarn takes longer than the yarn install. Removed caching.
# The Circle CI caching for pnpm takes longer than the pnpm install. Removed caching.
# - *restore_cache
- *yarn_install
- *pnpm_install
# - *save_cache
- run:
name: Compile NGXS
command: yarn build
command: pnpm build
- run:
name: Create Pack
command: yarn pack --filename ngxs-core.tgz
command: pnpm pack && mv *.tgz ngxs-core.tgz
- *persist_workspace
- store_artifacts:
path: ngxs-core.tgz
Expand All @@ -87,7 +96,7 @@ jobs:
- *attach_workspace
- run:
name: Run ESLint analyzer
command: yarn nx run-many --target=lint --all --exclude=create-app
command: pnpm nx run-many --target=lint --all --exclude=create-app

unit_tests:
<<: *job_defaults
Expand All @@ -98,7 +107,7 @@ jobs:
- *attach_workspace
- run:
name: Unit Tests
command: yarn nx run-many --target=test --all --configuration=ci --maxWorkers=4
command: pnpm nx run-many --target=test --all --configuration=ci --maxWorkers=4
- store_test_results:
path: coverage/junit
- store_artifacts:
Expand All @@ -115,7 +124,7 @@ jobs:
- *attach_workspace
- run:
name: Integration Tests
command: yarn test:ci:integration
command: pnpm test:ci:integration
- *persist_workspace
- store_artifacts:
path: dist-integration
Expand All @@ -128,7 +137,7 @@ jobs:
- *restore_cache
- run:
name: Run E2E tests
command: yarn test:ci:e2e
command: pnpm test:ci:e2e

integration_ssr_tests:
<<: *job_defaults
Expand All @@ -137,7 +146,7 @@ jobs:
- *restore_cache
- run:
name: Run integration tests for the SSR build application
command: yarn test:ci:integration:ssr
command: pnpm test:ci:integration:ssr

integration_ng21_tests:
<<: *job_defaults
Expand All @@ -146,7 +155,7 @@ jobs:
- browser-tools/install-browser-tools
- run:
name: Run integration tests for ng21 application
command: yarn integration:ng21
command: pnpm integration:ng21
- persist_to_workspace:
root: ~/workspace
paths:
Expand All @@ -158,7 +167,7 @@ jobs:
- *attach_workspace
- run:
name: Test types
command: yarn test:types
command: pnpm test:types

# Publish latest build to npm under the @next tag
publish_dev_build_to_npm:
Expand All @@ -170,7 +179,7 @@ jobs:
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- deploy:
name: Publish development builds to all @ngxs packages
command: yarn publish:dev
command: pnpm publish:dev

# Publish tagged build to npm under the @latest tag
publish_tagged_build_to_npm:
Expand All @@ -182,7 +191,7 @@ jobs:
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- deploy:
name: Publish tagged builds to all @ngxs packages
command: yarn publish:tagged
command: pnpm publish:tagged
#
# Workflow
#
Expand Down
19 changes: 12 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ runs:
shell: bash
run: unset HISTFILE

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: https://registry.npmjs.org
check-latest: true
cache: 'yarn'
cache: 'pnpm'

- name: Configure kernel (increase watchers)
shell: bash
Expand All @@ -55,11 +60,11 @@ runs:
./node_modules
./@ngxs
./integrations/hello-world-ng21/dist-integration
key: ${{ runner.os }}-node-${{ inputs.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}-branch-${{ inputs.github-ref-name }}-sha-${{ inputs.github-sha }}
key: ${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-branch-${{ inputs.github-ref-name }}-sha-${{ inputs.github-sha }}
restore-keys: |
${{ runner.os }}-node-${{ inputs.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}-branch-${{ inputs.github-ref-name }}-sha-
${{ runner.os }}-node-${{ inputs.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}-branch-
${{ runner.os }}-node-${{ inputs.node-version }}-yarn-
${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-branch-${{ inputs.github-ref-name }}-sha-
${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}-branch-
${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-
${{ runner.os }}-

- name: Download ngxs build artifacts
Expand All @@ -71,8 +76,8 @@ runs:

- name: Install project dependencies
shell: bash
run: yarn install --frozen-lockfile --non-interactive
run: pnpm install --frozen-lockfile --non-interactive

- name: Install tutorials dependencies
shell: bash
run: yarn tutorials:install
run: pnpm tutorials:install
6 changes: 3 additions & 3 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
github-sha: ${{ github.event.pull_request.head.sha }}

- name: Build NGXS
run: yarn build
run: pnpm build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
github-sha: ${{ github.event.pull_request.head.sha }}

- name: Run ${{ matrix.script }}
run: yarn nx run-many --target=${{ matrix.script }} --all --configuration=ci --base=${{ env.BASE_REF}} --head=HEAD
run: pnpm nx run-many --target=${{ matrix.script }} --all --configuration=ci --base=${{ env.BASE_REF}} --head=HEAD

- name: Upload coverage results to Qlty
if: ${{ matrix.script == 'test' }}
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
github-sha: ${{ github.event.pull_request.head.sha }}

- name: Run ${{ matrix.script }}
run: yarn ${{ matrix.script }}
run: pnpm ${{ matrix.script }}

- name: Upload an integration test artifact
if: ${{ startsWith( matrix.script, 'integration:' ) }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
github-sha: ${{ github.sha }}

- name: Build NGXS
run: yarn build
run: pnpm build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
github-sha: ${{ github.sha }}

- name: Run ${{ matrix.script }}
run: yarn nx run-many --target=${{ matrix.script }} --configuration=ci --all
run: pnpm nx run-many --target=${{ matrix.script }} --configuration=ci --all

- name: Upload coverage results to Qlty
if: ${{ matrix.script == 'test:ci' }}
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
github-sha: ${{ github.sha }}

- name: Run ${{ matrix.script }}
run: yarn ${{ matrix.script }}
run: pnpm ${{ matrix.script }}

- name: Upload an integration test artifact
if: ${{ startsWith( matrix.script, 'integration:' ) }}
Expand Down Expand Up @@ -162,6 +162,6 @@ jobs:
uses: ./.github/actions/check-build-artifacts

- name: Production release - publish tagged builds to all @ngxs packages
run: yarn publish:tagged
run: pnpm publish:tagged
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
github-sha: ${{ github.sha }}

- name: Build NGXS
run: yarn build
run: pnpm build

- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
github-sha: ${{ github.sha }}

- name: Run ${{ matrix.script }}
run: yarn nx run-many --target=${{ matrix.script }} --configuration=ci --all
run: pnpm nx run-many --target=${{ matrix.script }} --configuration=ci --all

- name: Upload coverage results to Qlty
if: ${{ matrix.script == 'test' }}
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
github-sha: ${{ github.sha }}

- name: Run ${{ matrix.script }}
run: yarn ${{ matrix.script }}
run: pnpm ${{ matrix.script }}

- name: Upload an integration test artifact
if: ${{ startsWith( matrix.script, 'integration:' ) }}
Expand Down Expand Up @@ -164,6 +164,6 @@ jobs:
# uses: ./.github/actions/check-build-artifacts

# - name: Development release - publish development builds to all @ngxs packages
# run: yarn publish:dev
# run: pnpm publish:dev
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Thumbs.db
yarn-error.log
.ng_pkg_build/
package-lock.json
yarn.lock
.cache
migrations.json
.nx/cache
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
'**/*.{ts,js,tsx,jsx,mjs,json,md,mdx,scss,html,yml}': f =>
`yarn nx format:write --files=${f.join(',')}`,
`pnpm nx format:write --files=${f.join(',')}`,
'**/*.{ts,tsx,js,jsx}': 'eslint'
};
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scripts-prepend-node-path=true
engine-strict=false
5 changes: 0 additions & 5 deletions .yarnrc

This file was deleted.

16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ Also chat us up on slack, where we will be more than happy to get you started on
Start by installing all dependencies

```bash
yarn
pnpm install
```

You can then either start develping using TDD

```bash
yarn test
pnpm test
```

Or start the integration app and start playing around

```bash
yarn start
pnpm start
```

## Building
Expand All @@ -64,7 +64,7 @@ Since our library is a combination of the main `@ngxs/store` and the plugins, we
running

```bash
yarn build
pnpm build
```

will create a build for each package in the `builds/` directory.
Expand All @@ -75,23 +75,23 @@ If you want to test out a local build in your own app you can create a global sy

```bash
# build ngxs
yarn build
pnpm build

# cd into the build you want to link
cd builds/store

# create the global symlink
yarn link
pnpm link
```

now navigate to your app then run

```bash
yarn link @ngxs/store
pnpm link @ngxs/store
```

now `node_modules/@ngxs/store` will be symlinked to the local build directory of `@ngxs/store`.
to make a change, save the file in ngxs, run `yarn build` and your app should now be using the new build.
to make a change, save the file in ngxs, run `pnpm build` and your app should now be using the new build.

# Publishing new version

Expand Down
Loading
Loading