Skip to content

Commit

Permalink
Change package ecosystem from yarn to npm (module-federation#906)
Browse files Browse the repository at this point in the history
* chore: switch locks

* Change package ecosystem from yarn to npm and update workflows

This commit updates the package ecosystem from yarn to npm, and modifies the corresponding GitHub Action workflows. Changes are also made in package.json to reflect the shift to npm.

### .github/dependabot.yml

- Change package-ecosystem from 'yarn' to 'npm'

### .github/workflows/on-push.yml

- Replace occurrences of 'yarn.lock' with 'package-lock.json'

- Change yarn install command to npm ci

### .github/workflows/pre-release.yml

- Change yarn cache to npm cache

- Replace yarn install command with npm ci

### .github/workflows/release.yml

- Change yarn cache to npm cache

- Replace yarn install command with npm ci

### package.json

- Remove the 'workspaces' object and replace it with an array of workspaces

* chore: attempt to fix tests

* update locks

* update nx

* fix: update babel config and fix app test (module-federation#922)

* update locks

* update locks

* chore:update locks

* chore:update locks

---------

Co-authored-by: fyodorovandrei <[email protected]>
  • Loading branch information
ScriptedAlchemy and fyodorovandrei authored May 24, 2023
1 parent 4b7bf0b commit 3d7a75e
Show file tree
Hide file tree
Showing 14 changed files with 73,809 additions and 20,724 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "yarn" # See documentation for possible values
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
10 changes: 5 additions & 5 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
id: cache
with:
path: ${{ env.CACHE_NODE_MODULES_PATH }}
key: build-${{ hashFiles('**/yarn.lock') }}
key: build-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
run: npm ci --legacy-peer-deps
- name: Check changes "website"
id: website-changed
run: echo "website-changed=$(node tools/scripts/ci-is-affected.mjs --appName=website --base=${{ env.BASE_REF}} --head=HEAD)" >> $GITHUB_OUTPUT
Expand All @@ -53,7 +53,7 @@ jobs:
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_NODE_MODULES_PATH }}
key: build-${{ hashFiles('**/yarn.lock') }}
key: build-${{ hashFiles('**/package-lock.json') }}
- run: npm run build:website
- run: "npx netlify deploy --build --prod --message \"Deploy from GitHub Actions\""
env:
Expand All @@ -71,11 +71,11 @@ jobs:
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_NODE_MODULES_PATH }}
key: build-${{ hashFiles('**/yarn.lock') }}
key: build-${{ hashFiles('**/package-lock.json') }}
- uses: nelonoel/[email protected]
- run: npm run build:website
- run: "npx netlify deploy --build --message \"Deploy Preview from GitHub Actions\" --alias \"${{ env.BRANCH_NAME }}\""
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_NEXT_PLUGIN_SKIP: true
NETLIFY_NEXT_PLUGIN_SKIP: true
4 changes: 2 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
cache: 'npm'
- name: Setup Git
run: |
git config user.name "GitHub Bot"
git config user.email "[email protected]"
- run: git fetch --no-tags --prune --depth=5 origin main
name: Fetch Main branch
- name: Install packages
run: yarn install --frozen-lockfile
run: npm ci --legacy-peer-deps
- name: Retrieve effected projects
id: effected-projects
run: echo "projects=$($(yarn bin)/nx print-affected --type=lib --select=projects --base=origin/main)" >> $GITHUB_OUTPUT
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
cache: 'npm'
- name: Setup Git
run: |
git config user.name "GitHub Bot"
git config user.email "[email protected]"
- name: Install packages
run: yarn install --frozen-lockfile
run: npm ci --legacy-peer-deps
- name: Lint
shell: bash
run: |
Expand Down
4 changes: 3 additions & 1 deletion apps/reactStorybook/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
}
]
],
"plugins": []
"plugins": [
"@babel/plugin-transform-react-jsx"
]
}
1 change: 1 addition & 0 deletions apps/reactStorybook/src/app/app.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { render } from '@testing-library/react';

import { BrowserRouter } from 'react-router-dom';
Expand Down
17 changes: 4 additions & 13 deletions apps/website/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
"build": {
"executor": "qwik-nx:build",
"options": {
"runSequence": [
"website:build.client",
"website:build.ssr"
],
"runSequence": ["website:build.client", "website:build.ssr"],
"outputPath": "dist/apps/website",
"skipTypeCheck": false
},
Expand Down Expand Up @@ -52,9 +49,7 @@
},
"test": {
"executor": "@nrwl/vite:test",
"outputs": [
"../../coverage/apps/website"
],
"outputs": ["{workspaceRoot}/coverage/apps/website"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/apps/website"
Expand All @@ -77,13 +72,9 @@
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": [
"{options.outputFile}"
],
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/website/**/*.{ts,tsx,js,jsx}"
]
"lintFilePatterns": ["apps/website/**/*.{ts,tsx,js,jsx}"]
}
},
"extract-i18n": {
Expand Down
2 changes: 1 addition & 1 deletion gpt/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ marked.setOptions({
}),
});

module.exports = marked;
module.exports = marked.parse;
20 changes: 20 additions & 0 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"migrations": [
{
"cli": "nx",
"version": "16.2.0-beta.0",
"description": "Remove outputPath from run commands",
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
"package": "nx",
"name": "16.2.0-remove-output-path-from-run-commands"
},
{
"cli": "nx",
"version": "16.2.0-beta.0",
"description": "Remove react-test-renderer from package.json",
"implementation": "./src/migrations/update-16-2-0-remove-package/update-16-2-0-remove-package",
"package": "@nrwl/react",
"name": "update-16-2-0-remove-package"
}
]
}
Loading

0 comments on commit 3d7a75e

Please sign in to comment.