Skip to content

Commit

Permalink
chore: auto update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 2, 2024
1 parent b97ae50 commit 81af2c1
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 21 deletions.
10 changes: 7 additions & 3 deletions HOW-TO.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ For `liferay-sample-etc-cron` and `liferay-sample-etc-spring-boot` the third typ

- *liferay-sample-global-css*

Serve global CSS on a page.
Add a global CSS to a page.

- *liferay-sample-global-js*
- *liferay-sample-global-js-1*

Serve global JavaScript on a page.
Add a global script element to a page.

- *liferay-sample-global-js-2*

Add a global script element with attributes to a page.

- *liferay-sample-iframe-1*

Expand Down
2 changes: 1 addition & 1 deletion liferay-sample-commerce-checkout-step/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Liferay Sample Commerce Checkout Step",
"name": "@liferay/liferay-sample-commerce-checkout-step",
"type": "module",
"version": "1.0.0",
"version": "0.0.0",
"workspaces": [
"src/main/resources/assets/liferay-sample-commerce-checkout-step"
]
Expand Down
2 changes: 1 addition & 1 deletion liferay-sample-custom-element-react-clayui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"scripts": {
"build": "webpack"
},
"version": "0.1.0"
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion liferay-sample-custom-element-react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"build": "webpack",
"start": "webpack-dev-server"
},
"version": "0.1.0"
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion liferay-sample-custom-element-react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"start": "react-scripts start",
"test": "react-scripts test --passWithNoTests --watchAll=false"
},
"version": "0.1.0"
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion liferay-sample-custom-element-vanilla-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"scripts": {
"build": "webpack"
},
"version": "0.1.0"
"version": "0.0.0"
}
3 changes: 2 additions & 1 deletion liferay-sample-etc-frontend-shared-import-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"scripts": {
"build": "webpack",
"start": "webpack-dev-server"
}
},
"version": "0.0.0"
}
2 changes: 1 addition & 1 deletion liferay-sample-etc-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"start": "node app.js"
},
"type": "module",
"version": "1.0.0"
"version": "0.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import fetch from 'node-fetch';
import config from './configTreePath.js';
import {logger} from './logger.js';

const domains = config['com.liferay.lxc.dxp.domains'];
const domains = config['com.liferay.lxc.dxp.domains'].split('\n');
const externalReferenceCode = config[
'liferay.oauth.application.external.reference.codes'
].split(',')[0];
Expand All @@ -23,9 +23,9 @@ const uriPath =

const oauth2JWKSURI = `${lxcDXPServerProtocol}://${lxcDXPMainDomain}${uriPath}`;

const allowList = domains
.split(',')
.map((domain) => `${lxcDXPServerProtocol}://${domain}`);
const allowList = domains.map(
(domain) => `${lxcDXPServerProtocol}://${domain}`
);

const corsOptions = {
origin(origin, callback) {
Expand Down
2 changes: 1 addition & 1 deletion liferay-sample-global-css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"scripts": {
"build": "webpack"
},
"version": "0.1.0"
"version": "0.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/

window.alert('Sample Global JS deployed.');
window.alert('Sample Global JS 1 deployed.');
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
assemble:
- from: build/static
into: static
liferay-sample-global-js:
name: Liferay Sample Global JS
liferay-sample-global-js-1:
name: Liferay Sample Global JS 1
type: globalJS
url: global.*.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"webpack": "5.90.1",
"webpack-cli": "5.1.4"
},
"name": "@liferay/liferay-sample-global-js",
"name": "@liferay/liferay-sample-global-js-1",
"private": true,
"scripts": {
"build": "webpack"
},
"version": "0.1.0"
"version": "0.0.0"
}
File renamed without changes.
6 changes: 6 additions & 0 deletions liferay-sample-global-js-2/assets/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/

window.alert('Sample Global JS 2 deployed.');
12 changes: 12 additions & 0 deletions liferay-sample-global-js-2/client-extension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
assemble:
- from: build/static
into: static
liferay-sample-global-js-2:
name: Liferay Sample Global JS 2
scriptElementAttributes:
async: true
data-attribute: "value"
data-senna-track: "permanent"
fetchpriority: "low"
type: globalJS
url: global.*.js
12 changes: 12 additions & 0 deletions liferay-sample-global-js-2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"devDependencies": {
"webpack": "5.90.1",
"webpack-cli": "5.1.4"
},
"name": "@liferay/liferay-sample-global-js-2",
"private": true,
"scripts": {
"build": "webpack"
},
"version": "0.0.0"
}
29 changes: 29 additions & 0 deletions liferay-sample-global-js-2/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/

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

const DEVELOPMENT = process.env.NODE_ENV === 'development';

module.exports = {
devtool: DEVELOPMENT ? 'source-map' : false,
entry: {
global: './assets/global.js',
},
mode: DEVELOPMENT ? 'development' : 'production',
optimization: {
minimize: !DEVELOPMENT,
},
output: {
filename: '[name].[contenthash].js',
path: path.resolve('build', 'static'),
},
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
],
};
2 changes: 1 addition & 1 deletion liferay-sample-js-import-maps-entry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"scripts": {
"build": "webpack"
},
"version": "0.1.0"
"version": "0.0.0"
}

0 comments on commit 81af2c1

Please sign in to comment.