Skip to content

Commit d365024

Browse files
mazipanirfan-maulana-tkpitsfaqih
authored
breaking(core): migrate to svelte-kit + revamp ui (#104)
* feat: init commit svelte-kit * feat: add base homepage skeleton * feat: entries * feat: update style * chore(style): add some stylings * chore(style): add more stylings * chore(styles): add more accurate styling to svelte kit version (#105) * chore(config): change 'purge' to 'content' in tailwind config * chore(style): add more styling * chore(styling): hide pagination number in smaller screen * chore(styling): add consistent padding for smaller screen * chore(styling): remove padding on larger screen * feat(page): search + tag page * fix(build): change read query onMount * feat(core): update to mainApp * chore: format * fix: missing 3rd party Co-authored-by: Irfan Maulana (@mazipan) <maulana.irfan@tokopedia.com> Co-authored-by: Muhammad Faqih Muntashir <48067039+itsfaqih@users.noreply.github.com>
1 parent d4c6058 commit d365024

File tree

245 files changed

+2976
-15709
lines changed

Some content is hidden

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

245 files changed

+2976
-15709
lines changed

.eslintignore

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
.github
2-
node_modules
3-
public
4-
node_modules
5-
node_modules/@sapper
6-
src/routes/_layout.svelte
7-
src/data-es.js
8-
data.js
9-
data-es.js
1+
data
2+
api
3+
cover
4+
build
5+
.svelte-kit
6+
coverage

.eslintrc.cjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5+
plugins: ['svelte3', '@typescript-eslint'],
6+
ignorePatterns: ['*.cjs'],
7+
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8+
settings: {
9+
'svelte3/typescript': () => require('typescript')
10+
},
11+
parserOptions: {
12+
sourceType: 'module',
13+
ecmaVersion: 2020
14+
},
15+
env: {
16+
browser: true,
17+
es2017: true,
18+
node: true
19+
}
20+
};

.eslintrc.js

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

.github/workflows/build-ui-netlify.yml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
branches:
55
- master
66
paths-ignore:
7-
- "LAST_UPDATED"
8-
- "data.json"
9-
- "data.js"
10-
- "data-es.js"
11-
- "tags.txt"
12-
- "tags-prefix.txt"
13-
- "_redirect-out"
14-
- "package.json"
7+
- 'LAST_UPDATED'
8+
- 'data.json'
9+
- 'data.js'
10+
- 'data-es.js'
11+
- 'tags.txt'
12+
- 'tags-prefix.txt'
13+
- '_redirect-out'
14+
- 'package.json'
1515

1616
jobs:
1717
install-deps:
@@ -25,16 +25,13 @@ jobs:
2525
- name: Setup Node.js 14.x
2626
uses: actions/setup-node@v1
2727
with:
28-
node-version: "14.x"
28+
node-version: '14.x'
2929

3030
- name: Install locked dependencies
3131
run: yarn install --frozen-lockfile
3232

3333
- name: Generate file json
34-
run: yarn toJson
35-
36-
- name: Update export script on package.json
37-
run: yarn toTags
34+
run: yarn script:toJson
3835

3936
- name: Modify last update
4037
run: |
@@ -45,7 +42,7 @@ jobs:
4542
uses: actions/cache@v1
4643
id: cache-deps
4744
with:
48-
path: "."
45+
path: '.'
4946
key: ${{ github.sha }}
5047

5148
build_ui:
@@ -58,27 +55,22 @@ jobs:
5855
uses: actions/cache@v1
5956
id: restore-deps
6057
with:
61-
path: "."
58+
path: '.'
6259
key: ${{ github.sha }}
6360

6461
- name: Setup Node.js 14.x
6562
uses: actions/setup-node@v1
6663
with:
67-
node-version: "14.x"
64+
node-version: '14.x'
6865

6966
- name: Perform export to static
70-
run: yarn export
71-
72-
- name: Modify last update on sapper
73-
run: |
74-
d=`date '+%Y-%m-%dT%H:%M:%SZ'`
75-
echo $d > __sapper__/export/LAST_UPDATED
67+
run: yarn build
7668

7769
- name: Deploy
7870
uses: peaceiris/actions-gh-pages@v3.7.3
7971
with:
8072
personal_token: ${{ secrets.PERSONAL_TOKEN }}
81-
publish_dir: ./__sapper__/export
73+
publish_dir: ./build
8274
publish_branch: netlify-pages
8375
full_commit_message: ${{ github.event.head_commit.message }}
8476
force_orphan: true
@@ -93,7 +85,7 @@ jobs:
9385
uses: actions/cache@v1
9486
id: restore-deps
9587
with:
96-
path: "."
88+
path: '.'
9789
key: ${{ github.sha }}
9890

9991
- name: Deploy
@@ -102,10 +94,3 @@ jobs:
10294
personal_token: ${{ secrets.PERSONAL_TOKEN }}
10395
publish_dir: ./api
10496
publish_branch: api
105-
106-
# - name: Perform push JSON data to master
107-
# uses: ad-m/github-push-action@v0.6.0
108-
# with:
109-
# github_token: '${{ secrets.PERSONAL_TOKEN }}'
110-
# force: true
111-

.github/workflows/codeql-analysis.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# You may wish to alter this file to override the set of languages analyzed,
55
# or to provide custom queries or build logic.
6-
name: "CodeQL"
6+
name: 'CodeQL'
77

88
on:
99
pull_request:
@@ -27,43 +27,43 @@ jobs:
2727
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
2828

2929
steps:
30-
- name: Checkout repository
31-
uses: actions/checkout@v2
32-
with:
33-
# We must fetch at least the immediate parents so that if this is
34-
# a pull request then we can checkout the head.
35-
fetch-depth: 2
30+
- name: Checkout repository
31+
uses: actions/checkout@v2
32+
with:
33+
# We must fetch at least the immediate parents so that if this is
34+
# a pull request then we can checkout the head.
35+
fetch-depth: 2
3636

37-
# If this run was triggered by a pull request event, then checkout
38-
# the head of the pull request instead of the merge commit.
39-
- run: git checkout HEAD^2
40-
if: ${{ github.event_name == 'pull_request' }}
37+
# If this run was triggered by a pull request event, then checkout
38+
# the head of the pull request instead of the merge commit.
39+
- run: git checkout HEAD^2
40+
if: ${{ github.event_name == 'pull_request' }}
4141

42-
# Initializes the CodeQL tools for scanning.
43-
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@v1
45-
with:
46-
languages: ${{ matrix.language }}
47-
# If you wish to specify custom queries, you can do so here or in a config file.
48-
# By default, queries listed here will override any specified in a config file.
49-
# Prefix the list here with "+" to use these queries and those in the config file.
50-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
42+
# Initializes the CodeQL tools for scanning.
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action/init@v1
45+
with:
46+
languages: ${{ matrix.language }}
47+
# If you wish to specify custom queries, you can do so here or in a config file.
48+
# By default, queries listed here will override any specified in a config file.
49+
# Prefix the list here with "+" to use these queries and those in the config file.
50+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5151

52-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53-
# If this step fails, then you should remove it and run the build manually (see below)
54-
- name: Autobuild
55-
uses: github/codeql-action/autobuild@v1
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
- name: Autobuild
55+
uses: github/codeql-action/autobuild@v1
5656

57-
# ℹ️ Command-line programs to run using the OS shell.
58-
# 📚 https://git.io/JvXDl
57+
# ℹ️ Command-line programs to run using the OS shell.
58+
# 📚 https://git.io/JvXDl
5959

60-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
61-
# and modify them (or add more) to build your code if your project
62-
# uses a compiled language
60+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
61+
# and modify them (or add more) to build your code if your project
62+
# uses a compiled language
6363

64-
#- run: |
65-
# make bootstrap
66-
# make release
64+
#- run: |
65+
# make bootstrap
66+
# make release
6767

68-
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v1
68+
- name: Perform CodeQL Analysis
69+
uses: github/codeql-action/analyze@v1

.github/workflows/pull-request.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Node.js 14.x
1717
uses: actions/setup-node@v1
1818
with:
19-
node-version: "14.x"
19+
node-version: '14.x'
2020

2121
- name: Install locked dependencies
2222
run: yarn install --frozen-lockfile
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/cache@v1
2626
id: cache-deps
2727
with:
28-
path: "."
28+
path: '.'
2929
key: ${{ github.sha }}
3030

3131
lint:
@@ -38,16 +38,16 @@ jobs:
3838
uses: actions/cache@v1
3939
id: restore-deps
4040
with:
41-
path: "."
41+
path: '.'
4242
key: ${{ github.sha }}
4343

4444
- name: Setup Node.js 14.x
4545
uses: actions/setup-node@v1
4646
with:
47-
node-version: "14.x"
47+
node-version: '14.x'
4848

4949
- name: Lint files
50-
run: yarn run lint
50+
run: yarn run lint:ci
5151
env:
5252
CI: true
5353

@@ -61,13 +61,13 @@ jobs:
6161
uses: actions/cache@v1
6262
id: restore-deps
6363
with:
64-
path: "."
64+
path: '.'
6565
key: ${{ github.sha }}
6666

6767
- name: Setup Node.js 14.x
6868
uses: actions/setup-node@v1
6969
with:
70-
node-version: "14.x"
70+
node-version: '14.x'
7171

7272
- name: Perform build checking
7373
run: yarn run build
@@ -84,20 +84,15 @@ jobs:
8484
uses: actions/cache@v1
8585
id: restore-deps
8686
with:
87-
path: "."
87+
path: '.'
8888
key: ${{ github.sha }}
8989

9090
- name: Setup Node.js 14.x
9191
uses: actions/setup-node@v1
9292
with:
93-
node-version: "14.x"
93+
node-version: '14.x'
9494

95-
- name: Perform script toJson checking
96-
run: yarn run toJson
95+
- name: Perform checking script:toJson
96+
run: yarn run script:toJson
9797
env:
9898
CI: true
99-
100-
- name: Perform script toTags checking
101-
run: yarn run toTags
102-
env:
103-
CI: true

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,12 @@ __sapper__/
112112
api/data.js
113113
api/data-es.js
114114
api/data.json
115+
116+
/build
117+
/.svelte-kit
118+
/package
119+
.env
120+
.env.*
121+
!.env.example
122+
.vercel
123+
.output

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
data
2+
api
3+
cover
4+
build
5+
.svelte-kit
6+
coverage

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100
6+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Belajar daring bersama PHPID
22

3-
![PHPID](https://img.shields.io/badge/PHPID-Community-blue?cacheSeconds=604800) ![Contribution](https://img.shields.io/badge/Contributions-Welcome-BrightGreen.svg?cacheSeconds=604800) [![Build UI for Netlify](https://github.com/phpid-jakarta/phpid-learning/actions/workflows/build-ui-netlify.yml/badge.svg)](https://github.com/phpid-jakarta/phpid-learning/actions/workflows/build-ui-netlify.yml)
3+
![PHPID](https://img.shields.io/badge/PHPID-Community-blue?cacheSeconds=604800) ![Contribution](https://img.shields.io/badge/Contributions-Welcome-Brightemerald.svg?cacheSeconds=604800) [![Build UI for Netlify](https://github.com/phpid-jakarta/phpid-learning/actions/workflows/build-ui-netlify.yml/badge.svg)](https://github.com/phpid-jakarta/phpid-learning/actions/workflows/build-ui-netlify.yml)
44

55
[![Belajar daring bersama PHPID](static/phpid-learning-logo-small.jpg)](https://s.byphp.id/learning)
66

0 commit comments

Comments
 (0)