Skip to content

Commit

Permalink
regen files
Browse files Browse the repository at this point in the history
  • Loading branch information
dmail committed Aug 19, 2024
1 parent 86a3536 commit ee2f22f
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 20 deletions.
32 changes: 24 additions & 8 deletions dist/jsenv_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -22116,6 +22116,11 @@ const defaultRuntimeCompat = {
safari: "11.3",
samsung: "9.2",
};
const logsDefault = {
level: "info",
disabled: false,
animation: true,
};

/**
* Generate an optimized version of source files into a directory
Expand Down Expand Up @@ -22154,11 +22159,7 @@ const defaultRuntimeCompat = {
const build = async ({
signal = new AbortController().signal,
handleSIGINT = true,
logLevel = "info",
logs = {
disabled: false,
animation: true,
},
logs = logsDefault,
sourceDirectoryUrl,
buildDirectoryUrl,
entryPoints = {},
Expand Down Expand Up @@ -22208,6 +22209,21 @@ const build = async ({
`${unexpectedParamNames.join(",")}: there is no such param`,
);
}
// logs
{
if (typeof logs !== "object") {
throw new TypeError(`logs must be an object, got ${logs}`);
}
const unexpectedLogsKeys = Object.keys(logs).filter(
(key) => !Object.hasOwn(logsDefault, key),
);
if (unexpectedLogsKeys.length > 0) {
throw new TypeError(
`${unexpectedLogsKeys.join(",")}: no such key on logs`,
);
}
logs = { ...logsDefault, ...logs };
}
sourceDirectoryUrl = assertAndNormalizeDirectoryUrl(
sourceDirectoryUrl,
"sourceDirectoryUrl",
Expand Down Expand Up @@ -22336,7 +22352,7 @@ build ${entryPointKeys.length} entry points`);
};
const rawKitchen = createKitchen({
signal,
logLevel,
logLevel: logs.level,
rootDirectoryUrl: sourceDirectoryUrl,
ignore,
// during first pass (craft) we keep "ignore:" when a reference is ignored
Expand Down Expand Up @@ -22416,7 +22432,7 @@ build ${entryPointKeys.length} entry points`);

const finalKitchen = createKitchen({
name: "shape",
logLevel,
logLevel: logs.level,
rootDirectoryUrl: sourceDirectoryUrl,
// here most plugins are not there
// - no external plugin
Expand Down Expand Up @@ -22741,7 +22757,7 @@ build ${entryPointKeys.length} entry points`);
try {
const result = await runBuild({
signal: operation.signal,
logLevel,
logLevel: logs.level,
});
return result;
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const test = async ({ name, ...params }) => {
const snapshotDirectoryUrl = new URL(`./snapshots/${name}/`, import.meta.url);
const directorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: snapshotDirectoryUrl,
entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const test = async (params) => {
const snapshotDirectoryUrl = new URL(`./snapshots/`, import.meta.url);
const buildDirectorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: snapshotDirectoryUrl,
entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const test = async (params) => {
const snapshotDirectoryUrl = new URL("./snapshots/", import.meta.url);
const buildDirectorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: snapshotDirectoryUrl,
entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const test = async (params) => {
const snapshotDirectoryUrl = new URL("./snapshots/build/", import.meta.url);
const buildDirectorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: snapshotDirectoryUrl,
entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const test = async (params) => {
const snapshotDirectoryUrl = new URL("./snapshots/build/", import.meta.url);
const buildDirectorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: snapshotDirectoryUrl,
entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const test = async (params) => {
const snapshotDirectoryUrl = new URL("./snapshots/build/", import.meta.url);
const buildDirectorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: snapshotDirectoryUrl,
entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const test = async ({ name, ...params }) => {
const snapshotDirectoryUrl = new URL(`./snapshots/${name}/`, import.meta.url);
const buildDirectorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: snapshotDirectoryUrl,
entryPoints: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const countListeners = () => {

const beforeBuild = countListeners();
const buildPromise = build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: new URL("./dist/", import.meta.url),
outDirectoryUrl: new URL("./.jsenv/", import.meta.url),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ const test = async ({ name, ...rest }) => {
);
const buildDirectorySnapshot = takeDirectorySnapshot(snapshotDirectoryUrl);
await build({
logLevel: "warn",
logs: { level: "warn" },
sourceDirectoryUrl: new URL("./client/", import.meta.url),
buildDirectoryUrl: new URL("./dist/", import.meta.url),
entryPoints: {
"./main.html": "main.html",
},
entryPoints: { "./main.html": "main.html" },
versioningMethod: "filename",
// we could just disable bundling to achieve the same result
// but this allows to test versioning with bundling and include param
Expand Down

0 comments on commit ee2f22f

Please sign in to comment.