Skip to content

Commit

Permalink
Merge branch 'main' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
TechSubham authored Dec 12, 2024
2 parents e97097f + 4dff6bd commit 298821e
Show file tree
Hide file tree
Showing 626 changed files with 8,930 additions and 5,135 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ packages/volto-guillotina
dist
packages/registry/lib
packages/registry/docs
apps/rr7/.react-router
Original file line number Diff line number Diff line change
@@ -1,12 +1,49 @@
name: Deployment Tests
name: API-first story Tests
on: [push, pull_request]

env:
node-version: 22.x

jobs:
vitessr:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
config:
runs-on: ubuntu-latest
outputs:
ENVIRONMENT: ${{ steps.vars.outputs.ENVIRONMENT }}
STACK_NAME: ${{ steps.vars.outputs.STACK_NAME }}
nextjs: ${{ steps.filter.outputs.nextjs }}
remix: ${{ steps.filter.outputs.remix }}
rr7: ${{ steps.filter.outputs.rr7 }}
tss: ${{ steps.filter.outputs.tss }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set Env Vars
id: vars
run: |
ENVIRONMENT=${{ vars.LIVE_ENV }}
echo "ENVIRONMENT=${ENVIRONMENT}" >> $GITHUB_OUTPUT
echo "STACK_NAME=${ENVIRONMENT//./-}" >> $GITHUB_OUTPUT
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
nextjs:
- 'apps/nextjs/**'
- '.github/workflows/api-first.yml'
remix:
- 'apps/remix/**'
- '.github/workflows/api-first.yml'
rr7:
- 'apps/rr7/**'
- '.github/workflows/api-first.yml'
tss:
- 'apps/vite-ssr/**'
- '.github/workflows/api-first.yml'
tss:
if: ${{ needs.config.outputs.tss == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
runs-on: ubuntu-latest
name: Vite SSR
timeout-minutes: 5
Expand Down Expand Up @@ -68,7 +105,8 @@ jobs:
run: make backend-docker-detached-stop

nextjs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
# if: ${{ needs.config.outputs.nextjs == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
if: false
runs-on: ubuntu-latest
name: Next.JS
timeout-minutes: 5
Expand Down Expand Up @@ -130,7 +168,7 @@ jobs:
run: make backend-docker-detached-stop

remix:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
if: ${{ needs.config.outputs.remix == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
runs-on: ubuntu-latest
name: Remix
timeout-minutes: 5
Expand Down Expand Up @@ -174,7 +212,63 @@ jobs:
run: pnpm --filter plone-remix build

- name: Start server
run: nohup pnpm --filter plone-remix start:prod &
run: PLONE_API_PATH=http://localhost:8080/Plone nohup pnpm --filter plone-remix start:prod &

- name: Wait
run: packages/scripts/node_modules/.bin/wait-on --httpTimeout 20000 http-get://127.0.0.1:8080/Plone

- name: Run tests
run: node packages/scripts/check_deployment.js

- name: Stop backend
run: make backend-docker-detached-stop

rr7:
if: ${{ needs.config.outputs.rr7 == 'true' }} && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
runs-on: ubuntu-latest
name: ReactRouter 7
timeout-minutes: 5
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4

# node setup
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build dependencies
run: pnpm build:all

- name: Start backend
run: make backend-docker-detached-start

- name: Build
run: pnpm --filter plone-rr7 build

- name: Start server
run: PLONE_API_PATH=http://localhost:8080/Plone nohup pnpm --filter plone-rr7 start:prod &

- name: Wait
run: packages/scripts/node_modules/.bin/wait-on --httpTimeout 20000 http-get://127.0.0.1:8080/Plone
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install towncrier
run: pip install towncrier

- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
Expand All @@ -42,6 +42,12 @@ jobs:
- 'packages/scripts/**'
voltoSlate:
- 'packages/volto-slate/**'
blocks:
- 'packages/blocks/**'
slots:
- 'packages/slots/**'
theming:
- 'packages/theming/**'
wrongNews:
- added|modified: 'news/**'
Expand Down Expand Up @@ -120,6 +126,30 @@ jobs:
env:
BASE_BRANCH: ${{ github.base_ref }}

- name: Blocks changelog check
if: steps.filter.outputs.blocks == 'true'
run: |
git fetch --no-tags origin main
towncrier check --compare-with origin/main --dir packages/blocks
env:
BASE_BRANCH: ${{ github.base_ref }}

- name: Slots changelog check
if: steps.filter.outputs.slots == 'true'
run: |
git fetch --no-tags origin main
towncrier check --compare-with origin/main --dir packages/slots
env:
BASE_BRANCH: ${{ github.base_ref }}

- name: Theming changelog check
if: steps.filter.outputs.theming == 'true'
run: |
git fetch --no-tags origin main
towncrier check --compare-with origin/main --dir packages/theming
env:
BASE_BRANCH: ${{ github.base_ref }}

- name: Wrong location of news changelog check
if: steps.filter.outputs.wrongNews == 'true'
run: echo "News items should be moved from the repository root to the appropriate package root in `packages/package-name`." && exit 1
Expand Down
3 changes: 3 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
dist
docs
node_modules
packages/registry/lib
45 changes: 33 additions & 12 deletions PACKAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,37 @@

This document describes the packages that come with Volto, the default frontend for Plone 6.

These packages are part of Plone's API-first story.
Most of them are experimental and are marked in their respective `README` files.
Plone 6.1.x (Volto 18) depends on:
- `@plone/registry`
- `@plone/scripts`
- `@plone/volto-slate`

and as a development dependency:
- `@plone/types`

Plone 6.0.x (Volto 17 and below) does not use any of them.

These packages are expected to be used and become part of Plone 7.
Some of them might become part of Plone 6.1.x minor versions.

The packages are divided into three categories or types:

- core
- utilities
- add-ons


## `@plone/types`

Plone types is a special development package.
It contains the Plone typings for TypeScript.
It's considered a core package, and it's the only package that the other core packages can rely on as
a `devDependency` in your project configuration.
It's considered a core package, and it's the only package that the other core packages can rely on as a `devDependency` in your project configuration.

This package contains `.d.ts` typing definitions, curated by hand.
Due to the nature of this package, it does not need bundling.
It's published "as is", so you can import the type definitions from anywhere in your code.
Due to the nature of this package, it does not need to be built nor bundled.
It is published "as is", so you can import the type definitions from anywhere in your code.


## Core packages
Expand All @@ -29,12 +49,10 @@ They must be published and bundled in a traditional (transpiled) way.
The bundle of these packages must work on both CommonJS and ECMAScript Module (ESM) environments.


## Utility packages
## Utilities packages

- `@plone/drivers`
- `@plone/helpers`
- `@plone/providers`
- `@plone/rsc`
- `@plone/helpers`


### Rules
Expand All @@ -44,19 +62,22 @@ They must be published in the traditional way, as a bundle.
This bundle must work on both CommonJS and ESM environments.


## Feature packages
## Add-on packages

- `@plone/blocks`
- `@plone/contents`
- `@plone/slots`
- `@plone/theming`
- `@plone/contents`


### Rules

Feature packages, or add-on packages, can depend on any other package.
Add-on or feature packages, can depend on any other package.
You must distribute them as source code, and not transpile them.
They must provide a default configuration registry loader as the default main entry point export.
They must be loadable as any other add-on.
Unlike Volto add-ons, do *NOT* place the code in the `src` folder.
If you do not transpile the package, the direct resolution must work out of the box, where both the bundler and TypeScript resolution are direct.
They must be loadable as any other add-on, and contain an add-on registry compatible `install`-able default export.


## Development utility packages
Expand Down
1 change: 1 addition & 0 deletions apps/remix/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
/build
/public/build
.env
.registry.loader.js
2 changes: 1 addition & 1 deletion apps/remix/app/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ploneClient from '@plone/client';
import config from '@plone/registry';

const cli = ploneClient.initialize({
apiPath: config.settings.apiPath,
apiPath: config.settings.internalApiPath || config.settings.apiPath,
});

export { cli as ploneClient };
28 changes: 14 additions & 14 deletions apps/remix/app/config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import config from '@plone/registry';
import { blocksConfig, slate } from '@plone/blocks';

const settings = {
apiPath: 'http://localhost:8080/Plone',
slate,
};

// @ts-expect-error We need to fix typing
config.set('settings', settings);

// @ts-expect-error We need to fix typing
config.set('blocks', { blocksConfig });

export default config;
import applyAddonConfiguration from '@plone/registry/addons-loader';

export default function install() {
applyAddonConfiguration(config);
config.settings.apiPath =
process.env.PLONE_API_PATH || 'http://localhost:3000';
config.settings.internalApiPath = process.env.PLONE_INTERNAL_API_PATH || '';
console.log('API_PATH is:', config.settings.apiPath);
console.log(
'INTERNAL_API_PATH is:',
config.settings.internalApiPath || 'not set',
);
return config;
}
Loading

0 comments on commit 298821e

Please sign in to comment.