Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .czvinylrc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bodyFormat: "{body}\n\n\n[[{ticket_id}](https://contentful.atlassian.net/browse/{ticket_id})]"
bodyFormat: "{body}\n \n[[{ticket_id}](https://contentful.atlassian.net/browse/{ticket_id})]"
headerFormat: '{emoji} {type}({scope}): {subject}'
skipScope: false
ticketIdQuestion: 'Enter the JIRA ID'
43 changes: 33 additions & 10 deletions .github/workflows/main-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Main Pipeline

# This is a pre-NX workflow. Everything is checked for format, linting and type safety. Everything
# also requires a build step before each kind of test.
# This is a pre-NX workflow. Packages are checked for format, linting, type safety and unit tests
# are run.
#
# NX integration and/or other optimizations will happen separately.

Expand Down Expand Up @@ -112,12 +112,12 @@ jobs:
path: node_modules
key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm build:all
- run: pnpm build

type-check:
name: Type Check 🔷
runs-on: ubuntu-latest
needs: build
needs: setup
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
Expand All @@ -135,13 +135,12 @@ jobs:
path: node_modules
key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm build:all
- run: pnpm typecheck

lint:
name: Lint 🎨
runs-on: ubuntu-latest
needs: build
needs: setup
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
Expand All @@ -159,15 +158,39 @@ jobs:
path: node_modules
key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm build:all
- run: pnpm lint:check

test:
name: Test 🧪
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build
needs: setup
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- run: pnpm i

- uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm test:unit

e2e:
name: E2E Test 🖥️
runs-on: ubuntu-latest
timeout-minutes: 15
needs: setup
steps:
- uses: docker/setup-compose-action@v1

- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
Expand All @@ -183,5 +206,5 @@ jobs:
path: node_modules
key: ${{ runner.os }}-node-modules-pnpm-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm build:all
- run: pnpm test:unit:all
- run: pnpx playwright install --with-deps
- run: pnpm test:e2e
8 changes: 6 additions & 2 deletions implementations/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./",
"module": "CommonJS",
"noEmit": false,
"outDir": "./dist"
"outDir": "./dist",
"paths": {
"@contentful/optimization-core": ["../../platforms/javascript/core/src/index.ts"],
"@contentful/optimization-node": ["../../platforms/javascript/node/src/index.ts"]
}
},
"include": ["./e2e", "./src"]
}
9 changes: 8 additions & 1 deletion implementations/node/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { defineConfig } from 'vitest/config'
export default defineConfig({
resolve: {
alias: {
'@contentful/optimization-node': path.resolve(__dirname, '../../platforms/javascript/node/'),
'@contentful/optimization-core': path.resolve(
__dirname,
'../../platforms/javascript/core/src/',
),
'@contentful/optimization-node': path.resolve(
__dirname,
'../../platforms/javascript/node/src/',
),
},
},
test: {
Expand Down
6 changes: 3 additions & 3 deletions implementations/web-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"license": "MIT",
"scripts": {
"build": "pnpm clean; pnpm build:sdk",
"build:sdk": "pnpm --filter @contentful/optimization-web build && cp -r ../../platforms/javascript/web/dist ./public/dist",
"build:sdk": "pnpm --filter '../../platforms/javascript/(core|web)' build && cp -r ../../platforms/javascript/web/dist ./public/dist",
"clean": "rimraf ./public/dist ./coverage ./playwright-report ./test-results tsconfig.tsbuildinfo",
"serve": "pnpm build && docker-compose up -d",
"serve:stop": "docker-compose down",
"serve": "pnpm build && docker compose up -d",
"serve:stop": "docker compose down",
"test:e2e": "pnpm serve && playwright test; E2E_RESULT=$?; pnpm serve:stop; exit $E2E_RESULT",
"test:e2e:codegen": "playwright codegen",
"test:e2e:report": "playwright show-report",
Expand Down
10 changes: 7 additions & 3 deletions implementations/web-vanilla/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./",
"module": "CommonJS",
"outDir": "./dist"
"outDir": "./dist",
"paths": {
"@contentful/optimization-core": ["../../platforms/javascript/core/src/index.ts"],
"@contentful/optimization-web": ["../../platforms/javascript/web/src/index.ts"]
}
},
"include": ["./*.ts", "e2e/**/*", "e2e/**/*.json", "src/**/*", "src/**/*.json"]
"include": ["./*.ts", "./e2e", "./src/**/*", "./src/**/*.json"]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"scripts": {
"prepare": "husky",
"build": "pnpm --filter @contentful/* build",
"build:all": "pnpm -r build",
"build:implementations": "pnpm --filter @implementation/* build",
"clean": "pnpm -r --parallel clean",
"docs:generate": "typedoc",
"format:check": "prettier . --check",
"format:fix": "prettier . --check --write",
"lint:check": "eslint .",
"lint:fix": "eslint . --fix",
"test:e2e": "pnpm --filter @implementation/* test:e2e",
"test:unit": "pnpm --filter @contentful/* test:unit",
"test:unit:all": "pnpm -r test:unit",
"test:unit:implementations": "pnpm --filter @implementation/* test:unit",
"typecheck": "pnpm -r typecheck",
"version:node": "node -v",
"version:pnpm": "pnpm -v"
Expand Down
4 changes: 2 additions & 2 deletions platforms/javascript/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"emitDeclarationOnly": true,
"noEmit": false,
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src/**/*", "src/**/*.json"]
"include": ["./src/**/*", "./src/**/*.json"]
}
8 changes: 2 additions & 6 deletions platforms/javascript/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist"
},
"include": ["./*.ts", "src/**/*", "src/**/*.json"]
"extends": "../../../tsconfig.base.json",
"include": ["./src/**/*", "./src/**/*.json"]
}
4 changes: 2 additions & 2 deletions platforms/javascript/node/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"emitDeclarationOnly": true,
"noEmit": false,
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src/**/*", "src/**/*.json"]
"include": ["./src/**/*", "./src/**/*.json"]
}
8 changes: 2 additions & 6 deletions platforms/javascript/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist"
},
"include": ["./*.ts", "src/**/*", "src/**/*.json"]
"extends": "../../../tsconfig.base.json",
"include": ["./src/**/*", "./src/**/*.json"]
}
2 changes: 1 addition & 1 deletion platforms/javascript/node/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineConfig } from 'vitest/config'
export default defineConfig({
resolve: {
alias: {
'@contentful/optimization-core': path.resolve(__dirname, '../core/dist/'),
'@contentful/optimization-core': path.resolve(__dirname, '../core/src/'),
},
},
test: {
Expand Down
4 changes: 2 additions & 2 deletions platforms/javascript/web/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"emitDeclarationOnly": true,
"noEmit": false,
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src/**/*", "src/**/*.json"]
"include": ["./src/**/*", "./src/**/*.json"]
}
8 changes: 2 additions & 6 deletions platforms/javascript/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist"
},
"include": ["./*.ts", "src/**/*", "src/**/*.json"]
"extends": "../../../tsconfig.base.json",
"include": ["./src/**/*", "./src/**/*.json"]
}
2 changes: 1 addition & 1 deletion platforms/javascript/web/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineConfig } from 'vitest/config'
export default defineConfig({
resolve: {
alias: {
'@contentful/optimization-core': path.resolve(__dirname, '../core/dist/'),
'@contentful/optimization-core': path.resolve(__dirname, '../core/src/'),
},
},
test: {
Expand Down
60 changes: 30 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
packages:
- configs/*
- implementations/*
- platforms/javascript/*
- rollup

catalog:
'@playwright/test': ^1.54.0
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading