@abcnews/aunty 15.0.2 → 16.0.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 +4 -3
- package/src/config/webpack.js +50 -26
- package/src/generators/project/index.js +1 -1
- package/src/generators/project/templates/preact/src/components/App/index.tsx +1 -1
- package/src/generators/project/templates/preact/src/components/ErrorBox/index.tsx +1 -1
- package/src/generators/project/templates/preact/src/components/Worm/index.tsx +1 -1
- package/src/generators/project/templates/react/src/index.tsx +1 -1
- package/src/generators/project/templates/svelte/src/index.ts +3 -1
- package/ts/config.json +1 -1
- package/ts/custom.d.ts +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abcnews/aunty",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "A toolkit for working with ABC News projects",
|
|
5
5
|
"repository": "abcnews/aunty",
|
|
6
6
|
"license": "MIT",
|
|
@@ -79,10 +79,11 @@
|
|
|
79
79
|
"sass-loader": "^11.0.1",
|
|
80
80
|
"semver": "^7.3.2",
|
|
81
81
|
"style-loader": "^2.0.0",
|
|
82
|
-
"svelte": "^
|
|
83
|
-
"svelte-loader": "^3.
|
|
82
|
+
"svelte": "^5.17.4",
|
|
83
|
+
"svelte-loader": "^3.2.4",
|
|
84
84
|
"svelte-preprocess": "^5.1.1",
|
|
85
85
|
"tcp-ping-sync": "^1.0.0",
|
|
86
|
+
"ts-loader": "^9.5.1",
|
|
86
87
|
"typescript": "^5.3.2",
|
|
87
88
|
"update-notifier": "^6.0.2",
|
|
88
89
|
"webpack": "^5.33.2",
|
package/src/config/webpack.js
CHANGED
|
@@ -45,14 +45,7 @@ const PROJECT_TYPES_CONFIG = {
|
|
|
45
45
|
*/
|
|
46
46
|
svelte: config => {
|
|
47
47
|
config.resolve = {
|
|
48
|
-
// Make sure that only one copy of the Svelte runtime is bundled in the app
|
|
49
|
-
alias: {
|
|
50
|
-
svelte: resolve('node_modules', 'svelte/src/runtime')
|
|
51
|
-
},
|
|
52
|
-
// Recognise .svelte files
|
|
53
48
|
extensions: [...config.resolve.extensions, '.svelte'],
|
|
54
|
-
// When using Svelte components installed from npm, use the original component
|
|
55
|
-
// source code, rather than consuming the already-compiled version
|
|
56
49
|
mainFields: ['svelte', 'browser', 'module', 'main'],
|
|
57
50
|
conditionNames: ['svelte', 'browser', 'import']
|
|
58
51
|
};
|
|
@@ -62,31 +55,62 @@ const PROJECT_TYPES_CONFIG = {
|
|
|
62
55
|
|
|
63
56
|
include.push(/(node_modules\/svelte)/);
|
|
64
57
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
use: [
|
|
58
|
+
// options from https://github.com/sveltejs/svelte-loader
|
|
59
|
+
config.module.rules.push(
|
|
60
|
+
...[
|
|
69
61
|
{
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
test: /\.svelte\.ts$/,
|
|
63
|
+
use: [
|
|
64
|
+
{
|
|
65
|
+
loader,
|
|
66
|
+
options
|
|
67
|
+
},
|
|
68
|
+
{ loader: require.resolve('ts-loader'), options: { transpileOnly: true } },
|
|
69
|
+
{
|
|
70
|
+
loader: require.resolve('svelte-loader'),
|
|
71
|
+
options: {
|
|
72
|
+
dev: config.mode === 'development',
|
|
73
|
+
emitCss: extractCSS,
|
|
74
|
+
preprocess: sveltePreprocess()
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
]
|
|
72
78
|
},
|
|
73
79
|
{
|
|
74
|
-
|
|
80
|
+
test: /(?<!\.svelte)\.ts$/,
|
|
81
|
+
loader: require.resolve('ts-loader'),
|
|
75
82
|
options: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
transpileOnly: true // you should use svelte-check for type checking
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
// Svelte 5+:
|
|
88
|
+
test: /\.(svelte|svelte\.js)$/,
|
|
89
|
+
include,
|
|
90
|
+
use: [
|
|
91
|
+
{
|
|
92
|
+
loader,
|
|
93
|
+
options
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
loader: require.resolve('svelte-loader'),
|
|
97
|
+
options: {
|
|
98
|
+
dev: config.mode === 'development',
|
|
99
|
+
emitCss: extractCSS,
|
|
100
|
+
preprocess: sveltePreprocess()
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
// required to prevent errors from Svelte on Webpack 5+, omit on Webpack 4
|
|
107
|
+
test: /node_modules\/svelte\/.*\.mjs$/,
|
|
108
|
+
resolve: {
|
|
109
|
+
fullySpecified: false
|
|
79
110
|
}
|
|
80
111
|
}
|
|
81
112
|
]
|
|
82
|
-
|
|
83
|
-
// Required to prevent errors from Svelte on Webpack 5+
|
|
84
|
-
config.module.rules.push({
|
|
85
|
-
test: /node_modules\/svelte\/.*\.mjs$/,
|
|
86
|
-
resolve: {
|
|
87
|
-
fullySpecified: false
|
|
88
|
-
}
|
|
89
|
-
});
|
|
113
|
+
);
|
|
90
114
|
|
|
91
115
|
return config;
|
|
92
116
|
}
|
|
@@ -227,7 +251,7 @@ function createWebpackConfig({ isModernJS } = {}) {
|
|
|
227
251
|
}
|
|
228
252
|
},
|
|
229
253
|
{
|
|
230
|
-
test: /\.(jpg|png|gif|mp4|m4v|flv|mp3|wav|m4a|eot|ttf|woff|woff2|
|
|
254
|
+
test: /\.(jpg|png|gif|mp4|m4v|flv|mp3|wav|m4a|eot|ttf|woff|woff2|webm|webp|avif)$/,
|
|
231
255
|
type: 'asset'
|
|
232
256
|
},
|
|
233
257
|
{
|
|
@@ -2,7 +2,7 @@ import acto from '@abcnews/alternating-case-to-object';
|
|
|
2
2
|
import { <% if (isOdyssey) { %>whenOdysseyLoaded<% } else { %>whenDOMReady<% } %> } from '@abcnews/env-utils';
|
|
3
3
|
import { getMountValue, selectMounts } from '@abcnews/mount-utils';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { createRoot<% if (isTS) { %>, Root<% } %> } from 'react-dom/client';
|
|
5
|
+
import { createRoot<% if (isTS) { %>, type Root<% } %> } from 'react-dom/client';
|
|
6
6
|
import App from './components/App';<% if (isTS) { %>
|
|
7
7
|
import type { AppProps } from './components/App';<% } %>
|
|
8
8
|
|
|
@@ -3,6 +3,7 @@ import { <% if (isOdyssey) { %>whenOdysseyLoaded<% } else { %>whenDOMReady<% } %
|
|
|
3
3
|
import { getMountValue, selectMounts } from '@abcnews/mount-utils';<% if (isTS) { %>
|
|
4
4
|
import type { Mount } from '@abcnews/mount-utils';<% } %>
|
|
5
5
|
import App from './components/App/App.svelte';
|
|
6
|
+
import { mount } from 'svelte';
|
|
6
7
|
|
|
7
8
|
let appMountEl<% if (isTS) { %>: Mount<% } %>;
|
|
8
9
|
let appProps;
|
|
@@ -12,7 +13,8 @@ let appProps;
|
|
|
12
13
|
|
|
13
14
|
if (appMountEl) {
|
|
14
15
|
appProps = acto(getMountValue(appMountEl));
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
mount(App, {
|
|
16
18
|
target: appMountEl,
|
|
17
19
|
props: appProps
|
|
18
20
|
});
|
package/ts/config.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"esModuleInterop": true,
|
|
15
15
|
"forceConsistentCasingInFileNames": true,
|
|
16
16
|
"allowSyntheticDefaultImports": true,
|
|
17
|
-
"verbatimModuleSyntax":
|
|
17
|
+
"verbatimModuleSyntax": true,
|
|
18
18
|
"resolveJsonModule": true,
|
|
19
19
|
"isolatedModules": true,
|
|
20
20
|
"strictNullChecks": true
|
package/ts/custom.d.ts
CHANGED
|
@@ -103,3 +103,18 @@ declare module '*.html' {
|
|
|
103
103
|
const html: string;
|
|
104
104
|
export default html;
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
declare module '*.webp' {
|
|
108
|
+
const webp: string;
|
|
109
|
+
export default webp;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare module '*.webm' {
|
|
113
|
+
const webm: string;
|
|
114
|
+
export default webm;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare module '*.avif' {
|
|
118
|
+
const avif: string;
|
|
119
|
+
export default avif;
|
|
120
|
+
}
|