Skip to content

Commit

Permalink
Merge pull request #258 from ReadAlongs/dev.angular-migration-rebased
Browse files Browse the repository at this point in the history
Migrate to Angular 17 / Nx 18
  • Loading branch information
dhdaines authored Apr 10, 2024
2 parents 925d660 + a012032 commit 8d05d19
Show file tree
Hide file tree
Showing 32 changed files with 17,424 additions and 53,862 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -23,12 +23,12 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install everything
run: npm install
- name: Ng test for studio-web
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
- name: Install
run: |
# The default config is for the monorepo, while this is for standalone
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 18
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "20"
- name: Install
run: |
# The default config is for the monorepo, while this is for standalone
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: "https://registry.npmjs.org"
scope: "@readalongs"
- run: npm install
Expand All @@ -32,6 +32,10 @@ jobs:
- run: cd ./packages/web-component && npm version patch
- run: cd ./packages/ngx-web-component && npm version patch
- run: npx nx build web-component && npx nx bundle web-component && npx nx build ngx-web-component
# We have to do this now because nx is broken (see https://github.com/nrwl/nx/issues/19989)
- run: |
export VERSION=$(npm view node_modules/@readalongs/web-component version)
perl -i -lne 'if (/peerDependencies/) {print; print "\"\@readalongs/web-component\": \"'$VERSION'\","} else { print }' dist/packages/ngx-web-component/package.json
- run: |
cd dist/packages/web-component && npm publish --access=public
env:
Expand All @@ -43,7 +47,7 @@ jobs:
- name: Determine tag
id: determine_tag
run: |
echo "TAG_VERSION=$(npm view @readalongs/web-component version)" >> $GITHUB_OUTPUT
echo "TAG_VERSION=$(npm view node_modules/@readalongs/web-component version)" >> $GITHUB_OUTPUT
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ packages/ngx-web-component/**/generated
dist
www
.nx
.python-version
.python-version
*~
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ node_modules/
.angular/
www/
packages/ngx-web-component/**/generated

/.nx/cache
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ tcp 3333`):

npx nx serve web-component

Make sure this command is serving the test data on port 5000:
Make sure this command is serving the test data on port 8941:

npx nx serve-test-data web-component

Expand Down Expand Up @@ -193,7 +193,19 @@ The publication of the web component and its angular wrapper has been automated

WARNING: only use this process if the release workflow is broken.

To publish the web component, first you must belong to the [@readalongs organization](https://www.npmjs.com/org/readalongs) on NPM. Then, bump the version number in both `packages/web-component/package.json` and `packages/ngx-web-component/package.json`, run `npm install` to reflect that bump in `package-lock.json`, and build both the web component and angular wrapper:
To publish the web component, first you must belong to the
[@readalongs organization](https://www.npmjs.com/org/readalongs) on
NPM. Then, bump the version number in both
`packages/web-component/package.json` and
`packages/ngx-web-component/package.json` (note that Nx now
unfortunately no longer manages dependencies among projects properly,
so you must also update the version in `peerDependencies` for
`@readalongs/web-component` in
`packages/ngx-web-component/package.json` - if you find this to be
less than useful feel free to add your voice to [this bug
report](https://github.com/nrwl/nx/issues/19989)), run `npm install`
to reflect that bump in `package-lock.json`, and build both the web
component and angular wrapper:

npx nx build web-component
npx nx build ngx-web-component
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getJestProjects } from "@nrwl/jest";
import { getJestProjects } from "@nx/jest";

export default {
projects: getJestProjects(),
Expand Down
2 changes: 1 addition & 1 deletion jest.preset.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const nxPreset = require("@nrwl/jest/preset").default;
const nxPreset = require("@nx/jest/preset").default;

module.exports = { ...nxPreset };
17 changes: 5 additions & 12 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": []
}
}
},
"defaultBase": "main",
"generators": {
"@nrwl/angular:application": {
"@nx/angular:application": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "none"
},
"@nrwl/angular:library": {
"@nx/angular:library": {
"linter": "eslint",
"unitTestRunner": "jest"
},
"@nrwl/angular:component": {
"@nx/angular:component": {
"style": "css"
}
},
Expand All @@ -30,5 +22,6 @@
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
}
}
},
"useInferencePlugins": false
}
Loading

0 comments on commit 8d05d19

Please sign in to comment.