gdu 4.1.7 → 4.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.
@@ -1,4 +1,11 @@
1
1
  export declare const withTM: (nextConfig?: {}) => {};
2
+ declare type CSPKey = 'frame-ancestors' | 'frame-src' | 'style-src' | 'img-src' | 'font-src' | 'worker-src' | 'child-src' | 'object-src' | 'connect-src' | 'script-src-elem' | 'script-src';
3
+ interface CSPItem {
4
+ key: CSPKey;
5
+ values: string[];
6
+ }
7
+ export declare const CSPDefaultsList: CSPItem[];
8
+ export declare const generateCSP: (cspList: CSPItem[]) => string;
2
9
  export declare const defaultSecurityHeaders: {
3
10
  key: string;
4
11
  value: string;
@@ -18,6 +25,7 @@ export declare const createNextJSConfig: (buildEnv: any) => {
18
25
  ignoreBuildErrors: boolean;
19
26
  };
20
27
  images: {
28
+ minimumCacheTTL: number;
21
29
  formats: string[];
22
30
  deviceSizes: number[];
23
31
  imageSizes: number[];
@@ -26,3 +34,4 @@ export declare const createNextJSConfig: (buildEnv: any) => {
26
34
  webpack: (defaultConfig: any) => any;
27
35
  };
28
36
  export declare const createNextJSTranspiledConfig: () => any;
37
+ export {};
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.createNextJSTranspiledConfig = exports.createNextJSConfig = exports.defaultSecurityHeaders = exports.withTM = void 0;
25
+ exports.createNextJSTranspiledConfig = exports.createNextJSConfig = exports.defaultSecurityHeaders = exports.generateCSP = exports.CSPDefaultsList = exports.withTM = void 0;
26
26
  const path_1 = __importStar(require("path"));
27
27
  const next_plugin_1 = require("@vanilla-extract/next-plugin");
28
28
  const dotenv_webpack_1 = __importDefault(require("dotenv-webpack"));
@@ -45,45 +45,118 @@ exports.withTM = next_transpile_modules_1.default([
45
45
  '@autoguru/layout',
46
46
  '@popperjs/core',
47
47
  ]);
48
- const allowedScriptSources = [
49
- "'self'",
50
- "'unsafe-inline'",
51
- '*.autoguru.com.au',
52
- '*.googletagmanager.com',
53
- '*.google-analytics.com',
54
- '*.google.com',
55
- '*.google.com.au',
56
- '*.gstatic.com',
57
- '*.googleadservices.com',
58
- '*.heapanalytics.com',
59
- 'heapanalytics.com',
60
- '*.doubleclick.net',
61
- '*.mapbox.com',
62
- '*.quantserve.com',
63
- '*.wisepops.com',
64
- '*.tvsquared.com',
65
- '*.quantcount.com',
66
- ].join(' ');
67
- const allowedStyleSources = [
68
- "'self'",
69
- "'unsafe-inline'",
70
- 'https://*.autoguru.com.au',
71
- 'https://*.googleapis.com',
72
- ].join(' ');
73
- const allowedIFrameSources = [
74
- "'self'",
75
- 'https://www.youtube.com',
76
- 'https://www.google.com',
77
- ].join(' ');
78
- const allowedImageSources = ["'self'"].join(' ');
79
- const allowedDataDomains = ['https://*'].join(' ');
80
- const allowedFontSources = [
81
- 'https://*.autoguru.com.au',
82
- 'https://*.googleapis.com',
83
- 'https://*.gstatic.com',
84
- ].join(' ');
85
- const allowedDataSources = ["'self'", 'blob:'].join(' ');
86
- const allowedObjectSources = ["'none'"].join(' ');
48
+ exports.CSPDefaultsList = [
49
+ {
50
+ key: 'frame-ancestors',
51
+ values: ['https://*.autoguru.com.au'],
52
+ },
53
+ {
54
+ key: 'frame-src',
55
+ values: ["'self'", 'https://www.youtube.com', 'https://www.google.com'],
56
+ },
57
+ {
58
+ key: 'style-src',
59
+ values: [
60
+ "'self'",
61
+ "'unsafe-inline'",
62
+ 'https://*.autoguru.com.au',
63
+ 'https://*.googleapis.com',
64
+ ],
65
+ },
66
+ {
67
+ key: 'img-src',
68
+ values: [
69
+ "'self'",
70
+ 'data:',
71
+ 'https://*.autoguru.com.au',
72
+ 'https://*.googletagmanager.com',
73
+ 'https://*.google-analytics.com',
74
+ 'https://*.google.com',
75
+ 'https://*.google.com.au',
76
+ 'https://*.gstatic.com',
77
+ ],
78
+ },
79
+ {
80
+ key: 'font-src',
81
+ values: [
82
+ 'https://*.autoguru.com.au',
83
+ 'https://*.googleapis.com',
84
+ 'https://*.gstatic.com',
85
+ ],
86
+ },
87
+ {
88
+ key: 'worker-src',
89
+ values: ["'self'", 'blob:'],
90
+ },
91
+ {
92
+ key: 'child-src',
93
+ values: ["'self'", 'blob:'],
94
+ },
95
+ {
96
+ key: 'object-src',
97
+ values: ["'none'"],
98
+ },
99
+ {
100
+ key: 'connect-src',
101
+ values: [
102
+ "'self'",
103
+ '*.autoguru.com.au',
104
+ 'https://*.googletagmanager.com',
105
+ 'https://*.google-analytics.com',
106
+ 'https://*.google.com',
107
+ 'https://*.google.com.au',
108
+ 'https://*.gstatic.com',
109
+ 'https://*.googleadservices.com',
110
+ 'https://*.heapanalytics.com',
111
+ 'https://*.doubleclick.net',
112
+ 'https://*.mapbox.com',
113
+ 'https://*.quantserve.com',
114
+ 'https://*.wisepops.com',
115
+ 'https://*.tvsquared.com',
116
+ 'https://*.quantcount.com',
117
+ ],
118
+ },
119
+ {
120
+ key: 'script-src-elem',
121
+ values: [
122
+ "'self'",
123
+ "'unsafe-inline'",
124
+ 'https://*.autoguru.com.au',
125
+ 'https://*.google-analytics.com',
126
+ 'https://*.googletagmanager.com',
127
+ 'https://*.gstatic.com',
128
+ 'https://*.google.com',
129
+ 'https://*.google.com.au',
130
+ 'https://*.gstatic.com',
131
+ 'https://*.googleadservices.com',
132
+ 'https://*.heapanalytics.com',
133
+ 'https://*.doubleclick.net',
134
+ 'https://*.mapbox.com',
135
+ 'https://*.quantserve.com',
136
+ 'https://*.wisepops.com',
137
+ 'https://*.tvsquared.com',
138
+ 'https://*.quantcount.com',
139
+ ],
140
+ },
141
+ {
142
+ key: 'script-src',
143
+ values: [
144
+ "'self'",
145
+ "'unsafe-eval'",
146
+ 'https://*.autoguru.com.au',
147
+ 'https://*.googletagmanager.com',
148
+ 'https://*.google.com.au',
149
+ 'https://*.gstatic.com',
150
+ 'https://*.heapanalytics.com',
151
+ 'https://*.quantserve.com',
152
+ 'https://*.wisepops.com',
153
+ 'https://*.tvsquared.com',
154
+ 'https://*.quantcount.com',
155
+ ],
156
+ },
157
+ ];
158
+ const generateCSP = (cspList) => cspList.reduce((policies, csp, currentIndex) => `${policies}${currentIndex !== 0 ? '; ' : ''}${csp.key} ${csp.values.join(' ')}`, '');
159
+ exports.generateCSP = generateCSP;
87
160
  exports.defaultSecurityHeaders = [
88
161
  {
89
162
  key: 'X-DNS-Prefetch-Control',
@@ -97,10 +170,6 @@ exports.defaultSecurityHeaders = [
97
170
  key: 'X-Frame-Options',
98
171
  value: 'SAMEORIGIN https://*.autoguru.com.au',
99
172
  },
100
- {
101
- key: 'Content-Security-Policy',
102
- value: `frame-ancestors https://*.autoguru.com.au; frame-src ${allowedIFrameSources}; style-src ${allowedStyleSources}; img-src ${allowedImageSources} data: ${allowedDataDomains}; font-src ${allowedFontSources}; worker-src ${allowedDataSources}; child-src ${allowedDataSources}; object-src ${allowedObjectSources};connect-src ${allowedScriptSources}; script-src-elem ${allowedScriptSources}; script-src ${allowedScriptSources};`,
103
- },
104
173
  ];
105
174
  const createNextJSConfig = (buildEnv) => {
106
175
  var _a, _b;
@@ -122,6 +191,7 @@ const createNextJSConfig = (buildEnv) => {
122
191
  ignoreBuildErrors: true,
123
192
  },
124
193
  images: {
194
+ minimumCacheTTL: 3153600000,
125
195
  formats: ['image/avif', 'image/webp'],
126
196
  deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
127
197
  imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdu",
3
- "version": "4.1.7",
3
+ "version": "4.2.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",