Skip to content

Commit

Permalink
Merge pull request #1176 from bryceosterhaus/LPS-196042
Browse files Browse the repository at this point in the history
fix(js-toolkit): add warnings for when creating, building, and deploying projects within a liferay workspace
  • Loading branch information
bryceosterhaus authored Oct 2, 2023
2 parents bf0cc56 + eaedc33 commit 4941e1d
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 660 deletions.
4 changes: 0 additions & 4 deletions projects/js-toolkit/packages/js-toolkit-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export {default as Project} from './project/liferayCli/Project';
export {
Bundler2BuildOptions,
CustomElementBuildOptions,
FDSCellRendererBuildOptions,
MinifiableBuildOptions,
ThemeSpritemapBuildOptions,
WebpackBuildOptions,
} from './project/liferayCli/Build';

Expand Down Expand Up @@ -73,8 +71,6 @@ export type {
AnyTypedBuildConfig,
Bundler2BuildConfig,
CustomElementBuildConfig,
FDSCellRendererBuildConfig,
ThemeSpritemapBuildConfig,
TypedBuildConfig,
} from './schema/LiferayJson';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@ import FilePath from '../../file/FilePath';
import LiferayJson, {
Bundler2BuildConfig,
CustomElementBuildConfig,
FDSCellRendererBuildConfig,
ThemeSpritemapBuildConfig,
} from '../../schema/LiferayJson';
import Project from './Project';
import persist, {Location} from './persist';

type BuildType =
| 'bundler2'
| 'customElement'
| 'fdsCellRenderer'
| 'themeSpritemap';
type BuildType = 'bundler2' | 'customElement';

type BuildOptions =
| Bundler2BuildOptions
| CustomElementBuildOptions
| FDSCellRendererBuildOptions
| ThemeSpritemapBuildOptions;
type BuildOptions = Bundler2BuildOptions | CustomElementBuildOptions;

export type Bundler2BuildOptions = MinifiableBuildOptions;

Expand All @@ -34,13 +24,6 @@ export interface CustomElementBuildOptions extends WebpackBuildOptions {
portletCategoryName: string;
}

export type FDSCellRendererBuildOptions = WebpackBuildOptions;

export interface ThemeSpritemapBuildOptions {
enableSVG4Everybody: boolean;
extendClay: boolean;
}

export interface MinifiableBuildOptions {
minify: boolean;
}
Expand Down Expand Up @@ -69,22 +52,6 @@ export default class Build {
);
break;

case 'fdsCellRenderer':
this.type = 'fdsCellRenderer';
this.dir = project.dir.join('build');
this.options = this._toFDSCellRendererBuildOptions(
liferayJson.build?.options
);
break;

case 'themeSpritemap':
this.type = 'themeSpritemap';
this.dir = project.dir.join('build');
this.options = this._toThemeSpriteMapBuildOptions(
liferayJson.build?.options
);
break;

case 'bundler2': {
const {
default: bundler2Project,
Expand Down Expand Up @@ -179,26 +146,6 @@ export default class Build {
};
}

private _toFDSCellRendererBuildOptions(
config: FDSCellRendererBuildConfig
): FDSCellRendererBuildOptions {
const webpackOptions = this._toWebpackBuildOptions(config);

return {
externals: webpackOptions.externals,
minify: webpackOptions.minify,
};
}

private _toThemeSpriteMapBuildOptions(
config: ThemeSpritemapBuildConfig
): ThemeSpritemapBuildOptions {
return {
enableSVG4Everybody: !!config.enableSVG4Everybody,
extendClay: !!config.extendClay,
};
}

private _toBundler2BuildOptions(
_config: Bundler2BuildConfig
): Bundler2BuildOptions {
Expand All @@ -208,7 +155,7 @@ export default class Build {
}

private _toWebpackBuildOptions(
config: CustomElementBuildConfig | FDSCellRendererBuildConfig
config: CustomElementBuildConfig
): WebpackBuildOptions {
const options: WebpackBuildOptions = {
externals: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export default class Dist {
}

case 'customElement':
case 'fdsCellRenderer':
case 'themeSpritemap':
this.dir = project.dir.join('dist');
this.file = this.dir.join(`${project.dir.basename()}.zip`);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/

export type ClientExtensionConfigJsonType =
| 'customElement'
| 'fdsCellRenderer'
| 'themeSpritemap';
export type ClientExtensionConfigJsonType = 'customElement';

export default interface ClientExtensionConfigJson {
[configurationPid: string]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
import type {
Bundler2BuildConfig,
CustomElementBuildConfig,
ThemeSpritemapBuildConfig,
} from './LiferayJson';

export default interface ClientExtensionYaml
extends Bundler2BuildConfig,
CustomElementBuildConfig,
ThemeSpritemapBuildConfig {
CustomElementBuildConfig {
baseURL: string;
description: string;
name: string;
sourceCodeURL: string;
type: 'bundler2' | 'customElement' | 'themeSpritemap';
type: 'bundler2' | 'customElement';
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export default interface LiferayJson {

export type AnyTypedBuildConfig =
| TypedBundler2BuildConfig
| TypedCustomElementBuildConfig
| TypedFDSCellRendererBuildConfig
| TypedThemeSpritemapBuildConfig;
| TypedCustomElementBuildConfig;

export interface TypedBuildConfig {
options: unknown;
Expand All @@ -41,22 +39,3 @@ export interface CustomElementBuildConfig {
htmlElementName?: string;
portletCategoryName?: string;
}

interface TypedFDSCellRendererBuildConfig extends TypedBuildConfig {
options: FDSCellRendererBuildConfig;
type: 'fdsCellRenderer';
}

export interface FDSCellRendererBuildConfig {
externals?: {[bareIdentifier: string]: string} | string[];
}

interface TypedThemeSpritemapBuildConfig extends TypedBuildConfig {
options: ThemeSpritemapBuildConfig;
type: 'themeSpritemap';
}

export interface ThemeSpritemapBuildConfig {
enableSVG4Everybody?: boolean;
extendClay?: boolean;
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4941e1d

Please sign in to comment.