Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Update to node 18 and migrate to SWC #27

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.12.1]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.12.1'

- run: npm ci
- run: npm run build
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.12.1
11 changes: 11 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true,
"decorators": true,
"dynamicImport": true
}
}
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///home/hamza/projects/webpack-typescript-starter/.github/workflows/deploy.yml"
}
}
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM node:lts AS compile-image
FROM node:18.12.1 AS build

LABEL name="Webpack starter" \

LABEL name="Webpack typescript starter" \
description="This image is for webpack typescript starter."

WORKDIR /app
Expand All @@ -13,4 +14,4 @@ RUN npm run build

FROM nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=compile-image /app/dist /usr/share/nginx/html
COPY --from=build /app/dist /usr/share/nginx/html
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<a href="https://app.netlify.com/sites/webpack-typescript-starter/deploys">
<img src="https://api.netlify.com/api/v1/badges/a3caceb4-756f-42ae-913c-96700a2100a2/deploy-status" alt="Build Status">
</a>

</p>

Webpack typescript starter with:

- Webpack 5
- Typescript
- Scss
- Ts-jest
- SCSS
- SWC (Speedy Web Compiler)
- SWC/jest
- Eslint

## [Demo](https://webpack-typescript-starter.netlify.app/)
Expand All @@ -39,6 +39,8 @@ npm install
npm start
```

The application will be available at http://localhost:4200

### Build your application

```bash
Expand All @@ -64,3 +66,5 @@ Or simply run the example using docker:
```bash
docker-compose up
```

The application will be available at http://localhost:4000
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '3.5'
services:
front-application:
container_name: webpack-starter-container
webpack-typescript-starter:
build:
context: .
dockerfile: Dockerfile
Expand Down
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: ['<rootDir>/src'],
collectCoverageFrom: ['src/components/**/*.{js,jsx,ts,tsx}'],
Expand All @@ -8,4 +7,7 @@ module.exports = {
'<rootDir>/jest-config/file-mock.js',
'\\.(css|scss|sass|less)$': 'identity-obj-proxy',
},
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
};
Loading