Skip to content

Commit

Permalink
Removed .env configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosomb committed May 21, 2024
1 parent 0006167 commit c610683
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 29 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Copy Webpack config
run: cp ./webpack/.env-example ./webpack/.env

- name: Build assets
run: npm run build

Expand Down Expand Up @@ -96,4 +93,4 @@ jobs:
upload_url: ${{ steps.release_info.outputs.upload_url }}
asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
node-version: 16

- name: Lint js
run: touch ./webpack/.env && npm ci && npm run lint
run: npm ci && npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
node-version: 16

- name: Build and check types
run: touch ./webpack/.env && npm ci && npm run build
run: npm ci && npm run build
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
assets
.env
coverage
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ First you need to install every node module:

`npm ci`

then create a `.env` file inside the *webpack* folder by copying `webpack/.env-example` and complete it with your environment's informations. Please use a free tcp port.

then build assets:

`npm run build`
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ First you need to install every node module:

`npm ci`

then create a `.env` file inside the *webpack* folder by copying `webpack/.env-example` and complete it with your environment's informations. Please use a free tcp port.

then build assets:

`npm run build`
Expand Down
4 changes: 0 additions & 4 deletions webpack/.env-example

This file was deleted.

4 changes: 0 additions & 4 deletions webpack/.env-no-vhost-example

This file was deleted.

11 changes: 1 addition & 10 deletions webpack/webpack.vars.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
const fs = require('fs');
const path = require('path');

const publicPath = '/themes/hummingbird/assets/';
const themeDev = path.resolve(__dirname, '../src');
const envFilePath = './webpack/.env';

if (fs.existsSync(envFilePath)) {
require('dotenv').config({path: envFilePath});
} else {
console.error('\x1b[41m\x1b[37m%s\x1b[0m', 'Your .env file not exits. Read getting started section in documentation for more information https://github.com/PrestaShop/hummingbird?tab=readme-ov-file#how-to-build-assets/.');
process.exit();
}

const {
PORT: port,
PUBLIC_PATH: publicPath,
SERVER_ADDRESS: serverAddress,
SITE_URL: siteURL,
} = process.env;
Expand Down

0 comments on commit c610683

Please sign in to comment.