Skip to content

Commit

Permalink
Remove support for the env config property
Browse files Browse the repository at this point in the history
  • Loading branch information
askoufis committed Apr 10, 2024
1 parent f32981a commit a4ab669
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 55 deletions.
11 changes: 11 additions & 0 deletions .changeset/loud-trees-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'sku': major
---

Remove support for the `env` config property

This config property was deprecated in sku v7.0.0 in favour of the `environments` property.
It has been removed in this release.
Please see the [sku v7 migration guide] for more information.

[sku v7 migration guide]: https://github.com/seek-oss/sku/blob/f37ea1dcbe2d6403bba6897c7a9e0cb9b231c74c/docs/migration-guides/v7.0.0.md#env
11 changes: 0 additions & 11 deletions packages/sku/config/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const { VocabWebpackPlugin } = require('@vocab/webpack');

const utils = require('./utils');
const { cwd } = require('../../lib/cwd');
const { stringifyEnvarValues } = require('../../lib/env');

const renderEntry = require.resolve('../../entry/render');
const libraryRenderEntry = require.resolve('../../entry/libraryRender');
Expand All @@ -27,7 +26,6 @@ const modules = require('./resolveModules');

const {
paths,
env,
webpackDecorator,
polyfills,
isLibrary,
Expand All @@ -42,10 +40,8 @@ const {
externalizeNodeModules,
} = config;

// port is only required for dev builds
const makeWebpackConfig = ({
isIntegration = false,
port = 0,
isDevServer = false,
htmlRenderPlugin,
metrics = false,
Expand All @@ -57,11 +53,6 @@ const makeWebpackConfig = ({

const vocabOptions = getVocabConfig();

const envars = stringifyEnvarValues({
...env,
PORT: port,
});

const resolvedPolyfills = polyfills.map((polyfill) => {
return require.resolve(polyfill, { paths: [cwd()] });
});
Expand Down Expand Up @@ -201,7 +192,6 @@ const makeWebpackConfig = ({
...(isDevServer || isIntegration
? []
: [bundleAnalyzerPlugin({ name: 'client' })]),
new webpack.DefinePlugin(envars),
new webpack.DefinePlugin({
__SKU_CLIENT_PATH__: JSON.stringify(
path.relative(cwd(), paths.clientEntry),
Expand Down Expand Up @@ -290,7 +280,6 @@ const makeWebpackConfig = ({
},
plugins: [
...(htmlRenderPlugin ? [htmlRenderPlugin.rendererPlugin] : []),
new webpack.DefinePlugin(envars),
new webpack.DefinePlugin({
__SKU_LIBRARY_NAME__: JSON.stringify(libraryName),
__SKU_LIBRARY_FILE__: JSON.stringify(libraryFile),
Expand Down
6 changes: 0 additions & 6 deletions packages/sku/config/webpack/webpack.config.ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ const { VocabWebpackPlugin } = require('@vocab/webpack');
const { bundleAnalyzerPlugin } = require('./plugins/bundleAnalyzer');
const utils = require('./utils');
const { cwd } = require('../../lib/cwd');
const { stringifyEnvarValues } = require('../../lib/env');
const {
paths,
env,
webpackDecorator,
polyfills,
supportedBrowsers,
Expand Down Expand Up @@ -47,8 +45,6 @@ const makeWebpackConfig = ({

const vocabOptions = getVocabConfig();

const envars = stringifyEnvarValues(env);

const internalInclude = [path.join(__dirname, '../../entry'), ...paths.src];

const resolvedPolyfills = polyfills.map((polyfill) => {
Expand Down Expand Up @@ -152,7 +148,6 @@ const makeWebpackConfig = ({
],
},
plugins: [
new webpack.DefinePlugin(envars),
new LoadablePlugin({
filename: webpackStatsFilename,
writeToDisk: true,
Expand Down Expand Up @@ -247,7 +242,6 @@ const makeWebpackConfig = ({
rules: [{ test: /\.mjs$/, type: 'javascript/auto' }],
},
plugins: [
new webpack.DefinePlugin(envars),
new webpack.DefinePlugin({
__SKU_DEFAULT_SERVER_PORT__: JSON.stringify(serverPort),
__SKU_PUBLIC_PATH__: JSON.stringify(publicPath),
Expand Down
3 changes: 0 additions & 3 deletions packages/sku/context/configSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ module.exports = validator.compile({
items: 'string',
min: 1,
},
env: {
type: 'object',
},
compilePackages: {
type: 'array',
items: 'string',
Expand Down
1 change: 0 additions & 1 deletion packages/sku/context/defaultSkuConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module.exports = {
transformOutputPath: ({ environment = '', site = '', route = '' }) =>
path.join(environment, site, route),
srcPaths: ['./src'],
env: {},
compilePackages: [],
hosts: ['localhost'],
port: 8080,
Expand Down
1 change: 0 additions & 1 deletion packages/sku/context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ const paths = {

module.exports = {
paths,
env: skuConfig.env,
locales: skuConfig.locales,
hosts: skuConfig.hosts,
port: {
Expand Down
32 changes: 0 additions & 32 deletions packages/sku/lib/env.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/sku/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const hot = process.env.SKU_HOT !== 'false';
const htmlRenderPlugin = createHtmlRenderPlugin();

const [clientWebpackConfig, renderWebpackConfig] = makeWebpackConfig({
port: availablePort,
isDevServer: true,
htmlRenderPlugin,
metrics: true,
Expand Down

0 comments on commit a4ab669

Please sign in to comment.