Skip to content

Commit a903f6d

Browse files
Merge branch 'main' into cb/copy-task-ignore
2 parents aae1188 + 8a7d89a commit a903f6d

36 files changed

+436
-380
lines changed

package-lock.json

+163-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"eslint-plugin-jsdoc": "^48.0.0",
155155
"eslint-plugin-simple-import-sort": "^12.0.0",
156156
"eslint-plugin-wdio": "^8.24.12",
157-
"execa": "8.0.1",
157+
"execa": "9.3.0",
158158
"exit": "^0.1.2",
159159
"fs-extra": "^11.0.0",
160160
"glob": "10.4.1",
@@ -181,7 +181,7 @@
181181
"semver": "^7.3.7",
182182
"terser": "5.31.1",
183183
"tsx": "^4.10.3",
184-
"typescript": "~5.4.0",
184+
"typescript": "~5.5.3",
185185
"webpack": "^5.75.0",
186186
"ws": "8.17.1"
187187
},

renovate.json5

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
{
5858
// Increment this value as a part of updating TypeScript
5959
matchPackageNames: ['typescript'],
60-
allowedVersions: '<5.5.0',
60+
allowedVersions: '<5.6.0',
6161
commitMessagePrefix: "feat(typescript):"
6262
},
6363
{
@@ -152,7 +152,7 @@
152152
rebaseWhen: 'never',
153153
/**
154154
* Cron syntax to run at midnight (UTC) on the first day of every month
155-
*
155+
*
156156
* Note: Renovate does not support minute value granularity, so the wildcard value is necessary
157157
*/
158158
schedule: ["* 0 1 * *"],

scripts/esbuild/utils/typescript-source.ts

-19
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,6 @@ export async function bundleTypeScriptSource(tsPath: string, opts: BuildOptions)
7474
const jestTypesciptFilename = join(opts.scriptsBuildDir, 'typescript-modified-for-jest.js');
7575
await fs.writeFile(jestTypesciptFilename, code);
7676

77-
// Here we transform the TypeScript source from a commonjs to an ES module.
78-
// We do this so that we can add an import from the `@environment` module.
79-
80-
// trim off the last part that sets module.exports and polyfills globalThis since
81-
// we don't want typescript to add itself to module.exports when in a node env
82-
const tsEnding = `if (typeof module !== "undefined" && module.exports) { module.exports = ts; }`;
83-
84-
if (!code.includes(tsEnding)) {
85-
throw new Error(`"${tsEnding}" not found`);
86-
}
87-
const lastEnding = code.lastIndexOf(tsEnding);
88-
code = code.slice(0, lastEnding);
89-
90-
const o: string[] = [];
91-
o.push(`// TypeScript ${opts.typescriptVersion}`);
92-
o.push(code);
93-
o.push(`export default ts;`);
94-
code = o.join('\n');
95-
9677
// TODO(STENCIL-839): investigate minification issue w/ typescript 5.0
9778
// const { minify } = await import('terser');
9879

scripts/release-tasks.ts

+27-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ import { buildAll } from './build';
55
import { BuildOptions } from './utils/options';
66
import { isPrereleaseVersion, isValidVersionInput, SEMVER_INCREMENTS, updateChangeLog } from './utils/release-utils';
77

8+
/**
9+
* We have to wrap `execa` in a promise to ensure it works with `Listr`. `Listr` uses rxjs under the hood which
10+
* seems to have issues with `execa`'s `ResultPromise` as it never resolves a task.
11+
* @param command command to run
12+
* @param args arguments to pass to the command
13+
* @param options `execa` options
14+
* @returns a promise that resolves with the stdout and stderr of the command
15+
*/
16+
async function execa(command: string, args: string[], options?: any) {
17+
/**
18+
* consecutive imports are cached and don't have an impact on the execution speed
19+
*/
20+
const { execa: execaOrig } = await import('execa');
21+
22+
return new Promise<{ stdout: string; stderr: string }>((resolve, reject) => {
23+
const run = execaOrig(command, args, options);
24+
run.then(
25+
({ stdout, stderr }) =>
26+
resolve({
27+
stdout: stdout as unknown as string,
28+
stderr: stderr as unknown as string,
29+
}),
30+
(err) => reject(err),
31+
);
32+
});
33+
}
34+
835
/**
936
* Runs a litany of tasks used to ensure a safe release of a new version of Stencil
1037
* @param opts build options containing the metadata needed to release a new version of Stencil
@@ -18,8 +45,6 @@ export async function runReleaseTasks(opts: BuildOptions, args: ReadonlyArray<st
1845
const isDryRun = args.includes('--dry-run') || opts.version.includes('dryrun');
1946
let tagPrefix: string;
2047

21-
const { execa } = await import('execa');
22-
2348
if (isDryRun) {
2449
console.log(color.bold.yellow(`\n 🏃‍ Dry Run!\n`));
2550
}

src/compiler/bundle/bundle-output.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const getRollupOptions = (
121121
userIndexPlugin(config, compilerCtx),
122122
typescriptPlugin(compilerCtx, bundleOpts, config),
123123
extFormatPlugin(config),
124-
extTransformsPlugin(config, compilerCtx, buildCtx, bundleOpts),
124+
extTransformsPlugin(config, compilerCtx, buildCtx),
125125
workerPlugin(config, compilerCtx, buildCtx, bundleOpts.platform, !!bundleOpts.inlineWorkers),
126126
serverPlugin(config, bundleOpts.platform),
127127
...beforePlugins,

0 commit comments

Comments
 (0)