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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
/package.json export-ignore
/packages/ export-ignore
/phpstan.neon export-ignore
/resources/css/ export-ignore
/resources/js/ export-ignore
/scripts/ export-ignore
/src/web/assets/**/src/ export-ignore
/stubs/ export-ignore
Expand Down Expand Up @@ -60,8 +62,8 @@
/src/web/assets/**/dist/**/*.min.js linguist-generated=true
/src/web/assets/**/dist/**/*.min.js.map linguist-generated=true

# resources/build generated files
/resources/build/**/* linguist-generated=true
# Built CMS assets generated files
/cms-assets/resources/**/* linguist-generated=true

# Auto detect text files and perform LF normalization
* text=auto
51 changes: 0 additions & 51 deletions .github/workflows/build-artifacts.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/sync-cms-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Sync CMS Assets

on:
workflow_dispatch:
push:
branches:
- 6.x
- feature/cms-assets-package
tags:
- '*'

permissions:
contents: read

jobs:
sync:
name: Sync CMS assets
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
tools: composer:v2

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- name: Install Composer dependencies
uses: ramsey/composer-install@v3

- name: Install npm dependencies
run: npm ci

- name: Build assets
run: |
rm -rf cms-assets/resources
npm run build:all

test -f cms-assets/resources/build/manifest.json || { echo "::error::Missing cms-assets/resources/build/manifest.json"; exit 1; }
test -f cms-assets/resources/legacy/cp/dist/cp.js || { echo "::error::Missing cms-assets/resources/legacy/cp/dist/cp.js"; exit 1; }
test -f cms-assets/resources/legacy/cp/dist/css/cp.css || { echo "::error::Missing cms-assets/resources/legacy/cp/dist/css/cp.css"; exit 1; }

- name: Monorepo Split
if: "!startsWith(github.ref, 'refs/tags/')"
uses: danharrin/monorepo-split-github-action@v2.3.0
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
with:
package_directory: 'cms-assets'
repository_organization: 'craftcms'
repository_name: 'cms-assets'
branch: ${{ github.head_ref || github.ref_name }}
user_name: 'shinybrad'
user_email: 'shinybrad@pixelandtonic.com'

- name: Monorepo Split
if: "startsWith(github.ref, 'refs/tags/')"
uses: danharrin/monorepo-split-github-action@v2.3.0
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
with:
tag: ${{ github.ref_name }}
package_directory: 'cms-assets'
repository_organization: 'craftcms'
repository_name: 'cms-assets'
branch: '6.x'
user_name: 'shinybrad'
user_email: 'shinybrad@pixelandtonic.com'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ resources/js/wayfinder
# TypeScript transformer generated files
resources/js/generated/*
!resources/js/generated/.gitkeep

# Built CMS assets
cms-assets/resources/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- It’s now possible to load Blade views within Twig templates. ([#19148](https://github.com/craftcms/cms/pull/19148))
- Craft now registers several Blade directives, bringing near feature parity with Twig templating. ([#19148](https://github.com/craftcms/cms/pull/19148))
- Added SQLite database support. ([#19149](https://github.com/craftcms/cms/pull/19149))
- Control panel resources are now provided by a `craftcms/cms-assets` package. ([#19162](https://github.com/craftcms/cms/pull/19162))
- Renamed `CraftCms\Cms\Twig\PageLifecycle` to `CraftCms\Cms\View\PageLifecycle`. ([#19148](https://github.com/craftcms/cms/pull/19148))
- Renamed `CraftCms\Cms\Twig\TemplateResolver` to `CraftCms\Cms\View\TemplateResolver`. ([#19148](https://github.com/craftcms/cms/pull/19148))
- Fixed a bug where anonymous homepage and fallback site-template requests could bypass offline-site access enforcement. ([#19151](https://github.com/craftcms/cms/pull/19151))
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ If getting into the weeds is your thing, more detail on these pieces is provided

### Control Panel Assets

The assets specific to the control panel live in the `resources` folder. Those are built using a fairly typical Vite setup. To develop assets for the control panel, there are two commands:
The source files specific to the control panel live in the `resources` folder. Production builds are written to the local `cms-assets` package so they can be published through `craftcms/cms-assets`. To develop assets for the control panel, there are two commands:
```shell
# Run the Vite development server
npm run dev
Expand Down
1 change: 1 addition & 0 deletions cms-assets/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/resources/**/* linguist-generated=true
6 changes: 6 additions & 0 deletions cms-assets/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "craftcms/cms-assets",
"description": "Built assets for Craft CMS.",
"license": "proprietary",
"type": "library"
}
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"bacon/bacon-qr-code": "^3.0",
"commerceguys/addressing": "^2.1.1",
"composer/semver": "^3.3.2",
"craftcms/cms-assets": "self.version",
"craftcms/laravel-aliases": "^2.0",
"craftcms/laravel-dependency-aware-cache": "^1.2.3",
"craftcms/laravel-ruleset-validation": "^1.1",
Expand Down Expand Up @@ -95,6 +96,10 @@
{
"type": "path",
"url": "./yii2-adapter"
},
{
"type": "path",
"url": "./cms-assets"
}
],
"suggest": {
Expand Down
23 changes: 21 additions & 2 deletions composer.lock

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

2 changes: 1 addition & 1 deletion packages/craftcms-legacy/admintable/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = getConfig({
output: {
filename: 'js/app.js',
chunkFilename: 'js/[name].js',
path: __dirname + '/../../../resources/legacy/admintable/dist',
path: __dirname + '/../../../cms-assets/resources/legacy/admintable/dist',
},
},
});
4 changes: 3 additions & 1 deletion packages/craftcms-legacy/animationblocker/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ module.exports = getConfig({
name: 'Craft',
type: 'assign-properties',
},
path: __dirname + '/../../../resources/legacy/animationblocker/dist',
path:
__dirname +
'/../../../cms-assets/resources/legacy/animationblocker/dist',
},
},
});
6 changes: 4 additions & 2 deletions packages/craftcms-legacy/authmethodsetup/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ module.exports = getConfig({
config: {
entry: {auth: './auth.js'},
output: {
path: __dirname + '/../../../resources/legacy/authmethodsetup/dist',
}
path:
__dirname +
'/../../../cms-assets/resources/legacy/authmethodsetup/dist',
},
},
});
3 changes: 1 addition & 2 deletions packages/craftcms-legacy/axios/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
const pkgDir = require('pkg-dir');
const path = require('path');


module.exports = getConfig({
context: __dirname,
config: {
output: {
path: __dirname + '/../../../resources/legacy/axios/dist',
path: __dirname + '/../../../cms-assets/resources/legacy/axios/dist',
},
plugins: [
new CopyWebpackPlugin({
Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/codemirror/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = getConfig({
context: __dirname,
config: {
output: {
path: __dirname + '/../../../resources/legacy/codemirror/dist',
path: __dirname + '/../../../cms-assets/resources/legacy/codemirror/dist',
},
plugins: [
new CopyWebpackPlugin({
Expand Down
4 changes: 3 additions & 1 deletion packages/craftcms-legacy/conditionbuilder/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ module.exports = getConfig({
ConditionBuilder: './ConditionBuilder.js',
},
output: {
path: __dirname + '/../../../resources/legacy/conditionbuilder/dist',
path:
__dirname +
'/../../../cms-assets/resources/legacy/conditionbuilder/dist',
},
},
});
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/cp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = getConfig({
cp: './Craft.js',
},
output: {
path: __dirname + '/../../../resources/legacy/cp/dist',
path: __dirname + '/../../../cms-assets/resources/legacy/cp/dist',
},
plugins: [
new Ttf2Woff2Plugin(),
Expand Down
3 changes: 2 additions & 1 deletion packages/craftcms-legacy/craftsupport/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = getConfig({
CraftSupportWidget: './CraftSupportWidget.js',
},
output: {
path: __dirname + '/../../../resources/legacy/craftsupport/dist',
path:
__dirname + '/../../../cms-assets/resources/legacy/craftsupport/dist',
},
plugins: [
new CopyWebpackPlugin({
Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/d3/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = getConfig({
context: __dirname,
config: {
output: {
path: __dirname + '/../../../resources/legacy/d3/dist',
path: __dirname + '/../../../cms-assets/resources/legacy/d3/dist',
},
plugins: [
new CopyWebpackPlugin({
Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/dashboard/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = getConfig({
Dashboard: './Dashboard.js',
},
output: {
path: __dirname + '/../../../resources/legacy/dashboard/dist',
path: __dirname + '/../../../cms-assets/resources/legacy/dashboard/dist',
},
},
});
3 changes: 2 additions & 1 deletion packages/craftcms-legacy/datepickeri18n/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = getConfig({
context: __dirname,
config: {
output: {
path: __dirname + '/../../../resources/legacy/datepickeri18n/dist',
path:
__dirname + '/../../../cms-assets/resources/legacy/datepickeri18n/dist',
},
plugins: [
new CopyWebpackPlugin({
Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/dbbackup/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = getConfig({
config: {
entry: {DbBackupUtility: './DbBackupUtility.js'},
output: {
path: __dirname + '/../../../resources/legacy/dbbackup/dist',
path: __dirname + '/../../../cms-assets/resources/legacy/dbbackup/dist',
},
},
});
4 changes: 3 additions & 1 deletion packages/craftcms-legacy/deprecationerrors/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ module.exports = getConfig({
config: {
entry: {deprecator: './deprecator.js'},
output: {
path: __dirname + '/../../../resources/legacy/deprecationerrors/dist',
path:
__dirname +
'/../../../cms-assets/resources/legacy/deprecationerrors/dist',
},
},
});
3 changes: 2 additions & 1 deletion packages/craftcms-legacy/editsection/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = getConfig({
config: {
entry: {editsection: './editsection.js'},
output: {
path: __dirname + '/../../../resources/legacy/editsection/dist',
path:
__dirname + '/../../../cms-assets/resources/legacy/editsection/dist',
},
},
});
3 changes: 2 additions & 1 deletion packages/craftcms-legacy/edittransform/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module.exports = getConfig({
config: {
entry: {transforms: './transforms.js'},
output: {
path: __dirname + '/../../../resources/legacy/edittransform/dist',
path:
__dirname + '/../../../cms-assets/resources/legacy/edittransform/dist',
},
},
});
Loading
Loading