This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<environmentVariables> | |
<NPM_FRONTEND_MODULE_BASE_DIR>${basedir}</NPM_FRONTEND_MODULE_BASE_DIR> | |
</environmentVariables> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<name>Tenant One Package</name> | |
<artifactId>[SOME-ID]</artifactId> | |
<packaging>content-package</packaging> | |
<parent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<workingDirectory>${frontend.build.directory}</workingDirectory> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<name>Our Multitenant Project: Build Reactor POM</name> | |
<groupId>[SOME-ID]</groupId> | |
<artifactId>[SOME-OTHER-ID]</artifactId> | |
<version>[SOME-VERSION]</version> | |
<packaging>pom</packaging> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
"paths": { | |
"conf": "./config", | |
"tasks": "./tasks" | |
}, | |
"scripts": { | |
"build": "npm-run-all --parallel build:*", | |
// you cannot write comments in package.json (or any json, so don't do this! ;) | |
// but to explain this, $npm_package_paths_configs refers to what you have as value in the | |
// paths property up there |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('fast-glob'); | |
const path = require('path'); | |
function collectEntries(config, extension) { | |
// we have called all our js and scss files like this `component-name.entry.js` and `component-name.entry.scss` | |
const pattern = `**/*.entry.${extension}`; | |
// if you take a look at project structure we defined | |
// and the project.paths.conig.js file above, you will see the path to iterate in this case | |
// is the `tenants/tenantN/components/package/src/frontend/components` | |
// since when globbing cwd will be the directory where this file is at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
// this comes from maven env | |
const TENANT = process.env.NPM_FRONTEND_MODULE_BASE_DIR; | |
const TENANT_NAME = TENANT.split('/').reverse()[2]; | |
const TENANT_COMPONENTS = TENANT.substr(0, TENANT.lastIndexOf('/')); | |
const PROJECT_ID = 'project-id'; | |
console.log(`############## FRONTEND BUILD ##############`); | |
console.log(`############## STARTING BUILD FOR TENANT: ${TENANT_NAME} ##############`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
GLOBAL_VENDOR_JS = '', | |
GLOBAL_COMPONENTS = '', | |
TENANT_COMPONENTS = '', | |
} = require('./project.paths.config'); | |
// export alias for JS | |
module.exports = { | |
'global.vendors': GLOBAL_VENDOR_JS, | |
'global.components': GLOBAL_COMPONENTS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/schema", | |
"id": "SchematicsGenerateFilesApp", | |
"title": "Application Options Schema for Angular projects feat Aliased SASS", | |
// the type of the schema object (obviously object!) | |
"type": "object", | |
// the properties of that object | |
"properties": { | |
// name, maps to an option you expect from the command line, flagged --name | |
"name": { |
NewerOlder