Skip to content

Commit f688d68

Browse files
authored
Merge pull request #11 from react18-tools/rewrite
Rewrite
2 parents 9daefd9 + d30d8ae commit f688d68

File tree

271 files changed

+18149
-3465
lines changed

Some content is hidden

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

271 files changed

+18149
-3465
lines changed

.changeset/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
33
"changelog": "@changesets/cli/changelog",
44
"commit": false,
55
"fixed": [],
66
"linked": [],
77
"access": "restricted",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": []
10+
"ignore": ["@example/*"]
1111
}

.deepsource.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version = 1
22

3-
test_patterns = [
4-
"test/**/*.*",
3+
test_patterns = ["**/*.test.*"]
4+
5+
exclude_patterns = [
6+
"docs/**",
57
"**/*.test.*"
68
]
79

8-
exclude_patterns = ["docs/**"]
9-
1010
[[analyzers]]
1111
name = "javascript"
1212

.github/FUNDING.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# These are supported funding model platforms
22

3-
github: [mayank1513] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3+
github: [react18-tools, mayank1513] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
polar: mayank1513
45
patreon: # Replace with a single Patreon username
56
open_collective: # Replace with a single Open Collective username
67
ko_fi: # Replace with a single Ko-fi username

.github/workflows/docs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
if: github.event.repository.owner.login == 'react18-tools'
1111
runs-on: ubuntu-latest
1212
permissions:
13-
packages: write
1413
contents: write
1514
steps:
1615
- uses: actions/checkout@v4
@@ -21,25 +20,26 @@ jobs:
2120
with:
2221
registry-url: https://registry.npmjs.org
2322
node-version: 20
23+
- name: Setup Git
24+
run: |
25+
git config --global user.name "mayank1513"
26+
git config --global user.email "[email protected]"
27+
git fetch
28+
git checkout main
29+
git pull
2430
- run: npm i -g pnpm && pnpm i
2531
name: Install dependencies
2632
- name: Test
2733
run: npm test
2834
- run: git status && git clean -f -d && git status
2935
name: clean up working directory
30-
- run: npx @turbo/codemod update . && pnpm update --latest -w
36+
- run: npx @turbo/codemod update . && pnpm update --latest -r
3137
name: Update dependencies
3238
- run: pnpm build
3339
name: Build all apps to make sure it is not broken due to dependency upgrades
3440
- name: Run unit tests
3541
run: pnpm test
3642
- name: Generate/update docs
3743
run: pnpm doc
38-
- name: Setup Git
39-
run: |
40-
git config --global user.name "react18-tools"
41-
git config --global user.email "[email protected]"
42-
git fetch
43-
git checkout main
4444
- name: Save upgraded packages back to repo
4545
run: git add . && git commit -m "upgrade deps && docs" && git push origin main
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Manually publish to NPM - Apply changeset in the workflow.
2+
3+
# publish only when package json has changed - assuming version upgrade
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
if: github.event.repository.owner.login == 'react18-tools'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
registry-url: https://registry.npmjs.org
24+
- name: Setup Git
25+
run: |
26+
git config --global user.name "mayank1513"
27+
git config --global user.email "[email protected]"
28+
- run: npm i -g pnpm && pnpm i
29+
name: Install dependencies
30+
# fail and not publish if any of the unit tests are failing
31+
- name: Test
32+
run: pnpm test
33+
- name: clean up working directory
34+
run: git status && git clean -f -d && git status
35+
- name: Copy Readme file
36+
run: cp ./README.md ./lib # todo: uncomment this line while rebranding
37+
- name: Apply changesets, publish and create release, branches and tags
38+
run: node ./scripts/manual-publish.js
39+
env:
40+
BRANCH: ${{ github.ref_name }}
41+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,18 @@ name: Publish to NPM
44
on:
55
push:
66
branches: [main]
7-
paths: "lib/nthul/package.json"
7+
paths: "lib/package.json"
88

99
jobs:
1010
publish:
11-
if: github.event.repository.owner.login == 'react18-tools'
11+
# Don't run just after creating repo from template
12+
# Also avoid running after merging set-up PR
13+
if: github.run_number > 2 && github.event.repository.owner.login == 'react18-tools'
1214
runs-on: ubuntu-latest
1315
permissions:
14-
packages: write
1516
contents: write
1617
id-token: write
1718

18-
defaults:
19-
run:
20-
working-directory: ./lib/nthul
21-
2219
steps:
2320
- uses: actions/checkout@v4
2421
with:
@@ -28,47 +25,22 @@ jobs:
2825
with:
2926
node-version: 20
3027
registry-url: https://registry.npmjs.org
28+
- name: Setup Git
29+
run: |
30+
git config --global user.name "mayank1513"
31+
git config --global user.email "[email protected]"
3132
- run: npm i -g pnpm && pnpm i
3233
name: Install dependencies
3334
# fail and not publish if any of the unit tests are failing
3435
- name: Test
3536
run: pnpm test
36-
- name: Create release and publish to NPM
37-
run: pnpm build && pnpm publish-package && node scope.js && pnpm publish-package
38-
# continue on error to publish scoped package name <- by default repo is setup for a non-scoped + scoped package name
39-
continue-on-error: true
40-
env:
41-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
42-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
OWNER: ${{ github.event.repository.owner.login }}
44-
REPO: ${{ github.event.repository.name }}
45-
46-
- name: Publish package with long name for better SEO
47-
continue-on-error: true
48-
run: |
49-
cd dist
50-
sed -i -e "s/.*name.*/\t\"name\": \"nextjs-themes-ultra\",/" package.json
51-
npm publish --provenance --access public
52-
env:
53-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
54-
55-
# Publish lite version
56-
- run: node lite.js && pnpm build && pnpm publish-package && node scope.js && pnpm publish-package
57-
env:
58-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
59-
60-
- name: Publish package with long name for better SEO
61-
continue-on-error: true
62-
run: |
63-
cd dist
64-
sed -i -e "s/.*name.*/\t\"name\": \"nextjs-themes-ultralite\",/" package.json
65-
npm publish --provenance --access public
66-
env:
67-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
68-
69-
- name: Mark scoped package as deprecated
70-
run: |
71-
npm deprecate @mayank1513/nthul "Please use <https://www.npmjs.com/package/nathul> instead. We initially created scoped packages to have similarities with the GitHub Public Repository (which requires packages to be scoped). We are no longer using GPR and thus deprecating all scoped packages for which corresponding un-scoped packages exist."
72-
npm deprecate @mayank1513/nthul-lite "Please use <https://www.npmjs.com/package/nthul-lite> instead. We initially created scoped packages to have similarities with the GitHub Public Repository (which requires packages to be scoped). We are no longer using GPR and thus deprecating all scoped packages for which corresponding un-scoped packages exist."
37+
- name: Copy Readme file
38+
run: cp ./README.md ./lib # will be uncommented while rebranding
39+
- name: Apply changesets, publish and create release, branches and tags
40+
run: node ./scripts/publish.js
7341
env:
42+
BRANCH: ${{ github.ref_name }}
43+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
7444
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,30 @@ on:
77
- cron: "5 */8 * * *"
88
jobs:
99
test:
10+
if: github.run_number != 1
1011
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
1312
steps:
1413
- uses: actions/checkout@v4
1514
- uses: actions/setup-node@v4
1615
with:
1716
node-version: 20
17+
- name: Setup Git
18+
run: |
19+
git config --global user.name "mayank1513"
20+
git config --global user.email "[email protected]"
1821
- run: npm i -g pnpm && pnpm i
1922
name: Install dependencies
2023
- name: Run unit tests
2124
run: pnpm test
2225
- name: Upload coverage reports to Codecov
2326
continue-on-error: true
24-
uses: codecov/codecov-action@v3
27+
uses: codecov/codecov-action@v4
2528
with:
26-
directory: ./lib/nthul
29+
directory: ./lib
2730
token: ${{ secrets.CODECOV_TOKEN }}
28-
flags: nthul
2931
- uses: paambaati/[email protected]
3032
continue-on-error: true
3133
env:
3234
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
3335
with:
34-
coverageLocations: ./lib/nthul/coverage/*.xml:clover
36+
coverageLocations: ./lib/coverage/*.xml:clover

.gitignore

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,16 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
node_modules
5-
.pnp
6-
.pnp.js
7-
8-
# testing
9-
coverage
10-
11-
# next.js
12-
.next/
13-
out/
14-
build
15-
16-
# misc
171
.DS_Store
18-
*.pem
19-
20-
# debug
21-
npm-debug.log*
22-
yarn-debug.log*
23-
yarn-error.log*
24-
25-
# local env files
26-
.env
27-
.env.local
28-
.env.development.local
29-
.env.test.local
30-
.env.production.local
31-
32-
# turbo
2+
node_modules
333
.turbo
4+
*.log
5+
.next
6+
dist
7+
dist-ssr
8+
*.local
9+
.env
10+
.cache
3411

35-
# vercel
36-
.vercel
12+
# test coverage
13+
coverage
3714

38-
# lock files
39-
*lock*
15+
# temporary files
16+
tsup.config.bundled*

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
# ignore hbs files as prettier removes all spaces and makes it ugly
44
*hbs
55
docs
6+
.vscode

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"singleQuote": false,
3-
"printWidth": 120,
3+
"printWidth": 100,
44
"tabWidth": 2,
55
"arrowParens": "avoid",
66
"jsxBracketSameLine": true,

0 commit comments

Comments
 (0)