@abcnews/aunty 13.2.2 → 14.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abcnews/aunty",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "A toolkit for working with ABC News projects",
|
|
5
5
|
"repository": "abcnews/aunty",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,8 +70,6 @@
|
|
|
70
70
|
"node-fetch": "^2.6.0",
|
|
71
71
|
"ora": "^5.0.0",
|
|
72
72
|
"pify": "^5.0.0",
|
|
73
|
-
"postcss": "^8.3.6",
|
|
74
|
-
"postcss-loader": "^6.1.1",
|
|
75
73
|
"prettier": "^2.0.5",
|
|
76
74
|
"requireg": "^0.2.2",
|
|
77
75
|
"rsyncwrapper": "^3.0.1",
|
|
@@ -92,9 +90,6 @@
|
|
|
92
90
|
"yeoman-environment": "^3.2.0",
|
|
93
91
|
"yeoman-generator": "^5.2.0"
|
|
94
92
|
},
|
|
95
|
-
"optionalDependencies": {
|
|
96
|
-
"@abcaustralia/postcss-config": "^11.2.5"
|
|
97
|
-
},
|
|
98
93
|
"devDependencies": {
|
|
99
94
|
"babel-eslint": "^10.1.0",
|
|
100
95
|
"eslint": "^7.7.0",
|
package/src/config/webpack.js
CHANGED
|
@@ -4,7 +4,6 @@ const { join, resolve } = require('path');
|
|
|
4
4
|
|
|
5
5
|
// External
|
|
6
6
|
const importLazy = require('import-lazy')(require);
|
|
7
|
-
const getContext = importLazy('@abcaustralia/postcss-config/getContext'); // optional dependency
|
|
8
7
|
const CopyPlugin = importLazy('copy-webpack-plugin');
|
|
9
8
|
const Dotenv = importLazy('dotenv-webpack');
|
|
10
9
|
const ForkTsCheckerWebpackPlugin = importLazy('fork-ts-checker-webpack-plugin');
|
|
@@ -265,7 +264,6 @@ function createWebpackConfig({ isModernJS } = {}) {
|
|
|
265
264
|
moduleIds: isProd ? 'deterministic' : 'named'
|
|
266
265
|
}
|
|
267
266
|
},
|
|
268
|
-
conditionallyEnableABCAustraliaStyles,
|
|
269
267
|
PROJECT_TYPES_CONFIG[type],
|
|
270
268
|
projectWebpackConfig
|
|
271
269
|
);
|
|
@@ -287,74 +285,3 @@ function createWebpackConfig({ isModernJS } = {}) {
|
|
|
287
285
|
function getHintedRule(config, hint) {
|
|
288
286
|
return config.module.rules.find(rule => rule.__hint__ === hint);
|
|
289
287
|
}
|
|
290
|
-
|
|
291
|
-
const ABC_POSTCSS_CONTEXT_SUGGESTION = `
|
|
292
|
-
|
|
293
|
-
To compile @abcaustralia/* styles, you need to add the following to your package.json:
|
|
294
|
-
|
|
295
|
-
"abc": {
|
|
296
|
-
"css": {
|
|
297
|
-
"libraryDir": "./node_modules/@abcaustralia/nucleus/css",
|
|
298
|
-
"logVariables": "false"
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
`;
|
|
302
|
-
|
|
303
|
-
function getABCAustraliaPostCSSContext(isDev) {
|
|
304
|
-
try {
|
|
305
|
-
return getContext(isDev);
|
|
306
|
-
} catch (err) {
|
|
307
|
-
if (err.message.indexOf('css') > -1) {
|
|
308
|
-
err.message += ABC_POSTCSS_CONTEXT_SUGGESTION;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
throw err;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
const ABC_PACKAGE_PATTERN = /(node_modules\/@abcaustralia\/*)/;
|
|
316
|
-
|
|
317
|
-
function conditionallyEnableABCAustraliaStyles(config) {
|
|
318
|
-
const { pkg } = getProjectConfig();
|
|
319
|
-
|
|
320
|
-
// Only enable if we have an @abcaustralia/* dependency
|
|
321
|
-
if (!Object.keys(pkg.dependencies || {}).find(x => x.indexOf('@abcaustralia/') === 0)) {
|
|
322
|
-
return config;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
const isProd = config.mode === 'production';
|
|
326
|
-
const stylesRule = getHintedRule(config, 'styles');
|
|
327
|
-
|
|
328
|
-
stylesRule.exclude = ABC_PACKAGE_PATTERN;
|
|
329
|
-
|
|
330
|
-
config.module.rules.push({
|
|
331
|
-
__hint__: 'styles/@abcaustralia',
|
|
332
|
-
test: /\.css$/,
|
|
333
|
-
include: ABC_PACKAGE_PATTERN,
|
|
334
|
-
use: [
|
|
335
|
-
stylesRule.use[0],
|
|
336
|
-
{
|
|
337
|
-
loader: require.resolve('css-loader'),
|
|
338
|
-
options: {
|
|
339
|
-
importLoaders: 1,
|
|
340
|
-
modules: {
|
|
341
|
-
exportLocalsConvention: 'camelCase',
|
|
342
|
-
localIdentName: `${isProd ? '' : '[name]__[local]--'}[contenthash:base64:5]`
|
|
343
|
-
},
|
|
344
|
-
url: false
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
loader: require.resolve('postcss-loader'),
|
|
349
|
-
options: {
|
|
350
|
-
postcssOptions: {
|
|
351
|
-
config: require.resolve('@abcaustralia/postcss-config'),
|
|
352
|
-
...getABCAustraliaPostCSSContext(!isProd)
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
]
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
return config;
|
|
360
|
-
}
|
|
@@ -17,7 +17,8 @@ module.exports.getWebpackDevServerConfig = async () => {
|
|
|
17
17
|
allowedHosts: 'all',
|
|
18
18
|
client: {
|
|
19
19
|
logging: 'warn',
|
|
20
|
-
overlay: true
|
|
20
|
+
overlay: true,
|
|
21
|
+
webSocketURL: `ws${https ? 's' : ''}://${host}:${port}/ws`
|
|
21
22
|
},
|
|
22
23
|
devMiddleware: {
|
|
23
24
|
publicPath: `http${https ? 's' : ''}://${host}:${port}/`
|
|
@@ -14,11 +14,5 @@
|
|
|
14
14
|
"start": "aunty serve",
|
|
15
15
|
"dev": "aunty serve",
|
|
16
16
|
"test": "aunty test"
|
|
17
|
-
}
|
|
18
|
-
"abc": {
|
|
19
|
-
"css": {
|
|
20
|
-
"libraryDir": "./node_modules/@abcaustralia/nucleus/css",
|
|
21
|
-
"logVariables": "false"
|
|
22
|
-
}
|
|
23
|
-
}<% } %>
|
|
17
|
+
}
|
|
24
18
|
}
|