gdu 4.2.0 → 5.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/dist/commands/build/index.js +2 -0
- package/dist/commands/generateBrowsers.d.ts +3 -0
- package/dist/commands/generateBrowsers.js +18 -0
- package/dist/commands/index.js +3 -0
- package/dist/commands/start/index.js +2 -0
- package/dist/config/next.config.js +3 -0
- package/dist/lib/configure.d.ts +1 -0
- package/dist/lib/configure.js +3 -2
- package/package.json +5 -3
|
@@ -7,10 +7,12 @@ const misc_1 = require("../../lib/misc");
|
|
|
7
7
|
const terminal_1 = require("../../lib/terminal");
|
|
8
8
|
const buildSPA_1 = require("./buildSPA");
|
|
9
9
|
const buildSSR_1 = require("./buildSSR");
|
|
10
|
+
const generateBrowsers_1 = require("../generateBrowsers");
|
|
10
11
|
exports.default = async () => {
|
|
11
12
|
misc_1.setEnvProd(true);
|
|
12
13
|
const guruConfig = config_1.getGuruConfig();
|
|
13
14
|
banner_1.banner('Building');
|
|
15
|
+
await generateBrowsers_1.buildSupportedBrowsers();
|
|
14
16
|
let stats;
|
|
15
17
|
if ((guruConfig === null || guruConfig === void 0 ? void 0 : guruConfig.type) === 'ssr') {
|
|
16
18
|
stats = await buildSSR_1.buildSSR(guruConfig);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildSupportedBrowsers = void 0;
|
|
4
|
+
const browserslist_useragent_regexp_1 = require("browserslist-useragent-regexp");
|
|
5
|
+
const io_1 = require("../lib/io");
|
|
6
|
+
const configure_1 = require("../lib/configure");
|
|
7
|
+
const kleur_1 = require("kleur");
|
|
8
|
+
const buildSupportedBrowsers = async () => {
|
|
9
|
+
console.log(`${kleur_1.green('Building supported browsers list')}`);
|
|
10
|
+
const regExp = browserslist_useragent_regexp_1.getUserAgentRegExp({
|
|
11
|
+
allowHigherVersions: true,
|
|
12
|
+
});
|
|
13
|
+
await io_1.writeFileAsync('browsers.ts', configure_1.WRAP_BANNER(`export const AGSupportedBrowsers = ${regExp}`));
|
|
14
|
+
};
|
|
15
|
+
exports.buildSupportedBrowsers = buildSupportedBrowsers;
|
|
16
|
+
exports.default = async () => {
|
|
17
|
+
await exports.buildSupportedBrowsers();
|
|
18
|
+
};
|
package/dist/commands/index.js
CHANGED
|
@@ -48,6 +48,9 @@ exports.default = (app) => {
|
|
|
48
48
|
.option('--env', 'Run a specific environment', 'dev')
|
|
49
49
|
.example('start -p 80')
|
|
50
50
|
.action(deferredAction(async () => Promise.resolve().then(() => __importStar(require('./start'))), IS_NOT_ROOT));
|
|
51
|
+
app.command('generateBrowsers')
|
|
52
|
+
.describe('Builds a regex of supported browser user agents')
|
|
53
|
+
.action(deferredAction(async () => Promise.resolve().then(() => __importStar(require('./generateBrowsers'))), IS_NOT_ROOT));
|
|
51
54
|
app.command('build')
|
|
52
55
|
.describe('Builds the target app ready for production')
|
|
53
56
|
.action(deferredAction(async () => Promise.resolve().then(() => __importStar(require('./build'))), IS_NOT_ROOT));
|
|
@@ -24,11 +24,13 @@ const banner_1 = require("../../lib/banner");
|
|
|
24
24
|
const config_1 = require("../../lib/config");
|
|
25
25
|
const misc_1 = require("../../lib/misc");
|
|
26
26
|
const roots_1 = require("../../lib/roots");
|
|
27
|
+
const generateBrowsers_1 = require("../generateBrowsers");
|
|
27
28
|
const { debug } = diary_1.diary('gdu:commands:start');
|
|
28
29
|
exports.default = async ({ port: incomingPort }) => {
|
|
29
30
|
debug('running action with %O', { port: incomingPort });
|
|
30
31
|
const { port = incomingPort, ...otherConfig } = config_1.getGuruConfig(roots_1.PROJECT_ROOT) || {};
|
|
31
32
|
const resolvedConfig = { port, ...otherConfig };
|
|
33
|
+
await generateBrowsers_1.buildSupportedBrowsers();
|
|
32
34
|
if (!misc_1.isEnvProduction())
|
|
33
35
|
banner_1.banner('Starting');
|
|
34
36
|
if ((resolvedConfig === null || resolvedConfig === void 0 ? void 0 : resolvedConfig.type) === 'ssr') {
|
|
@@ -71,6 +71,9 @@ exports.CSPDefaultsList = [
|
|
|
71
71
|
'https://*.autoguru.com.au',
|
|
72
72
|
'https://*.googletagmanager.com',
|
|
73
73
|
'https://*.google-analytics.com',
|
|
74
|
+
'https://*.heapanalytics.com/',
|
|
75
|
+
'https://heapanalytics.com/',
|
|
76
|
+
'https://*.tvsquared.com',
|
|
74
77
|
'https://*.google.com',
|
|
75
78
|
'https://*.google.com.au',
|
|
76
79
|
'https://*.gstatic.com',
|
package/dist/lib/configure.d.ts
CHANGED
package/dist/lib/configure.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.configure = void 0;
|
|
6
|
+
exports.configure = exports.WRAP_BANNER = void 0;
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const diary_1 = require("diary");
|
|
9
9
|
const ensure_gitignore_1 = __importDefault(require("ensure-gitignore"));
|
|
@@ -13,6 +13,7 @@ const io_1 = require("./io");
|
|
|
13
13
|
const terminal_1 = require("./terminal");
|
|
14
14
|
const { debug } = diary_1.diary('gdu:configure');
|
|
15
15
|
const WRAP_BANNER = (extra) => `/** THIS FILE IS GENERATED, ALL CHANGES WILL NOT PERSIST **/\n${extra}`;
|
|
16
|
+
exports.WRAP_BANNER = WRAP_BANNER;
|
|
16
17
|
const configure = async (app_location) => {
|
|
17
18
|
debug('attempting a configure @ %s', app_location);
|
|
18
19
|
const guruConfig = config_1.getGuruConfig(app_location);
|
|
@@ -63,7 +64,7 @@ const configure = async (app_location) => {
|
|
|
63
64
|
].filter(Boolean),
|
|
64
65
|
exclude: ['node_modules'],
|
|
65
66
|
};
|
|
66
|
-
writeFiles.set('tsconfig.json', WRAP_BANNER(JSON.stringify(tsConfig, null, 4)));
|
|
67
|
+
writeFiles.set('tsconfig.json', exports.WRAP_BANNER(JSON.stringify(tsConfig, null, 4)));
|
|
67
68
|
writeFiles.set('.browserslistrc', ts_dedent_1.default `
|
|
68
69
|
# FILE IS MANAGED BY GDU, CHANGES WILL NOT PERSIST.
|
|
69
70
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdu",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AutoGuru's development toolkit",
|
|
6
6
|
"homepage": "https://github.com/autoguru-au/octane/tree/master/packages/gdu#readme",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"babel-loader": "^8.2.2",
|
|
41
41
|
"babel-plugin-relay": "^13.2.0",
|
|
42
42
|
"babel-plugin-treat": "^1.6.2",
|
|
43
|
-
"browserslist-config-autoguru": "^2.1.2",
|
|
44
43
|
"clean-webpack-plugin": "^4.0.0-alpha.0",
|
|
45
44
|
"core-js": "^3.9.1",
|
|
46
45
|
"css-loader": "^6.4.0",
|
|
@@ -95,10 +94,13 @@
|
|
|
95
94
|
"@types/sade": "^1.7.3",
|
|
96
95
|
"@types/webpack": "^5.28.0",
|
|
97
96
|
"babel-plugin-macros": "^3.1.0",
|
|
97
|
+
"browserslist-config-autoguru": "*",
|
|
98
|
+
"browserslist-useragent-regexp": "^3.0.2",
|
|
98
99
|
"typescript": "4.1.5"
|
|
99
100
|
},
|
|
100
101
|
"peerDependencies": {
|
|
101
|
-
"@types/node": ">=10"
|
|
102
|
+
"@types/node": ">=10",
|
|
103
|
+
"browserslist-config-autoguru": ">=2.2.0"
|
|
102
104
|
},
|
|
103
105
|
"engines": {
|
|
104
106
|
"node": ">=12.14.0"
|