Skip to content

Commit 3734d9f

Browse files
authored
Merge pull request #1996 from embroider-build/merge-stable
Merge stable into main
2 parents ee5e024 + 3a3a078 commit 3734d9f

File tree

12 files changed

+2740
-3432
lines changed

12 files changed

+2740
-3432
lines changed

.github/actions/setup/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
name: Install pnpm
2121
- uses: actions/setup-node@v4
2222
with:
23-
node-version: 16
23+
node-version: 20
2424
cache: pnpm
2525
- run: pnpm install ${{ fromJSON('{"false":"--no-lockfile", "true":"--frozen-lockfile"}')[inputs.use_lockfile] }}
2626
shell: bash

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
- uses: ./.github/actions/setup
5050
with:
5151
use_lockfile: false
52+
- name: Work around windows short path alias # https://github.com/actions/runner-images/issues/712
53+
if: runner.os == 'Windows'
54+
run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
5255
- name: suite
5356
run: ${{ matrix.command }}
5457
working-directory: ${{ matrix.dir }}

.npmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
auto-install-peers=false
2-
use-node-version=16.20.0
2+
use-node-version=20.14.0

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Embroider Changelog
22

3+
## Release (2024-06-20)
4+
5+
@embroider/compat 3.5.4 (patch)
6+
@embroider/core 3.4.13 (patch)
7+
@embroider/macros 1.16.4 (patch)
8+
9+
#### :bug: Bug Fix
10+
* `@embroider/macros`
11+
* [#1994](https://github.com/embroider-build/embroider/pull/1994) MacrosConfig should sync globalConfigs between copies ([@ef4](https://github.com/ef4))
12+
13+
#### :house: Internal
14+
* [#1993](https://github.com/embroider-build/embroider/pull/1993) update node to latest LTS for CI ([@mansona](https://github.com/mansona))
15+
16+
#### Committers: 2
17+
- Chris Manson ([@mansona](https://github.com/mansona))
18+
- Edward Faulkner ([@ef4](https://github.com/ef4))
19+
20+
## Release (2024-06-13)
21+
22+
@embroider/compat 3.5.3 (patch)
23+
@embroider/core 3.4.12 (patch)
24+
25+
#### :bug: Bug Fix
26+
* `@embroider/compat`, `@embroider/core`, `@embroider/sample-transforms`
27+
* [#1969](https://github.com/embroider-build/embroider/pull/1969) Update `fast-sourcemap-concat` to remove dependency `lodash.template` for consumer apps (security vulnerability) ([@mkszepp](https://github.com/mkszepp))
28+
29+
#### Committers: 1
30+
- Markus Sanin ([@mkszepp](https://github.com/mkszepp))
31+
332
## Release (2024-06-12)
433

534
@embroider/webpack 4.0.3 (patch)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"jest": "^29.2.1",
5454
"prettier": "^2.3.1",
5555
"release-plan": "^0.9.0",
56-
"typescript": "^5.4.5"
56+
"typescript": "^5.5.2"
5757
},
5858
"publishConfig": {
5959
"registry": "https://registry.npmjs.org"

packages/compat/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@embroider/compat",
3-
"version": "3.5.2",
3+
"version": "3.5.4",
44
"private": false,
55
"description": "Backward compatibility layer for the Embroider build system.",
66
"repository": {
@@ -50,7 +50,7 @@
5050
"chalk": "^4.1.1",
5151
"debug": "^4.3.2",
5252
"escape-string-regexp": "^4.0.0",
53-
"fast-sourcemap-concat": "^1.4.0",
53+
"fast-sourcemap-concat": "^2.1.1",
5454
"fs-extra": "^9.1.0",
5555
"fs-tree-diff": "^2.0.1",
5656
"jsdom": "^16.6.0",

packages/core/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@embroider/core",
3-
"version": "3.4.11",
3+
"version": "3.4.13",
44
"private": false,
55
"description": "A build system for EmberJS applications.",
66
"repository": {
@@ -34,7 +34,7 @@
3434
"broccoli-source": "^3.0.1",
3535
"debug": "^4.3.2",
3636
"escape-string-regexp": "^4.0.0",
37-
"fast-sourcemap-concat": "^1.4.0",
37+
"fast-sourcemap-concat": "^2.1.1",
3838
"filesize": "^10.0.7",
3939
"fs-extra": "^9.1.0",
4040
"fs-tree-diff": "^2.0.1",

packages/macros/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@embroider/macros",
3-
"version": "1.16.3",
3+
"version": "1.16.4",
44
"private": false,
55
"description": "Standardized build-time macros for ember apps.",
66
"keywords": [

packages/macros/src/macros-config.ts

+26-17
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ export type Merger = (
2222
}
2323
) => object;
2424

25+
interface GlobalSharedEntry {
26+
configs: Map<string, object[]>;
27+
globalConfigs: Record<string, string>;
28+
configSources: WeakMap<object, string>;
29+
mergers: Map<string, { merger: Merger; fromPath: string }>;
30+
}
31+
2532
// Do not change this type signature without pondering deeply the mysteries of
2633
// being compatible with unwritten future versions of this library.
27-
type GlobalSharedState = WeakMap<
28-
any,
29-
{
30-
configs: Map<string, object[]>;
31-
configSources: WeakMap<object, string>;
32-
mergers: Map<string, { merger: Merger; fromPath: string }>;
33-
}
34-
>;
34+
type GlobalSharedState = WeakMap<any, GlobalSharedEntry>;
3535

3636
// this is a module-scoped cache. If multiple callers ask _this copy_ of
3737
// @embroider/macros for a shared MacrosConfig, they'll all get the same one.
@@ -93,25 +93,29 @@ export default class MacrosConfig {
9393
if (!shared.configSources) {
9494
shared.configSources = new WeakMap();
9595
}
96+
97+
// earlier versions did not include this -- we may need to upgrade the
98+
// format here
99+
if (!shared.globalConfigs) {
100+
shared.globalConfigs = {};
101+
}
96102
} else {
97103
shared = {
98104
configs: new Map(),
105+
globalConfigs: {},
99106
configSources: new WeakMap(),
100107
mergers: new Map(),
101108
};
102109
g.__embroider_macros_global__.set(key, shared);
103110
}
104111

105-
let config = new MacrosConfig(appRoot);
106-
config.configs = shared.configs;
107-
config.configSources = shared.configSources;
108-
config.mergers = shared.mergers;
112+
let config = new MacrosConfig(appRoot, shared);
109113
localSharedState.set(key, config);
110114
return config;
111115
}
112116

113117
private mode: 'compile-time' | 'run-time' = 'compile-time';
114-
private globalConfig: { [key: string]: unknown } = {};
118+
private globalConfig: { [key: string]: unknown };
115119

116120
private isDevelopingPackageRoots: Set<string> = new Set();
117121

@@ -135,7 +139,12 @@ export default class MacrosConfig {
135139
}
136140
}
137141

138-
private constructor(private origAppRoot: string) {
142+
private constructor(private origAppRoot: string, shared: GlobalSharedEntry) {
143+
this.configs = shared.configs;
144+
this.globalConfig = shared.globalConfigs;
145+
this.configSources = shared.configSources;
146+
this.mergers = shared.mergers;
147+
139148
// this uses globalConfig because these things truly are global. Even if a
140149
// package doesn't have a dep or peerDep on @embroider/macros, it's legit
141150
// for them to want to know the answer to these questions, and there is only
@@ -164,9 +173,9 @@ export default class MacrosConfig {
164173
}
165174

166175
private _configWritable = true;
167-
private configs: Map<string, object[]> = new Map();
168-
private configSources: WeakMap<object, string> = new WeakMap();
169-
private mergers: Map<string, { merger: Merger; fromPath: string }> = new Map();
176+
private configs: Map<string, object[]>;
177+
private configSources: WeakMap<object, string>;
178+
private mergers: Map<string, { merger: Merger; fromPath: string }>;
170179

171180
// Registers a new source of configuration to be given to the named package.
172181
// Your config type must be json-serializable. You must always set fromPath to

packages/shared-internals/src/rewritten-package-cache.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import PackageCache from './package-cache';
2+
import type { V2AddonPackage, V2AppPackage, V2Package } from './package';
23
import Package from './package';
34
import { existsSync, readJSONSync, realpathSync } from 'fs-extra';
45
import { resolve } from 'path';
@@ -240,15 +241,15 @@ class WrappedPackage implements PackageTheGoodParts {
240241
return this.plainPkg.isLazyEngine();
241242
}
242243

243-
isV2Ember() {
244+
isV2Ember(): this is V2Package {
244245
return this.plainPkg.isV2Ember();
245246
}
246247

247-
isV2App() {
248+
isV2App(): this is V2AppPackage {
248249
return this.plainPkg.isV2App();
249250
}
250251

251-
isV2Addon() {
252+
isV2Addon(): this is V2AddonPackage {
252253
return this.plainPkg.isV2Addon();
253254
}
254255

0 commit comments

Comments
 (0)