gdu 4.0.8 → 4.0.12

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.12
4
+
5
+ ### Patch Changes
6
+
7
+ - GDU adds default support for dot env configs
8
+
9
+ ## 4.0.11
10
+
11
+ ### Patch Changes
12
+
13
+ - GDU: Updates public paths
14
+
15
+ ## 4.0.10
16
+
17
+ ### Patch Changes
18
+
19
+ - GDU: Fixes prod env public path
20
+
21
+ ## 4.0.9
22
+
23
+ ### Patch Changes
24
+
25
+ - GDU: Fixes spa public path for prod env
26
+
3
27
  ## 4.0.8
4
28
 
5
29
  ### Patch Changes
@@ -4,10 +4,6 @@ export declare const createNextJSConfig: (buildEnv: any) => {
4
4
  reactStrictMode: boolean;
5
5
  swcMinify: boolean;
6
6
  assetPrefix: string;
7
- experimental: {
8
- concurrentFeatures: boolean;
9
- serverComponents: boolean;
10
- };
11
7
  i18n: {
12
8
  locales: string[];
13
9
  defaultLocale: string;
@@ -46,20 +46,15 @@ exports.withTM = next_transpile_modules_1.default([
46
46
  '@popperjs/core',
47
47
  ]);
48
48
  const createNextJSConfig = (buildEnv) => {
49
- var _a;
49
+ var _a, _b;
50
50
  const isDev = !misc_1.isEnvProduction();
51
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 });
52
+ const assetPrefix = isDev ? '' : (_b = (_a = config_1.getGuruConfig()) === null || _a === void 0 ? void 0 : _a.publicPath) !== null && _b !== void 0 ? _b : '';
54
53
  return {
55
- distDir: `dist/${env}/${assetPrefix}`,
54
+ distDir: `dist/${env}`,
56
55
  reactStrictMode: true,
57
56
  swcMinify: true,
58
57
  assetPrefix,
59
- experimental: {
60
- concurrentFeatures: false,
61
- serverComponents: false,
62
- },
63
58
  i18n: {
64
59
  locales: ['en'],
65
60
  defaultLocale: 'en',
@@ -76,7 +76,6 @@ const baseOptions = (buildEnv, isMultiEnv) => ({
76
76
  mode: isDev ? 'development' : 'production',
77
77
  entry: {
78
78
  main: [
79
- !isDev && path_1.join(gduEntryPath, '/spa/set-public-path.js'),
80
79
  path_1.join(gduEntryPath, '/polyfill.js'),
81
80
  path_1.join(gduEntryPath, '/spa/client.js'),
82
81
  ].filter(Boolean),
@@ -282,9 +281,11 @@ const baseOptions = (buildEnv, isMultiEnv) => ({
282
281
  }),
283
282
  ...configs_1.getConfigsDirs().flatMap((configsDir) => [
284
283
  new dotenv_webpack_1.default({
284
+ defaults: true,
285
285
  path: path_1.default.resolve(configsDir, '.env.defaults'),
286
286
  }),
287
287
  new dotenv_webpack_1.default({
288
+ defaults: true,
288
289
  path: path_1.default.resolve(configsDir, `.env.${process.env.APP_ENV || (isDev ? 'dev' : buildEnv)}`),
289
290
  }),
290
291
  ]),
@@ -304,7 +305,9 @@ const makeWebpackConfig = (buildEnv, isMultiEnv) => ({
304
305
  path: `${outputPath}/${!isMultiEnv && buildEnv === 'prod' ? '' : buildEnv}`,
305
306
  publicPath: isDev
306
307
  ? '/'
307
- : (buildEnv === 'prod' ? '#{PUBLIC_PATH_BASE}' : `https://static-mfe-${buildEnv}.autoguru.io/${buildEnv}/`),
308
+ : buildEnv === 'prod'
309
+ ? `#{PUBLIC_PATH_BASE}/${config_1.getProjectFolderName()}/`
310
+ : `https://static-mfe-${buildEnv}.autoguru.io/${config_1.getProjectFolderName()}/`,
308
311
  filename: `${fileMask}.js`,
309
312
  chunkFilename: `chunks/${fileMask}.js`,
310
313
  hashFunction: 'sha256',
@@ -12,3 +12,4 @@ export interface GuruConfig {
12
12
  export declare const getGuruConfig: (location?: string) => GuruConfig | null;
13
13
  export declare const decorateConfig: (guruConfig: Partial<GuruConfig>) => GuruConfig;
14
14
  export declare const getProjectName: (location?: string) => any;
15
+ export declare const getProjectFolderName: (location?: string) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectName = exports.decorateConfig = exports.getGuruConfig = void 0;
3
+ exports.getProjectFolderName = exports.getProjectName = exports.decorateConfig = exports.getGuruConfig = void 0;
4
4
  const path_1 = require("path");
5
5
  const diary_1 = require("diary");
6
6
  const resolve_1 = require("./resolve");
@@ -52,3 +52,5 @@ const decorateConfig = (guruConfig) => {
52
52
  exports.decorateConfig = decorateConfig;
53
53
  const getProjectName = (location = roots_1.PROJECT_ROOT) => require(path_1.join(exports.getGuruConfig(location).__configPath, './package.json')).name;
54
54
  exports.getProjectName = getProjectName;
55
+ const getProjectFolderName = (location = roots_1.PROJECT_ROOT) => path_1.basename(path_1.join(exports.getGuruConfig(location).__configPath));
56
+ exports.getProjectFolderName = getProjectFolderName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdu",
3
- "version": "4.0.8",
3
+ "version": "4.0.12",
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",