Skip to content

Commit

Permalink
Merge pull request #39 from quatico-solutions/replaces-yarn-with-pnpm
Browse files Browse the repository at this point in the history
Replaces yarn with pnpm, update dependencies, extract webpack-test package.
  • Loading branch information
maur-o authored Apr 16, 2024
2 parents d39f9e6 + 4b21959 commit 0726f5b
Show file tree
Hide file tree
Showing 76 changed files with 7,200 additions and 10,368 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
["@quatico/websmith-api", __dirname + "/packages/api/src"],
["@quatico/websmith-compiler", __dirname + "/packages/compiler/src"],
["@quatico/websmith-core", __dirname + "/packages/core/src"],
["@quatico/websmith-webpack", __dirname + "/packages/webpack/src"],
],
extensions: [".ts", ".js", ".jsx", ".json"],
},
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/protect-stable.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This workflow will run tests using node whenever a commit is pushed to develop or main
# For more information see: https://docs.github.com/en/actions/using-workflows/about-workflows

name: CI
name: CI

on:
push:
# List all branches that shall be tested and are not protected by requiring pull requests to commit to.
# List all branches that shall be tested and are not protected by requiring pull requests to commit to.
branches:
- "develop"
- "main"
Expand All @@ -15,24 +15,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: setup
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8

- name: install
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: lint
run: yarn lint
run: pnpm lint

- name: test
run: yarn test
run: pnpm test

- name: build
run: yarn build
run: pnpm build

- name: E2E tests
run: yarn test:e2e
run: pnpm test:e2e
59 changes: 31 additions & 28 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
# This workflow will run the distribution steps using node when a pull request is created or updated
# For more information see: https://docs.github.com/en/actions/using-workflows/about-workflows

name: PR Continuous Integration
name: PR Continuous Integration

on:
pull_request:
types: [opened, reopened, synchronize]
pull_request:
types: [opened, reopened, synchronize]

jobs:
dist:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: setup
uses: actions/setup-node@v3
with:
node-version: 16

- name: install
run: yarn install --frozen-lockfile

- name: lint
run: yarn lint

- name: test
run: yarn test

- name: build
run: yarn build

- name: E2E tests
run: yarn test:e2e
dist:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
with:
version: 8

- name: install
run: pnpm install --frozen-lockfile

- name: lint
run: pnpm lint

- name: test
run: pnpm test

- name: build
run: pnpm build

- name: E2E tests
run: pnpm test:e2e
103 changes: 53 additions & 50 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,58 @@
name: Create release and publish npm package

on:
push:
tags:
- 'v*'
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup environment
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
scope: '@quatico'

- name: install
run: yarn install --frozen-lockfile

- name: lint
run: yarn lint

- name: test
run: yarn test

- name: build
run: yarn build

- name: E2E tests
run: yarn test:e2e

- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
with:
changelog_file: Release-Notes.md

- name: create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
env:
# The workflow permissions of the project must be updated to 'Workflows have read and write permissions in the repository for all scopes'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: publish
run: yarn publish-npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup environment
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
scope: "@quatico"
- uses: pnpm/action-setup@v3
with:
version: 8

- name: install
run: pnpm install --frozen-lockfile

- name: lint
run: pnpm lint

- name: test
run: pnpm test

- name: build
run: pnpm build

- name: E2E tests
run: pnpm test:e2e

- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
with:
changelog_file: Release-Notes.md

- name: create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
env:
# The workflow permissions of the project must be updated to 'Workflows have read and write permissions in the repository for all scopes'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: publish
run: pnpm publish-npm
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 @@ -19,6 +19,7 @@ packages/test/test-source
.env.test.local
.env.production.local
.nx-cache
.nx

# intellij
.idea/*
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ An addon can also access all processed source files as whole and reason about th

### Installation

Install the following packages to add websmith to your TypeScript project. For example, execute the following command in your command line environment using `yarn`:
Install the following packages to add websmith to your TypeScript project. For example, execute the following command in your command line environment using `pnpm`:

```bash
yarn add typescript @quatico/websmith-compiler @quatico/websmith-api --dev
pnpm add typescript @quatico/websmith-compiler @quatico/websmith-api --dev
```

### Add websmith to package.json
Expand All @@ -46,7 +46,7 @@ In your package.json, add the `websmith` command as your build target to the `sc
The default configuration uses your `tsconfig.json` file to compile the TypeScript files and looks for compiler addons in the `./addons` directory.

```bash
yarn build
pnpm build
```

## Custom compiler addons
Expand Down
10 changes: 2 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,20 @@ module.exports = {
"@quatico/websmith-compiler": "<rootDir>/packages/compiler/src",
"@quatico/websmith-core": "<rootDir>/packages/core/src",
},
preset: "ts-jest",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
testRegex: "src/.*(test|spec)\\.(tsx?)$",
testEnvironmentOptions: { url: "http://localhost/" },
transform: {
"^.+\\.(js|ts)$":[
"^.+\\.(js|ts)$": [
"@swc/jest",
{
jsc: {
parser: {
syntax: "typescript",
},
transform: {
react: {
runtime: "automatic",
},
},
},
},
]
],
},
transformIgnorePatterns: ["node_modules"],
resetMocks: true,
Expand Down
5 changes: 0 additions & 5 deletions lerna.json

This file was deleted.

5 changes: 3 additions & 2 deletions license-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
"**/.gitignore",
"**/.prettierrc",
"**/*.iml",
"yarn.lock",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"**/*.graffle",
"**/.gitkeep",
"**/.build",
"**/test-data",
"**/__data__"
]
}
}
Loading

0 comments on commit 0726f5b

Please sign in to comment.