@abcnews/aunty 12.1.3 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/cli/release/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Native
|
|
2
|
+
const { existsSync } = require('fs');
|
|
2
3
|
const { join } = require('path');
|
|
3
4
|
|
|
4
5
|
// External
|
|
@@ -154,4 +155,8 @@ module.exports = command(
|
|
|
154
155
|
}
|
|
155
156
|
);
|
|
156
157
|
|
|
157
|
-
const updateJsonFile = (path, source) =>
|
|
158
|
+
const updateJsonFile = (path, source) => {
|
|
159
|
+
if (existsSync(path)) {
|
|
160
|
+
writeJsonFile.sync(path, combine(loadJsonFile.sync(path), source));
|
|
161
|
+
}
|
|
162
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import acto from '@abcnews/alternating-case-to-object';
|
|
2
2
|
import { <% if (isOdyssey) { %>whenOdysseyLoaded<% } else { %>whenDOMReady<% } %> } from '@abcnews/env-utils';
|
|
3
|
-
import { getMountValue, selectMounts } from '@abcnews/mount-utils'
|
|
4
|
-
import type { Mount } from '@abcnews/mount-utils';<% } %>
|
|
3
|
+
import { getMountValue, selectMounts } from '@abcnews/mount-utils';
|
|
5
4
|
import React from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { createRoot<% if (isTS) { %>, Root<% } %> } from 'react-dom/client';
|
|
7
6
|
import App from './components/App';<% if (isTS) { %>
|
|
8
7
|
import type { AppProps } from './components/App';<% } %>
|
|
9
8
|
|
|
10
|
-
let
|
|
9
|
+
let root<% if (isTS) { %>: Root<% } %>;
|
|
11
10
|
let appProps<% if (isTS) { %>: AppProps<% } %>;
|
|
12
11
|
|
|
13
12
|
function renderApp() {
|
|
14
|
-
render(<App {...appProps}
|
|
13
|
+
root.render(<App {...appProps} />);
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
<% if (isOdyssey) { %>whenOdysseyLoaded<% } else { %>whenDOMReady<% } %>.then(() => {
|
|
18
|
-
[appMountEl] = selectMounts('<%= projectNameFlat %>');
|
|
17
|
+
const [appMountEl] = selectMounts('<%= projectNameFlat %>');
|
|
19
18
|
|
|
20
19
|
if (appMountEl) {
|
|
20
|
+
root = createRoot(appMountEl);
|
|
21
21
|
appProps = acto(getMountValue(appMountEl))<% if (isTS) { %> as AppProps<% } %>;
|
|
22
22
|
renderApp();
|
|
23
23
|
}
|
|
@@ -29,7 +29,7 @@ if (module.hot) {
|
|
|
29
29
|
renderApp();
|
|
30
30
|
} catch (err) {
|
|
31
31
|
import('./components/ErrorBox').then(({ default: ErrorBox }) => {
|
|
32
|
-
render(<ErrorBox error={err}
|
|
32
|
+
root.render(<ErrorBox error={err} />);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
});
|