@abcnews/aunty 15.0.3 → 16.0.1
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/README.md +10 -0
- package/package.json +6 -5
- package/src/config/webpack.js +49 -25
- 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/README.md
CHANGED
|
@@ -83,6 +83,16 @@ module.exports = {
|
|
|
83
83
|
}
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
For example to include a package that needs to be pre-processed, include in `aunty.config.js`
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
module.exports = {
|
|
90
|
+
build: {
|
|
91
|
+
includedDependencies: ["runed"],
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
```
|
|
95
|
+
|
|
86
96
|
Supported project `type`s (currently: `basic`, `preact`, `react` & `svelte`) have their own default build configuration, but you can override it by extending your project configuration.
|
|
87
97
|
|
|
88
98
|
The `build`, `serve` and `deploy` properties allow you to override the default settings for those respective commands. Their respective properties (and default values) are documented below.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abcnews/aunty",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"description": "A toolkit for working with ABC News projects",
|
|
5
5
|
"repository": "abcnews/aunty",
|
|
6
6
|
"license": "MIT",
|
|
@@ -75,14 +75,15 @@
|
|
|
75
75
|
"prettier": "^2.0.5",
|
|
76
76
|
"requireg": "^0.2.2",
|
|
77
77
|
"rsyncwrapper": "^3.0.1",
|
|
78
|
-
"sass": "^1.
|
|
79
|
-
"sass-loader": "^
|
|
78
|
+
"sass": "^1.96.0",
|
|
79
|
+
"sass-loader": "^16.0.6",
|
|
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
|
}
|
|
@@ -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
|