Skip to content

Commit

Permalink
Added dependencies clientlibs to match archetype
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgonzalez committed Jun 13, 2024
1 parent 78a5374 commit fe89ad6
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 89 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:ClientLibraryFolder"
allowProxy="{Boolean}true"
categories="[wknd.dependencies]"
embed="[granite.csrf.standalone]"/>
embed="[granite.csrf.standalone]"
cssProcessor="[default:none,min:none]"
jsProcessor="[default:none,min:none]"
allowProxy="{Boolean}true"/>
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
###############################################################################
# Copyright 2017 Adobe Systems Incorporated
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
#base=css

Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@
###############################################################################
# Copyright 2017 Adobe Systems Incorporated
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
#base=js

136 changes: 79 additions & 57 deletions ui.frontend/clientlib.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,83 @@
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

const path = require('path');
const path = require('path');

const BUILD_DIR = path.join(__dirname, 'dist');
const CLIENTLIB_DIR = path.join(
__dirname,
'..',
'ui.apps',
'src',
'main',
'content',
'jcr_root',
'apps',
'wknd',
'clientlibs'
);

const libsBaseConfig = {
allowProxy: true,
serializationFormat: 'xml',
cssProcessor: ['default:none', 'min:none'],
jsProcessor: ['default:none', 'min:none']
};

// Config for `aem-clientlib-generator`
module.exports = {
context: BUILD_DIR,
clientLibRoot: CLIENTLIB_DIR,
libs: [
{
...libsBaseConfig,
name: 'clientlib-site',
categories: ['wknd.site'],
dependencies: ['wknd.dependencies'],
assets: {
// Copy entrypoint scripts and stylesheets into the respective ClientLib
// directories
js: {
cwd: 'clientlib-site',
files: ['**/*.js'],
flatten: false
},
css: {
cwd: 'clientlib-site',
files: ['**/*.css'],
flatten: false
},

// Copy all other files into the `resources` ClientLib directory
resources: {
cwd: 'clientlib-site',
files: ['**/*.*'],
flatten: false,
ignore: ['**/*.js', '**/*.css']
}
}
}
]
};
const BUILD_DIR = path.join(__dirname, 'dist');
const CLIENTLIB_DIR = path.join(
__dirname,
'..',
'ui.apps',
'src',
'main',
'content',
'jcr_root',
'apps',
'wknd',
'clientlibs'
);

const libsBaseConfig = {
allowProxy: true,
serializationFormat: 'xml',
cssProcessor: ['default:none', 'min:none'],
jsProcessor: ['default:none', 'min:none']
};

// Config for `aem-clientlib-generator`
module.exports = {
context: BUILD_DIR,
clientLibRoot: CLIENTLIB_DIR,
libs: [
/* These embeds and categories can added to clientlib-site below as well */
{
...libsBaseConfig,
name: 'clientlib-dependencies',
categories: ['wknd.dependencies'],
// Add AEM OOTB client libraries as needed
embed: ['granite.csrf.standalone'],
assets: {
// Any any CSS and JS entrypoint scripts and stylesheets into the dependencies
js: {
cwd: 'clientlib-dependencies',
files: ['**/*.js'],
flatten: false
},
css: {
cwd: 'clientlib-dependencies',
files: ['**/*.css'],
flatten: false
}
}
},
{
...libsBaseConfig,
name: 'clientlib-site',
categories: ['wknd.site'],
dependencies: ['wknd.dependencies'],
assets: {
// Copy entrypoint scripts and stylesheets into the respective ClientLib
// directories
js: {
cwd: 'clientlib-site',
files: ['**/*.js'],
flatten: false
},
css: {
cwd: 'clientlib-site',
files: ['**/*.css'],
flatten: false
},

// Copy all other files into the `resources` ClientLib directory
resources: {
cwd: 'clientlib-site',
files: ['**/*.*'],
flatten: false,
ignore: ['**/*.js', '**/*.css']
}
}
}
]
};

0 comments on commit fe89ad6

Please sign in to comment.