gdu 4.0.3 → 4.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # gdu
2
2
 
3
+ ## 4.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - GDU: sets unique ourput dirs
8
+
9
+ ## 4.0.6
10
+
11
+ ### Patch Changes
12
+
13
+ - GDU: sets octopus var for prod public path
14
+
15
+ ## 4.0.5
16
+
17
+ ### Patch Changes
18
+
19
+ - GDU: Sets public asset paths
20
+
21
+ ## 4.0.4
22
+
23
+ ### Patch Changes
24
+
25
+ - GDU: Passes on app and node envs to build command
26
+
3
27
  ## 4.0.3
4
28
 
5
29
  ### Patch Changes
@@ -18,7 +18,10 @@ const buildSSR = async (guruConfig) => {
18
18
  cwd: roots_1.PROJECT_ROOT,
19
19
  localDir: roots_1.GDU_ROOT,
20
20
  extendEnv: true,
21
- env: { NODE_ENV: 'production' },
21
+ env: {
22
+ NODE_ENV: 'production',
23
+ APP_ENV: process.env.APP_ENV || 'prod',
24
+ },
22
25
  })
23
26
  .then((result) => {
24
27
  console.log(`${kleur_1.dim('SUCCESS!')}`, `${kleur_1.dim('Listening')}: ${kleur_1.blue(result === null || result === void 0 ? void 0 : result.all)}`);
@@ -3,6 +3,7 @@ export declare const createNextJSConfig: (buildEnv: any) => {
3
3
  distDir: string;
4
4
  reactStrictMode: boolean;
5
5
  swcMinify: boolean;
6
+ assetPrefix: string;
6
7
  experimental: {
7
8
  concurrentFeatures: boolean;
8
9
  serverComponents: boolean;
@@ -31,6 +31,7 @@ const webpack_1 = require("webpack");
31
31
  const misc_1 = require("../lib/misc");
32
32
  const roots_1 = require("../lib/roots");
33
33
  const configs_1 = require("../utils/configs");
34
+ const config_1 = require("../lib/config");
34
35
  const withVanillaExtract = next_plugin_1.createVanillaExtractPlugin();
35
36
  exports.withTM = next_transpile_modules_1.default([
36
37
  '@autoguru/themes',
@@ -45,19 +46,23 @@ exports.withTM = next_transpile_modules_1.default([
45
46
  '@popperjs/core',
46
47
  ]);
47
48
  const createNextJSConfig = (buildEnv) => {
49
+ var _a;
48
50
  const isDev = !misc_1.isEnvProduction();
49
51
  const env = process.env.APP_ENV || (isDev ? 'dev' : buildEnv);
52
+ const assetPrefix = isDev ? '' : (_a = config_1.getGuruConfig()) === null || _a === void 0 ? void 0 : _a.publicPath;
53
+ console.log({ assetPrefix, isDev });
50
54
  return {
51
- distDir: `dist/${env}`,
55
+ distDir: `dist/${env}/${assetPrefix}`,
52
56
  reactStrictMode: true,
53
57
  swcMinify: true,
58
+ assetPrefix,
54
59
  experimental: {
55
60
  concurrentFeatures: false,
56
61
  serverComponents: false,
57
62
  },
58
63
  i18n: {
59
- locales: ["en"],
60
- defaultLocale: "en",
64
+ locales: ['en'],
65
+ defaultLocale: 'en',
61
66
  },
62
67
  typescript: {
63
68
  transpileOnly: true,
@@ -98,5 +103,5 @@ const createNextJSConfig = (buildEnv) => {
98
103
  };
99
104
  };
100
105
  exports.createNextJSConfig = createNextJSConfig;
101
- const createNextJSTranspiledConfig = () => withVanillaExtract(exports.withTM(exports.createNextJSConfig('uat')));
106
+ const createNextJSTranspiledConfig = () => withVanillaExtract(exports.withTM(exports.createNextJSConfig('prod')));
102
107
  exports.createNextJSTranspiledConfig = createNextJSTranspiledConfig;
@@ -298,22 +298,21 @@ const baseOptions = (buildEnv, isMultiEnv) => ({
298
298
  ].filter(Boolean),
299
299
  });
300
300
  const { outputPath } = config_1.getGuruConfig();
301
- const makeWebpackConfig = (buildEnv, isMultiEnv) => {
302
- var _a, _b;
303
- return ({
304
- name: buildEnv,
305
- output: {
306
- path: `${outputPath}/${!isMultiEnv && buildEnv === 'prod' ? '' : buildEnv}`,
307
- publicPath: isDev ? '/' : (_b = (_a = config_1.getGuruConfig()) === null || _a === void 0 ? void 0 : _a.publicPath) !== null && _b !== void 0 ? _b : '/',
308
- filename: `${fileMask}.js`,
309
- chunkFilename: `chunks/${fileMask}.js`,
310
- hashFunction: 'sha256',
311
- crossOriginLoading: 'anonymous',
312
- sourceMapFilename: 'sourceMaps/[file].map',
313
- pathinfo: false,
314
- },
315
- });
316
- };
301
+ const makeWebpackConfig = (buildEnv, isMultiEnv) => ({
302
+ name: buildEnv,
303
+ output: {
304
+ path: `${outputPath}/${!isMultiEnv && buildEnv === 'prod' ? '' : buildEnv}`,
305
+ publicPath: isDev
306
+ ? '/'
307
+ : (buildEnv === 'prod' ? '#{PUBLIC_PATH_BASE}' : `https://static-mfe-${buildEnv}.autoguru.io`),
308
+ filename: `${fileMask}.js`,
309
+ chunkFilename: `chunks/${fileMask}.js`,
310
+ hashFunction: 'sha256',
311
+ crossOriginLoading: 'anonymous',
312
+ sourceMapFilename: 'sourceMaps/[file].map',
313
+ pathinfo: false,
314
+ },
315
+ });
317
316
  const buildConfigs = () => {
318
317
  const buildEnvs = configs_1.getBuildEnvs();
319
318
  return buildEnvs.map((buildEnv) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdu",
3
- "version": "4.0.3",
3
+ "version": "4.0.7",
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",