-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add Angular 16 support & update packages (#450)
Hello, This PR fixes #449. What I did: - I couldn't use `yarn` to run the nx migration so I had to switch to `npm`: - deleted `yarn.lock` - deleted `node_modules` - `npm install` - I executed the nx migration (with `npm`) to `nx 16.1` which also migrated to `Angular 16` - `npx nx migrate latest` - There was nothing related to `Angular 16` migration this time - I did not migrate to standalone nor inject pattern - I then had to update Storybook packages to `7.1.0-alpha.13` to support `Angular 16` + `Typescript 5` before installing the migrated packages - I removed `node_modules` & `package-lock.json` and switched back to `yarn` - then `yarn install` - I applied the migration - `yarn nx migrate --run-migrations` - The migration migrated Storybook to full version 7 - For more information it created `storybook-migration-summary.md` - I had to switch back again to `npm` because `caniuse-lite` wasn't installing properly with `yarn` which caused problem when building - It was missing some files in `caniuse-lite/dist/unpacker` - I updated the `.gitignore` to reflect nx project migration - Properly ignore `reports` folders - I had to explicitly install `core-js` - I also had to update the import in `test.ts` of the lib to `core-js/stable/reflect` - I added `hammerjs` in `allowedCommonJsDependencies` for the demo app - I updated all packages to latest version - I scoped package versions to maximum `patch` - After updating all packages, `caniuse-lite` was installed properly so I switched back to `yarn` 😄 - CI workflow `nodejs` now run on `Node.js 16` and `18` - `Node.js 14` is not compatible anymore with Angular - CI workflow `npm-publish` now run on `Node.js 18` - `actions/setup-node` updated to `v3` on all workflows Problems: - I was not able to fix `component-test` - I was not able to fix `storybook` Note: - Since the repo got moved to nx, it seems that some Typescript eslint rules were removed, if you want to add them back: - For `"files": ["*.ts"]` add `"plugin:@nx/typescript"` in the `"extends": [...]` array - I didn't add it cause I'm not sure how to properly fix all the problems on the project - I removed the unused comments using previous eslint setup (before nx migration) for cypress project (in `commands.ts`) TODO on your side: - Update compatibility array - Release a new major version `8.0.0` - Close branches related to package update
- Loading branch information
Showing
20 changed files
with
4,813 additions
and
8,413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { defineConfig } from 'cypress'; | ||
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; | ||
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
...nxE2EPreset(__dirname), | ||
/** | ||
* TODO(@nrwl/cypress): In Cypress v12,the testIsolation option is turned on by default. | ||
* This can cause tests to start breaking where not indended. | ||
* You should consider enabling this once you verify tests do not depend on each other | ||
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation | ||
**/ | ||
testIsolation: false, | ||
* TODO(@nx/cypress): In Cypress v12,the testIsolation option is turned on by default. | ||
* This can cause tests to start breaking where not indended. | ||
* You should consider enabling this once you verify tests do not depend on each other | ||
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation | ||
**/ | ||
testIsolation: false | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
module.exports = { | ||
core: { builder: 'webpack5' }, | ||
stories: ['../**/*.stories.mdx', '../**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-essentials'] | ||
addons: ['@storybook/addon-essentials'], | ||
framework: { | ||
name: "@storybook/angular", | ||
options: {} | ||
}, | ||
docs: { | ||
autodocs: true | ||
} | ||
}; | ||
|
||
// To customize your webpack configuration you can use the webpackFinal field. | ||
// Check https://storybook.js.org/docs/react/builders/webpack#extending-storybooks-webpack-config | ||
// and https://nx.dev/packages/storybook/documents/custom-builder-configs | ||
// and https://nx.dev/packages/storybook/documents/custom-builder-configs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.