Skip to content

WRR-14491: Update dev-utils to support Limestone #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# unreleased

* `option-parser`: Set default theme config to `limestone`.
* `SnapshotPlugin`: Added `limestone` support for clearing resource bundle.

# 7.0.0-alpha.3 (January 15, 2025)

* Updated all dependencies to the latest including React 19.
Expand Down
6 changes: 3 additions & 3 deletions option-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const config = {
enact = Object.assign(enact, meta);

// Parse the theme config tree for defaults
config.theme = themeConfig(pkg.path, process.env.ENACT_THEME || enact.theme || 'sandstone');
config.theme = themeConfig(pkg.path, process.env.ENACT_THEME || enact.theme || 'limestone');

// Optional alternate entrypoint for isomorphic builds.
config.isomorphic = computed('isomorphic', enact, config.theme);
Expand Down Expand Up @@ -145,7 +145,7 @@ const config = {
config.additionalModulePaths = computed('additionalModulePaths', enact, config.theme);
config.entry = computed('entry', enact, config.theme);

// Resolve array of screenType configurations. When not found, falls back to any theme preset or sandstone.
// Resolve array of screenType configurations. When not found, falls back to any theme preset or limestone.
const screens = computed('screenTypes', enact, config.theme);
config.screenTypes =
(Array.isArray(screens) && screens) ||
Expand All @@ -161,7 +161,7 @@ const config = {
? riConfig
: config.screenTypes.reduce((r, s) => (s.base && {baseSize: s.pxPerRem}) || r, undefined);

// Resolved filepath to fontGenerator. When not found, falls back to any theme preset or sandstone.
// Resolved filepath to fontGenerator. When not found, falls back to any theme preset or limestone.
const fontGenerator = computed('fontGenerator', enact, config.theme);
config.fontGenerator =
fontGenerator &&
Expand Down
2 changes: 1 addition & 1 deletion plugins/ILibPlugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Allowed values are as follows:

- `ilib`: Custom path to the iLib codebase. Alternatively, a `ILIB_BASE_PATH` environment variable can be set to specify a path. When passed an absoute path, the `emit` option will be set to `false`. Defaults to `node_modules/@enact/i18n/ilib`.
- `resources`: Custom path to the app-level resource bundle. Defaults to `resources`. Can be set to `false` to disable detection/handling of app-level resources.
- `bundles`: Any additional resource bundles to copy to the output directory. Defaults to `[]`. Will automatically add the `@enact/sandstone` ResBundle if detected.
- `bundles`: Any additional resource bundles to copy to the output directory. Defaults to `[]`. Will automatically add the `@enact/limestone` ResBundle if detected.
- `create`: Whether or not to dynamically generate any `ilibmanifest.json` files, if a bundle is missing it. Defaults to `true`.
- `emit`: Whether or not to emit the stock iLib locale assets to the output directory. Defaults to `true`.
- `cache`: Whether or not to cache locale/resource assets and copy emit them if they're newer/changed from source files. Defaults to `true`.
Expand Down
4 changes: 2 additions & 2 deletions plugins/PrerenderPlugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Allowed values are as follows:
- `server`: Virtual DOM server module filepath to use when rendering static HTML. Defaults to `require.resolve('react-dom/server')`.
- `externals`: Local filepath to a directory containing an external enact library bundle js and css files. Only needed if using external Enact framework bundle.
- `deep`: A string or array of string conditions, that when met at runtime, should not display the prerendered HTML.
- `screenTypes`: Array of 1 or more screentype definitions to be used with prerender HTML initialization. See [here](https://github.com/enactjs/sandstone/blob/master/ThemeDecorator/screenTypes.json) for an example of the sandstone screenTypes.
- `fontGenerator`: Module path to a font stylesheet generator for prerendering fontface definitions. See [here](https://github.com/enactjs/sandstone/blob/master/ThemeDecorator/fontGenerator.js) for an example of the sandstone font generator.
- `screenTypes`: Array of 1 or more screentype definitions to be used with prerender HTML initialization. See [here](https://github.com/enactjs/limestone/blob/master/ThemeDecorator/screenTypes.json) for an example of the limestone screenTypes.
- `fontGenerator`: Module path to a font stylesheet generator for prerendering fontface definitions. See [here](https://github.com/enactjs/limestone/blob/master/ThemeDecorator/fontGenerator.js) for an example of the limestone font generator.
- `externalStartup`: A flag whether to externalize the startup javascript normally inlined with prerendered HTML output.

Here's an example webpack config illustrating how to use these options:
Expand Down
2 changes: 1 addition & 1 deletion plugins/SnapshotPlugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SnapshotPlugin {
const filter = lib => (resource, context) => {
return resource.startsWith(lib) && context === ignoreContext;
};
['@enact/i18n', '@enact/moonstone', '@enact/sandstone', '@enact/core/snapshot'].filter(missing).forEach(p => {
['@enact/i18n', '@enact/moonstone', '@enact/sandstone', '@enact/limestone', '@enact/core/snapshot'].filter(missing).forEach(p => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should moonstone needs to be kept in here?

new IgnorePlugin({checkResource: filter(p)}).apply(compiler);
});
// ilib can be aliased to @enact/i18n/ilib, so verify both are missing before ignoring
Expand Down
6 changes: 3 additions & 3 deletions plugins/SnapshotPlugin/snapshot-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');

function handleException(e) {
// We allow 'Cannot find module' errors, which throw when the libraries are not used in the app.
// @enact/i18n, @enact/moonstone, and @enact/sandstone are considered optional dependencies.
// @enact/i18n, @enact/moonstone, @enact/sandstone, and @enact/limestone are considered optional dependencies.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should @enact/moonstone needs to be kept in here?

if (!e.code || e.code !== 'MODULE_NOT_FOUND') {
throw e;
}
Expand Down Expand Up @@ -47,8 +47,8 @@ global.updateEnvironment = function() {
handleException(moonEx);
}
try {
var sandstoneBundle = require('@enact/sandstone/internal/$L');
sandstoneBundle.clearResBundle();
var limestoneBundle = require('@enact/limestone/internal/$L');
limestoneBundle.clearResBundle();
} catch (sandEx) {
handleException(sandEx);
}
Expand Down