Skip to content
Open
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
5 changes: 1 addition & 4 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ jobs:
run: npm install

- name: Build library
run: npx nx build halstack-react-hal

- name: Copy README
run: npx nx run copy
run: npm run build

- name: Publish NEXT version to npm
run: |
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ jobs:
run: npm install

- name: Serve test server
run: npx nx serve-test halstack-react-hal
run: npm run serve-server

- name: Test lib
run: npx nx test halstack-react-hal
run: npm run test

- name: Stop json-server
run: kill $(lsof -t -i:3000)

- name: Build library
run: npx nx build halstack-react-hal

- name: Copy README
run: npx nx run copy
run: npm run build

- name: Publish RELEASE to npm
run: |
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ jobs:
run: npm install

- name: Serve test server
run: npx nx serve-test halstack-react-hal
run: npm run serve-server

- name: Test lib
run: npx nx test halstack-react-hal
run: npm run test

- name: Stop json-server
run: kill $(lsof -t -i:3000)

- name: Build library
run: npx nx build halstack-react-hal

- name: Copy README
run: npx nx run copy
run: npm run build
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"printWidth": 100
"printWidth": 120,
"trailingComma": "es5"
}
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Halstack React HAL
# Halstack React HAL

Halstack React HAL is an npm library of reusable React components. It brings together two different responsibilities:

Expand Down Expand Up @@ -159,44 +159,44 @@ These instructions will get you a copy of the project up and running on your loc

The project is divided in two main folders. One is for the actual library, and the other one is a React application using the library.

### Project
### Run the example app

Install the dependencies for the library and the example project.
1. Install the dependencies of the library and the example app:

```bash
npm install
npm i && cd example-app && npm i && cd ..
```

### Library

Contained in the `lib` folder.

Run the build process updating the bundled files inside the dist folder.
2. Link the library to the example app from root:

```bash
nx build halstack-react-hal #`npx nx build halstack-react-hal` if nx is not recognized as a command.
npm run link
```

To run the tests you need to serve the mock API first
3. Build the library from root and watch for the changes:

```bash
nx serve-test halstack-react-hal #`npx nx serve-test halstack-react-hal` if nx is not recognized as a command.
npm run build:watch
```

and then you can run the tests.
4. Run the example app from root:

```bash
nx test halstack-react-hal #`npx nx test halstack-react-hal` if nx is not recognized as a command.
npm run dev
```

### Example Application
### Run the tests

1. Run mock server:

Contained in the `app` folder.
```bash
npm run serve-server
```

Start the application.
2. Run tests:

```bash
nx serve app #`npx nx serve app` if nx is not recognized as a command.
npm run test
```

Now, anytime you make a change to the library or the app, `nx` will live-reload your local dev server so you can iterate on your component in real-time.
19 changes: 0 additions & 19 deletions app/.babelrc

This file was deleted.

18 changes: 0 additions & 18 deletions app/.eslintrc.json

This file was deleted.

24 changes: 24 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Example app</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
11 changes: 0 additions & 11 deletions app/jest.config.ts

This file was deleted.

Loading