Skip to content

Commit d344ad1

Browse files
committed
feat!: pull in the latest MakerX template changes
BREAKING CHANGE: What the package comprises has changed a little. - CJS and ESM are now dual targeted - Dependencies have been updated # Conflicts: # .github/workflows/pr.yml # eslint.config.mjs # package-lock.json # package.json # src/data-builder.ts # src/deep-clone.ts # tsconfig.json
1 parent 2a4443e commit d344ad1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+12511
-33195
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,17 @@ assignees: ''
77

88
---
99

10-
## Current Behavior
10+
## Issue
1111

12-
<!-- Describe how the issue manifests -->
12+
<!-- What is happening? -->
1313

14-
## Expected Behavior
14+
## Steps to Reproduce
1515

16-
<!-- Describe what the desired behaviour would be -->
17-
18-
## Steps to Reproduce the Problem
19-
20-
1.
21-
2.
16+
1.
17+
2.
2218

2319
## Environment
2420

25-
- Version: <!-- Version set in package.json -->
26-
- Platform: <!-- Win/Mac/Linux -->
27-
- Node.js Version: <!-- Output of running `node -v` -->
21+
- Version: <!-- Version in package.json -->
22+
- OS: <!-- Win/Mac/Linux -->
23+
- Node.js: <!-- `node -v` -->
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
---
2-
name: 🌈 Feature request
3-
about: Suggest an amazing new idea for this project
2+
name: 🌈 Feature Request
3+
about: Suggest a new idea for this project
44
title: ''
55
labels: enhancement
66
assignees: ''
7-
87
---
98

109
## Feature Request
1110

12-
**Is your feature request related to a problem? Please describe**
13-
14-
<!-- A clear and concise description of what the problem is. Ex. I have an issue when [...] -->
11+
**Problem**
1512

16-
**Describe the solution you'd like**
13+
<!-- Briefly describe the problem -->
1714

18-
<!-- A clear and concise description of what you want to happen. Add any considered drawbacks -->
15+
**Solution**
1916

20-
**Describe alternatives you've considered**
17+
<!-- Briefly describe the desired solution -->
2118

22-
<!-- A clear and concise description of any alternative solutions or features you've considered -->
19+
**Alternatives**
2320

24-
## Are you willing to resolve this issue by submitting a Pull Request?
21+
<!-- Briefly describe any alternative solutions considered -->
2522

26-
<!--
27-
Remember that first-time contributors are welcome! 🙌
28-
-->
23+
## Willing to Submit a Pull Request?
2924

30-
- [ ] Yes, I have the time, and I know how to start 💪
31-
- [ ] Yes, I have the time, but I don't know how to start. I would need guidance 🤗
32-
- [ ] No, I don't have the time, although I believe I could do it if I had the time... 😧
33-
- [ ] No, I don't have the time, and I wouldn't even know how to start 🙏
25+
- [ ] Yes, I have the time and know how to start
26+
- [ ] Yes, I have the time but need guidance
27+
- [ ] No, I don't have the time
3428

35-
<!--
36-
👋 Have a great day, and thank you for the feature request!
37-
-->
29+
<!-- Thank you for your feature request! -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,12 @@
1-
<!--
2-
😀 Wonderful! Thank you for opening a pull request
3-
4-
Please fill in the information below to expedite the review
5-
and (hopefully) merge of your change
6-
-->
7-
81
### Description of change
92

103
<!--
11-
Please be clear and concise about what the change is intended to do,
12-
why this change is needed, and how you've verified that it
13-
corrects what you intended
14-
15-
In some cases, it may be helpful to include the current behaviour
16-
and the new behaviour
17-
18-
If the change is related to an open issue, you can link it here.
19-
If you include `Fixes #0000` (replacing `0000` with the issue number)
20-
when this is merged it will automatically mark the issue as fixed and
21-
close it
22-
-->
23-
24-
### Pull-Request Checklist
25-
26-
<!--
27-
Please make sure to review and check the following
28-
29-
If an item is not applicable, you can add "N/A" to the end
4+
Briefly describe the change and why it's needed. If it addresses an issue, link it using `Closes #0000` or `Fixes #0000`.
305
-->
316

32-
- [ ] Code is up-to-date with the `main` branch
33-
- [ ] `npm run lint` passes with this change
34-
- [ ] `npm test` passes with this change
35-
- [ ] `npm commitlint` passes with this change
36-
- [ ] This pull request links relevant issues as `Fixes #0000`
37-
- [ ] There are new or updated unit tests validating the change
38-
- [ ] Documentation has been updated to reflect this change
39-
40-
<!--
41-
🎉 Thank you for contributing!
42-
-->
7+
### Checklist (check all that apply)
8+
- [ ] Links relevant issues as `Fixes #0000`
9+
- [ ] New or updated unit tests added
10+
- [ ] Documentation updated
4311

44-
**_Please note that this repository uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) in combination with [semantic-release](https://github.com/semantic-release/semantic-release) to automate package publication. Therefore, your commit messages are critical, and the build process will lint them. If the build fails at the commitlint stage, please refer to this [handy guide](https://www.git-tower.com/learn/git/faq/edit-fix-commit-message) on how to update the commit messages_**
12+
**_Please note: This repository uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) and [semantic-release](https://github.com/semantic-release/semantic-release). Commit messages are critical; refer to [this guide](https://www.git-tower.com/learn/git/faq/edit-fix-commit-message) if the build fails at the commitlint stage._**

.github/workflows/pr.yml

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,35 @@ on:
44
pull_request:
55
branches: [ 'main' ]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
8-
build:
11+
pull_request:
12+
uses: makerxstudio/shared-config/.github/workflows/node-ci.yml@main
13+
with:
14+
node-version: lts/*
15+
working-directory: ./
16+
run-commit-lint: true
17+
run-build: true
18+
check_docs:
19+
name: Check code docs
920
runs-on: ubuntu-latest
10-
11-
strategy:
12-
matrix:
13-
node-version: [ 18.x ]
14-
15-
name: Build and test with Node ${{ matrix.node-version }}
1621
steps:
17-
- name: Checkout source code
18-
uses: actions/checkout@v3
22+
- name: Clone repository
23+
uses: actions/checkout@v4
1924
with:
20-
fetch-depth: 0
21-
22-
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
25+
fetch-depth: 1
26+
- name: Use Node.js lts/*
27+
uses: actions/setup-node@v4
2428
with:
25-
node-version: ${{ matrix.node-version }}
26-
# == Cache frequently built and/or with large dependencies ==
27-
# == Eviction policy: not accessed in over 7 days
28-
# == Limit: 10 GB
29-
# cache: 'npm'
30-
# == Path to lock file when using mono repos ==
31-
# cache-dependency-path: subdir/package-lock.json
32-
33-
- name: Restore packages
34-
run: npm ci -f
35-
36-
- name: Lint commit messages
37-
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
38-
39-
- name: Build package
40-
run: npm run build
41-
42-
- name: Generate website
43-
run: npm run generate-website
44-
45-
- name: Run tests
46-
run: npm test
29+
node-version: lts/*
30+
- name: Check docs are up to date
31+
shell: bash
32+
run: |
33+
npm ci --ignore-scripts
34+
npm run generate:code-docs
35+
# Add untracked files as empty so they come up in diff
36+
git add -N .
37+
# Print changed files and error out if there are changes after generating docs
38+
git diff --exit-code --name-only

.github/workflows/release.yml

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,85 @@ on:
33
push:
44
branches:
55
- main
6+
workflow_dispatch:
7+
8+
concurrency: release
69

710
permissions:
811
contents: write
12+
issues: read
913

1014
jobs:
11-
release:
15+
ci:
16+
name: Continuous Integration
17+
uses: makerxstudio/shared-config/.github/workflows/node-ci.yml@main
18+
with:
19+
node-version: lts/*
20+
working-directory: ./
21+
run-commit-lint: true
22+
23+
check_docs:
24+
name: Check code docs
1225
runs-on: ubuntu-latest
26+
steps:
27+
- name: Clone repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 1
31+
- name: Check docs are up to date
32+
shell: bash
33+
run: |
34+
npm ci --ignore-scripts
35+
npm run generate:code-docs
36+
# Add untracked files as empty so they come up in diff
37+
git add -N .
38+
# Print changed files and error out if there are changes after generating docs
39+
git diff --exit-code --name-only
40+
41+
build:
42+
name: Build
43+
uses: makerxstudio/shared-config/.github/workflows/node-build-zip.yml@main
44+
needs:
45+
- ci
46+
- check_docs
47+
with:
48+
node-version: lts/*
49+
build-path: dist
50+
artifact-name: package
1351

14-
name: Release package to NPM
52+
release:
53+
name: Release
54+
needs: build
55+
runs-on: ubuntu-latest
1556
steps:
16-
- name: Checkout source code
17-
uses: actions/checkout@v3
57+
- name: Clone repository
58+
uses: actions/checkout@v4
1859
with:
1960
fetch-depth: 0
2061

21-
- name: Use Node.js latest LTS version
22-
uses: actions/setup-node@v3
62+
# semantic-release needs node 20
63+
- name: Use Node.js lts/*
64+
uses: actions/setup-node@v4
2365
with:
2466
node-version: lts/*
25-
# == Cache frequently built and/or with large dependencies ==
26-
# == Eviction policy: not accessed in over 7 days
27-
# == Limit: 10 GB
28-
# cache: 'npm'
29-
# == Path to lock file when using mono repos ==
30-
# cache-dependency-path: subdir/package-lock.json
31-
32-
- name: Restore packages
33-
run: npm ci -f
3467

35-
- name: Lint commit messages
36-
run: npx commitlint --from ${{ github.event.before }} --to ${{ github.event.head }} --verbose
68+
- name: Download built package
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: package
72+
path: artifacts
3773

38-
- name: Build package
39-
run: npm run build
74+
- name: Unzip package
75+
shell: bash
76+
run: |
77+
mkdir -p dist
78+
unzip -q "artifacts/package.zip" -d dist
4079
41-
- name: Run tests
42-
run: npm test
80+
- name: Install dependencies to get semantic release components and plugins
81+
run: npm ci --ignore-scripts
4382

44-
- name: Release package
83+
- name: 'Semantic release'
84+
run: npx semantic-release
4585
env:
4686
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4787
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
48-
run: npx semantic-release

.prettierignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# don't ever format node_modules
2+
node_modules
3+
# don't lint format output (make sure it's set to your correct build folder name)
4+
dist
5+
build
6+
# don't format nyc coverage output
7+
coverage
8+
# don't format generated types
9+
**/generated/types.d.ts
10+
**/generated/types.ts
11+
# don't format ide files
12+
.idea

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.prettierrc.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import prettierConfig from '@makerx/prettier-config'
2+
3+
export default {
4+
...prettierConfig,
5+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Try it out on [StackBlitz](https://stackblitz.com/edit/node-au9p8x?file=shape.sp
153153

154154
## Random Data Builders
155155

156-
Dossier comes with a variety of random data builders - View detailed function descriptions includes arguments in the [code docs](https://makerxstudio.github.io/ts-dossier/docs/modules~data_utilties).
156+
Dossier comes with a variety of random data builders - View detailed function descriptions includes arguments in the [code docs](./docs/README.md).
157157

158158
| Name | Function | Other |
159159
|---------------------------|---------------------|------------------------------------------------------------------------------|
@@ -176,7 +176,7 @@ Dossier comes with a variety of random data builders - View detailed function de
176176

177177
[build-img]:https://github.com/MakerXStudio/ts-dossier/actions/workflows/release.yml/badge.svg
178178
[build-url]:https://github.com/MakerXStudio/ts-dossier/actions/workflows/release.yml
179-
[downloads-img]:https://img.shields.io/npm/dt/@MakerXStudio/ts-dossier
179+
[downloads-img]:https://img.shields.io/npm/dm/@MakerXStudio/ts-dossier
180180
[downloads-url]:https://www.npmtrends.com/@makerx/ts-dossier
181181
[npm-img]:https://img.shields.io/npm/v/@makerx/ts-dossier
182182
[npm-url]:https://www.npmjs.com/package/@makerx/ts-dossier

commitlint.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
module.exports = {
22
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
// Allow sentence case commit messages
5+
'subject-case': [1, 'always', ['lower-case', 'pascal-case', 'upper-case']],
6+
'type-empty': [1, 'never'],
7+
'subject-empty': [1, 'never'],
8+
'body-leading-blank': [0, 'always'],
9+
'body-max-line-length': [1, 'always', 200],
10+
'header-max-length': [1, 'always', 150],
11+
'footer-max-length': [1, 'always', 150],
12+
'footer-max-line-length': [1, 'always', 150],
13+
},
314
}

0 commit comments

Comments
 (0)