Skip to content

Commit

Permalink
build: change package manager (#1109)
Browse files Browse the repository at this point in the history
conflicts of `@types/react` made random outcomes when using `yarn`

since workspace packages uses `workspace^` for resolving, merging should have less friction since only lockfile updates on release

- change package manager from `yarn` to `pnpm`
- remove emotion from `@equinor/fusion-framework-react-components-bookmark`
- update documentation
- update contributing
- update workflows
- update packages
  • Loading branch information
odinr committed Aug 13, 2023
1 parent ecde0ce commit 7ec195d
Show file tree
Hide file tree
Showing 151 changed files with 14,069 additions and 21,315 deletions.
46 changes: 46 additions & 0 deletions .changeset/beige-ducks-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
'@equinor/fusion-framework-cookbook-app-react-bookmark-advanced': patch
'@equinor/fusion-framework-module-service-discovery': patch
'@equinor/fusion-framework-react-components-bookmark': patch
'@equinor/fusion-framework-react-module-bookmark': patch
'@equinor/fusion-framework-legacy-interopt': patch
'@equinor/fusion-framework-react-module-context': patch
'@equinor/fusion-framework-react-module-signalr': patch
'@equinor/fusion-framework-react-module': patch
'@equinor/fusion-framework-cookbook-app-react-bookmark': patch
'@equinor/fusion-framework-react-module-event': patch
'@equinor/fusion-framework-cookbook-app-react-ag-grid': patch
'@equinor/fusion-framework-cookbook-app-react-context': patch
'@equinor/fusion-framework-module-navigation': patch
'@equinor/fusion-framework-react-module-http': patch
'@equinor/fusion-framework-cookbook-app-react-module': patch
'@equinor/fusion-framework-cookbook-app-react-people': patch
'@equinor/fusion-framework-cookbook-app-react-router': patch
'@equinor/fusion-framework-module-telemetry': patch
'@equinor/fusion-framework-module-bookmark': patch
'@equinor/fusion-framework-module-services': patch
'@equinor/fusion-observable': patch
'@equinor/fusion-framework-module-ag-grid': patch
'@equinor/fusion-framework-module-context': patch
'@equinor/fusion-framework-module-signalr': patch
'@equinor/fusion-framework-react': patch
'@equinor/fusion-framework-module': patch
'@equinor/fusion-framework-module-widget': patch
'@equinor/fusion-framework-module-event': patch
'@equinor/fusion-framework-module-http': patch
'@equinor/fusion-framework-module-msal': patch
'@equinor/fusion-framework-module-app': patch
'@equinor/fusion-query': patch
'@equinor/fusion-framework-cookbook-app-react': patch
'@equinor/fusion-framework': patch
'@equinor/fusion-framework-react-app': patch
'@equinor/fusion-framework-widget': patch
'@equinor/fusion-framework-app': patch
'@equinor/fusion-framework-cli': patch
---

Change packaged manager from yarn to pnpm

conflicts of `@types/react` made random outcomes when using `yarn`

this change should not affect consumer of the packages, but might conflict dependent on local package manager.
9 changes: 9 additions & 0 deletions .changeset/silent-carrots-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@equinor/fusion-framework-react-components-bookmark': minor
---

Removed emotion styling

issues whit conflicting package when using 3x jss frameworks (mui, styled-components, emotion)

_this might break jss class generation front-end, since classnames changes_
9 changes: 7 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
.vscode
node_modules

*.Dockerfile

**/node_modules

packages/*/lib
packages/*/dist
packages/**/bin
packages/**/lib
packages/**/dist

!packages/**/src/**
8 changes: 5 additions & 3 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
with:
ref: docs

- uses: pnpm/action-setup@v2

- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -43,14 +45,14 @@ jobs:
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-18-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-18-${{ hashFiles('**/pnpm-lock.yml') }}

- name: Install Node Dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Build project
run: |
yarn build
npm run build
touch ../docs/.nojekyll
- name: Config git user
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches:
- 'changeset-release/*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
eslint:
runs-on: ubuntu-latest
Expand All @@ -20,38 +24,40 @@ jobs:
with:
fetch-depth: '0'

- uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
cache: 'yarn'
cache: 'pnpm'

- name: restore node_modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.version }}-${{ hashFiles('**/yarn.lock') }}
# - name: restore node_modules
# uses: actions/cache@v3
# with:
# path: '**/node_modules'
# key: ${{ runner.os }}-${{ matrix.version }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install Node Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

# Cookbooks require CLI to be build for linking
- name: Build CLI
run: |
yarn workspace @equinor/fusion-framework-cli build
lerna exec --scope @equinor/fusion-framework-cli npm link
pnpm --filter @equinor/fusion-framework-cli... build
pnpm install --offline --frozen-lockfile
- name: Build project [dependabot]
if: ${{ github.actor == 'dependabot[bot]' }}
run: yarn build
run: pnpm build

- name: Build project [affected]
if: ${{ github.actor != 'dependabot[bot]' }}
run: yarn nx affected:build --base=remotes/origin/main
run: pnpm nx affected:build --base=remotes/origin/main

- name: Save Code Linting Report JSON
if: ${{ github.actor != 'dependabot[bot]' && matrix.version == 18 }}
run: yarn lint:report
run: pnpm lint:report

- name: Annotate Code Linting Results
if: ${{ github.actor != 'dependabot[bot]' && matrix.version == 18 }}
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ jobs:
git config --global user.name "${{ github.actor }}[bot]"
git config --global user.email "${{ github.actor }}[bot]@users.noreply.github.com"
- uses: pnpm/action-setup@v2

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'

- name: restore node_modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-18-${{ hashFiles('**/yarn.lock') }}
# - name: restore node_modules
# uses: actions/cache@v3
# with:
# path: '**/node_modules'
# key: ${{ runner.os }}-18-${{ hashFiles('**/pnpm-lock.yml') }}

- name: Install Dependencies
run: yarn --silent --frozen-lockfile
run: pnpm --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand All @@ -42,8 +44,8 @@ jobs:
title: '🤖 Bip Bop - Fusion Framework Release'
createGithubReleases: true
setupGitUser: false
version: yarn changeset:version
publish: yarn changeset publish
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ dist
tmp/

package-lock.json

packages/**/yarn.lock
**/src/version.ts

Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint:staged
pnpm lint:staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Your commits should adhere to [conventional commit specification](https://www.co

__Before open a new PR:__

- make sure the the code build `yarn build`
- make sure the code lints `yarn lint`
- make sure the the code build `pnpm build`
- make sure the code lints `pnpm lint`

When you're finished with the changes, create a pull request.
- Select a matching pull request template.
Expand Down
20 changes: 20 additions & 0 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG NODE_VERSION=lts-alpine
FROM node:${NODE_VERSION}

WORKDIR /app

RUN apk add --update --no-cache curl python3 make g++
RUN curl -L https://unpkg.com/@pnpm/self-installer | node

COPY pnpm-lock.yaml ./
RUN pnpm fetch

COPY . .

RUN pnpm i --frozen-lockfile


RUN pnpm lint
RUN pnpm --filter @equinor/fusion-framework-cli... build
RUN pnpm i --offline --frozen-lockfile
RUN pnpm build
2 changes: 1 addition & 1 deletion contributing/changeset.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HOW a consumer should update their code
### Creating from shell

```sh
yarn changeset
pnpm changeset
```

### From Bot
Expand Down
2 changes: 1 addition & 1 deletion contributing/cookbooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ see [development](./development.md) for initial setup
### Running an existing cookbook
```sh
cd cookbooks/app-react
yarn dev
pnpm dev
```

### Creating a new cookbook
Expand Down
4 changes: 2 additions & 2 deletions contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Once you've installed Node.js (which includes the popular `npm` package manager)
# clone repo
git clone https://github.com/equinor/fusion-framework
# install packages
yarn
pnpm install
# build all packages
yarn build
pnpm build
```

## Repo structure
Expand Down
12 changes: 12 additions & 0 deletions contributing/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Documentation

contribute to the documentation

@TODO - add more content of how to use vue-press / docusaurus

```sh
cd vue-press
# note doc deps are not installed
npm install
npm run dev
```
2 changes: 1 addition & 1 deletion cookbooks/app-react-ag-grid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"rootDir": "src",
"baseUrl": "src",

"jsx": "react-jsxdev",
},
"include": [
Expand Down
Loading

0 comments on commit 7ec195d

Please sign in to comment.