-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
98 changed files
with
4,238 additions
and
1 deletion.
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,20 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], | ||
plugins: ['svelte3', '@typescript-eslint'], | ||
ignorePatterns: ['*.cjs'], | ||
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], | ||
settings: { | ||
'svelte3/typescript': () => require('typescript') | ||
}, | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2020 | ||
}, | ||
env: { | ||
browser: true, | ||
es2017: true, | ||
node: true | ||
} | ||
}; |
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,25 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches-ignore: gh-pages | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: pnpm/action-setup@v2.2.1 | ||
with: | ||
version: 6.32.2 | ||
|
||
- name: install | ||
run: pnpm install --frozen-lockfile | ||
|
||
#- name: svelte-check | ||
# run: pnpm run check | ||
|
||
- name: lint | ||
run: pnpm run lint |
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,22 @@ | ||
.DS_Store | ||
node_modules | ||
dist | ||
build | ||
package | ||
functions | ||
test-results/ | ||
package-lock.json | ||
yarn.lock | ||
/packages/create-svelte/template/CHANGELOG.md | ||
/packages/kit/src/packaging/test/watch/package | ||
/documentation/types.js | ||
.env | ||
.vercel_build_output | ||
.svelte-kit | ||
.cloudflare | ||
.pnpm-debug.log | ||
.netlify | ||
.turbo | ||
.vercel | ||
.test-tmp | ||
.idea/ |
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 @@ | ||
engine-strict=true |
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,6 @@ | ||
{ | ||
"useTabs": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"printWidth": 100 | ||
} |
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 @@ | ||
hacktj.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 |
---|---|---|
@@ -1 +1,68 @@ | ||
# 2025 | ||
# HackTJ 12.0 | ||
|
||
[![lint](https://github.com/HackTJ/2025/workflows/lint/badge.svg)](https://github.com/HackTJ/2025/actions?query=workflow%3Alint) | ||
|
||
The website for HackTJ 12.0. | ||
|
||
## Setup | ||
|
||
- `git clone git@github.com:HackTJ/2025.git hacktj-website` | ||
- `pnpm install` | ||
|
||
## Development | ||
|
||
We use SvelteKit. | ||
|
||
### Creating a New Event Website (2025) | ||
|
||
```sh | ||
mv hacktj-website hacktj-website-2025 | ||
git clone git@github.com:HackTJ/2025.git hacktj-website | ||
cd hacktj-website | ||
pnpm install | ||
git reset "$(git commit-tree HEAD^"{tree}" -m "Push HackTJ 12.0 website")" # squash all commits into 1 | ||
git remote set-url origin git@github.com:HackTJ/2025.git | ||
git push | ||
``` | ||
|
||
## Deployment | ||
|
||
- `pnpm update --latest --interactive` | ||
- `pnpm run format` | ||
- `pnpm run lint` | ||
- `pnpm run check` | ||
- `pnpm run switch event`: switch to the event repository (configures the project so that builds are for `/2025`) | ||
- `pnpm run switch homepage`: switch to the homepage repository (configures the project so that builds are for `/`) | ||
- `pnpm run dev`: starts a development server on [port 3000](http://localhost:3000) and watches files for changes, compiling them on the fly | ||
- `pnpm run build`: compiles all files to the `build/` directory but doesn't watch for changes or start a server | ||
- `pnpm run preview`: starts a static server using the files in `build/` | ||
- `pnpm run deploy event`: pushes to the `gh-pages` branch of this repository and deploys the site to <https://hacktj.org/2025> | ||
- `pnpm run deploy homepage`: pushes to the [hacktj.github.io repo](https://github.com/HackTJ/hacktj.github.io) and deploys the site to <https://hacktj.org> | ||
- `pnpm run deploy all`: shortcut for both `pnpm run deploy event` and `pnpm run deploy homepage` | ||
|
||
In the case that one of the endpoints (/2025 or /) doesn't work but the other does, immediately set up a hardcoded redirect in the nonfunctional repository to redirect to the correct site. | ||
|
||
To test a production build locally: | ||
|
||
1. `pnpm run switch homepage` | ||
2. `pnpm run build` | ||
3. `pnpm run preview` | ||
|
||
To deploy a change: | ||
|
||
1. `pnpm run dev` | ||
2. make your changes; when you're done, close the development server | ||
3. `pnpm run format; pnpm run lint` | ||
4. `git add . && git commit` | ||
5. `pnpm run deploy all` | ||
6. `git push` | ||
|
||
## Notes for next year | ||
|
||
- create a new repository under the HackTJ organization for each event | ||
- the `deploy event` script doesn't commit the source code to the repository's main branch, it only commits the built website | ||
- you should commit the source code to the `main` branch each time you deploy | ||
- before you commit to `main`, always make sure you run `pnpm run switch event` | ||
- if you need to, create a [pre-commit hook](https://git-scm.com/docs/githooks#_pre_commit) to automatically do this | ||
- don't run `git pull` after `pnpm run switch homepage` | ||
- only pull when you're set up for the event repository |
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,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
BLUE=$(printf '\033[36m') | ||
NORMAL=$(printf '\033[m') | ||
|
||
# export NODE_DEBUG=gh-pages | ||
timestamp=$(pnpm node -e "console.log(new Date())") | ||
gh_pages_args="--dist build --dotfiles --message \"Update $timestamp\"" | ||
|
||
log_and_run_cmd () { | ||
echo -e "+ ${BLUE}$*${NORMAL}" && eval "$@" | ||
echo | ||
} | ||
|
||
deploy_event () { | ||
log_and_run_cmd pnpm run switch event | ||
log_and_run_cmd pnpm run build | ||
log_and_run_cmd gh-pages "$gh_pages_args" | ||
} | ||
|
||
deploy_homepage () { | ||
log_and_run_cmd pnpm run switch homepage | ||
log_and_run_cmd pnpm run build | ||
log_and_run_cmd gh-pages --branch main "$gh_pages_args" | ||
} | ||
|
||
if [ "$1" == "event" ]; then | ||
deploy_event | ||
elif [ "$1" == "homepage" ]; then | ||
deploy_homepage | ||
elif [ "$1" == "all" ]; then | ||
deploy_event | ||
deploy_homepage | ||
else | ||
echo "Invalid argument" | ||
exit 1 | ||
fi | ||
|
||
pnpm run switch event |
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,45 @@ | ||
{ | ||
"name": "hacktj-2025", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"start": "vite dev", | ||
"build": "vite build", | ||
"package": "svelte-kit package", | ||
"preview": "vite preview", | ||
"check": "svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", | ||
"lint": "prettier --check --plugin-search-dir=. . '!**/pnpm-lock.yaml' && eslint --ignore-path .gitignore .", | ||
"format": "prettier --write --plugin-search-dir=. . '!**/pnpm-lock.yaml'", | ||
"switch": "./switch", | ||
"deploy": "./deploy" | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/adapter-static": "1.0.0-next.38", | ||
"@sveltejs/kit": "1.0.0-next.396", | ||
"@typescript-eslint/eslint-plugin": "^5.31.0", | ||
"@typescript-eslint/parser": "^5.31.0", | ||
"autoprefixer": "^10.4.7", | ||
"eslint": "^8.20.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-svelte3": "^4.0.0", | ||
"gh-pages": "^4.0.0", | ||
"postcss": "^8.4.14", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-svelte": "^2.7.0", | ||
"svelte": "^3.49.0", | ||
"svelte-check": "^2.8.0", | ||
"svelte-preprocess": "^4.10.7", | ||
"svelte-simple-modal": "^1.4.1", | ||
"tailwind-scrollbar": "^1.3.1", | ||
"tailwindcss": "^3.1.6", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.7.4", | ||
"vite": "^3.0.3" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@svicons/ionicons-solid": "^0.1.11", | ||
"dayjs": "^1.11.4" | ||
} | ||
} |
Oops, something went wrong.