Skip to content

Commit dd88f86

Browse files
authored
Merge pull request #30 from react18-tools/rewrite
Rewrite
2 parents d2266dc + 6cffb28 commit dd88f86

File tree

360 files changed

+16049
-6355
lines changed

Some content is hidden

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

360 files changed

+16049
-6355
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +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",
4+
"commit": ["@changesets/cli/commit", { "skipCI": false }],
45
"fixed": [],
56
"linked": [],
6-
"access": "restricted",
7+
"access": "public",
78
"baseBranch": "main",
89
"updateInternalDependencies": "patch",
9-
"ignore": []
10+
"ignore": ["@example/*"]
1011
}

.deepsource.toml

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
version = 1
22

3+
test_patterns = ["**/*.test.*"]
4+
5+
exclude_patterns = [
6+
"docs/**",
7+
"**/*.test.*"
8+
]
9+
310
[[analyzers]]
411
name = "javascript"
512

613
[analyzers.meta]
714
plugins = ["react"]
815
environment = [
916
"nodejs",
10-
"browser",
11-
"vitest"
12-
]
17+
"vitest",
18+
"browser"
19+
]
20+
21+
[[transformers]]
22+
name = "prettier"

.eslintrc.js

-10
This file was deleted.

.github/FUNDING.yml

+2-1
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/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ""
5-
labels: bug
5+
labels: ""
66
assignees: ""
77
---
88

.github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: ""
5-
labels: enhancement
5+
labels: ""
66
assignees: ""
77
---
88

.github/workflows/docs.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ on:
44
push:
55
branches: [main]
66
schedule:
7-
- cron: "0 0 */2 * *"
7+
- cron: "0 */8 * * *"
88
jobs:
9-
doc:
9+
generate-docs:
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 "mayank.srmu@gmail.com"
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
28-
- run: git status && git clean -f -d && git status
34+
- run: git stash --include-untracked
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 "mayank1513"
41-
git config --global user.email "mayank.srmu@gmail.com"
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

.github/workflows/manual-publish.yml

+44
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 "mayank.srmu@gmail.com"
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

+17-27
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,43 @@ name: Publish to NPM
44
on:
55
push:
66
branches: [main]
7-
paths: "lib/nextjs-themes/package.json"
8-
workflow_dispatch:
7+
paths: "lib/package.json"
98

109
jobs:
1110
publish:
12-
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'
1314
runs-on: ubuntu-latest
1415
permissions:
15-
packages: write
1616
contents: write
1717
id-token: write
1818

19-
defaults:
20-
run:
21-
working-directory: ./lib/nextjs-themes
22-
2319
steps:
2420
- uses: actions/checkout@v4
2521
with:
2622
token: ${{ secrets.GITHUB_TOKEN }}
2723

2824
- uses: actions/setup-node@v4
2925
with:
30-
registry-url: https://registry.npmjs.org
3126
node-version: 20
27+
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 "mayank.srmu@gmail.com"
3232
- run: npm i -g pnpm && pnpm i
3333
name: Install dependencies
3434
# fail and not publish if any of the unit tests are failing
3535
- name: Test
3636
run: pnpm test
37-
- name: Create release and Publish to NPM
38-
run: pnpm build && pnpm publish-package && node scope.js && pnpm publish-package
39-
env:
40-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
41-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
OWNER: ${{ github.event.repository.owner.login }}
43-
REPO: ${{ github.event.repository.name }}
44-
45-
# Publish lite version
46-
- run: node lite.js && pnpm build && pnpm publish-package && node scope.js && pnpm publish-package
47-
env:
48-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
49-
OWNER: ${{ github.event.repository.owner.login }}
50-
51-
- name: Mark scoped package as deprecated
52-
run: |
53-
npm deprecate @mayank1513/nextjs-themes "Please use https://www.npmjs.com/package/nextjs-themes 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."
54-
npm deprecate @mayank1513/nextjs-themes-lite "Please use https://www.npmjs.com/package/nextjs-themes-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
5541
env:
42+
BRANCH: ${{ github.ref_name }}
43+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
5644
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+9-12
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,29 @@ on:
44
push:
55
pull_request:
66
schedule:
7-
- cron: "0 */8 * * *"
8-
7+
- cron: "5 */8 * * *"
98
jobs:
109
test:
10+
if: github.run_number != 1
1111
runs-on: ubuntu-latest
12-
13-
defaults:
14-
run:
15-
working-directory: ./lib/nextjs-themes
1612
steps:
1713
- uses: actions/checkout@v4
1814
- uses: actions/setup-node@v4
1915
with:
2016
node-version: 20
21-
registry-url: https://registry.npmjs.org
2217
- run: npm i -g pnpm && pnpm i
2318
name: Install dependencies
24-
- name: Test
25-
run: npm test
19+
- name: Run unit tests
20+
run: pnpm test
2621
- name: Upload coverage reports to Codecov
22+
continue-on-error: true
2723
uses: codecov/codecov-action@v4
28-
env:
29-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
24+
with:
25+
directory: ./lib
26+
token: ${{ secrets.CODECOV_TOKEN }}
3027
- uses: paambaati/codeclimate-action@v5.0.0
3128
continue-on-error: true
3229
env:
3330
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
3431
with:
35-
coverageLocations: ./lib/nextjs-themes/coverage/*.xml:clover
32+
coverageLocations: ./lib/coverage/*.xml:clover

.gitignore

+12-38
Original file line numberDiff line numberDiff line change
@@ -1,42 +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
34-
35-
# vercel
36-
.vercel
37-
38-
# build
4+
*.log
5+
.next
396
dist
7+
dist-ssr
8+
*.local
9+
.env
10+
.cache
11+
12+
# test coverage
13+
coverage
4014

41-
# lock files
42-
*lock*
15+
# temporary files
16+
tsup.config.bundled*

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
*lock.*
2+
3+
# ignore hbs files as prettier removes all spaces and makes it ugly
4+
*hbs
25
docs
6+
.vscode

.prettierrc

+1-1
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)