-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3d8b6b8
Showing
48 changed files
with
13,051 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
chrome >= 51 | ||
edge >= 15 | ||
firefox >= 54 | ||
safari >= 10 | ||
ios_saf >= 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['eslint-config-ts'], | ||
rules: { | ||
singleQuote: true, | ||
'@typescript-eslint/ban-types': 'off', | ||
'no-unused-variable': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Deploy Next.js site to Pages | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Detect package manager | ||
id: detect-package-manager | ||
run: | | ||
if [ -f "${{ github.workspace }}/package.json" ]; then | ||
echo "manager=npm" >> $GITHUB_OUTPUT | ||
echo "command=ci" >> $GITHUB_OUTPUT | ||
echo "runner=npx --no-install" >> $GITHUB_OUTPUT | ||
exit 0 | ||
else | ||
echo "Unable to determine package manager" | ||
exit 1 | ||
fi | ||
- name: Cache pnpm modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-pnpm-modules | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: latest | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pnpm install | ||
- name: Build with Next.js | ||
run: pnpm run build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./out | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: out # The folder the action should deploy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.DS_Store | ||
|
||
.pnp | ||
.pnp.js | ||
.env.local | ||
.env.*.local | ||
.history | ||
*.log* | ||
|
||
node_modules/ | ||
.yarn-integrity | ||
.pnpm-store/ | ||
*.tsbuildinfo | ||
.eslintcache | ||
.changeset/pre.json | ||
|
||
dist/** | ||
coverage/ | ||
release/ | ||
output/ | ||
output_resource/ | ||
log/ | ||
|
||
.vscode/**/* | ||
!.vscode/settings.json | ||
!.vscode/extensions.json | ||
.idea/ | ||
|
||
**/*/typings/auto-generated | ||
|
||
modern.config.local.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no-install lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
strict-peer-dependencies=false | ||
registry=https://registry.npmjs.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lts/hydrogen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"recommendations": [ | ||
"styled-components.vscode-styled-components", | ||
"EditorConfig.editorconfig", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"streetsidesoftware.code-spell-checker", | ||
"codezombiech.gitignore", | ||
"aaron-bond.better-comments", | ||
"jasonnutter.search-node-modules", | ||
"jock.svg", | ||
"mikestead.dotenv", | ||
"vscode-icons-team.vscode-icons" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"files.associations": { | ||
".code-workspace": "jsonc", | ||
".eslintrc": "jsonc", | ||
".eslintrc*.json": "jsonc", | ||
".stylelintrc": "jsonc", | ||
"stylelintrc": "jsonc", | ||
"README": "markdown" | ||
}, | ||
"search.useIgnoreFiles": true, | ||
"search.exclude": { | ||
"**/dist": true, | ||
"**/*.log": true, | ||
"**/*.pid": true, | ||
"**/.git": true, | ||
"**/node_modules": true | ||
}, | ||
// | ||
"editor.rulers": [80, 120], | ||
"files.eol": "\n", | ||
"files.trimTrailingWhitespace": true, | ||
"files.insertFinalNewline": true, | ||
// | ||
"cSpell.diagnosticLevel": "Hint", | ||
"eslint.run": "onType", | ||
"eslint.probe": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"vue" | ||
], | ||
"eslint.format.enable": true, | ||
"eslint.lintTask.enable": true, | ||
"javascript.validate.enable": false, | ||
"typescript.validate.enable": true, | ||
"css.validate": false, | ||
"scss.validate": false, | ||
"less.validate": false, | ||
"[css]": { | ||
"editor.formatOnType": true, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true | ||
}, | ||
"[scss]": { | ||
"editor.formatOnType": true, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true | ||
}, | ||
"[less]": { | ||
"editor.formatOnType": true, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"javascript.format.enable": false, | ||
"typescript.format.enable": false, | ||
// | ||
"json.format.enable": false, | ||
"[json]": { | ||
"editor.tabSize": 2, | ||
"editor.formatOnType": true, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true | ||
}, | ||
"[jsonc]": { | ||
"editor.tabSize": 2, | ||
"editor.formatOnType": true, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true | ||
}, | ||
"emmet.triggerExpansionOnTab": true, | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Modern.js App | ||
|
||
## Setup | ||
|
||
Install the dependencies: | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
## Get Started | ||
|
||
Start the dev server: | ||
|
||
```bash | ||
pnpm dev | ||
``` | ||
|
||
Enable optional features or add a new entry: | ||
|
||
```bash | ||
pnpm new | ||
``` | ||
|
||
Build the app for production: | ||
|
||
```bash | ||
pnpm build | ||
``` | ||
|
||
Preview the production build locally: | ||
|
||
```bash | ||
pnpm serve | ||
``` | ||
|
||
For more information, see the [Modern.js documentation](https://modernjs.dev/en). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
declare module '*.css' { | ||
const classes: { readonly [key: string]: string }; | ||
export default classes; | ||
} | ||
|
||
declare module '*.scss' { | ||
const classes: { readonly [key: string]: string }; | ||
export default classes; | ||
} | ||
|
||
declare module '*.sass' { | ||
const classes: { readonly [key: string]: string }; | ||
export default classes; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import * as path from 'path'; | ||
import * as fs from 'fs'; | ||
|
||
let counter = 2; | ||
|
||
const traverseFolder = (folderPath, parentName = '') => { | ||
const files = fs.readdirSync(folderPath); | ||
const tree = []; | ||
|
||
for (const file of files) { | ||
const filePath = path.join(folderPath, file); | ||
const stats = fs.statSync(filePath); | ||
|
||
if (stats.isDirectory()) { | ||
const children = traverseFolder( | ||
filePath, | ||
parentName ? `${parentName}/${file}` : file, | ||
counter, | ||
); | ||
|
||
const node = { | ||
label: file, | ||
key: `${counter++}`, | ||
path: parentName ? `/${parentName}/${file}` : `/${file}`, | ||
// path: filePath, | ||
}; | ||
|
||
if (children.length) { | ||
node.children = children; | ||
} | ||
|
||
tree.push(node); | ||
} | ||
} | ||
|
||
return tree; | ||
}; | ||
|
||
(() => { | ||
const folderPath = path.resolve('./src/routes'); | ||
const result = traverseFolder(folderPath); | ||
|
||
result.unshift({ | ||
key: '1', | ||
label: 'home', | ||
path: '/', | ||
}); | ||
|
||
const folder = path.resolve('./src/shared/menu/folder.ts'); | ||
// console.log(result); | ||
fs.writeFileSync( | ||
folder, | ||
`export const MENU_PATH_DATA = ${JSON.stringify(result, null, 2)} | ||
`, | ||
); | ||
|
||
console.log(`menu info 👉🏻 ${folder}`); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { appTools, defineConfig } from '@modern-js/app-tools'; | ||
|
||
// https://modernjs.dev/en/configure/app/usage | ||
export default defineConfig({ | ||
runtime: { | ||
router: true, | ||
}, | ||
plugins: [ | ||
appTools({ | ||
bundler: 'rspack', // Set to 'webpack' to enable webpack | ||
}), | ||
], | ||
}); |
Oops, something went wrong.