Skip to content

Commit

Permalink
Merge pull request #573 from dzcode-io/572-delete-server-code-on-data…
Browse files Browse the repository at this point in the history
…-and-clear-cloud-resources
  • Loading branch information
ZibanPirate authored Apr 10, 2023
2 parents 7445784 + 25de398 commit 7503e0f
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 360 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ You can find more about each folder by clicking on the folder name

| **Apps** | **Coverage** | **Production URL** | **Staging URL** | **Local URL** |
| :-------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | -----------------------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------: |
| [web](./web) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=web)](https://codecov.io/gh/dzcode-io/dzcode.io) | [dzcode.io](https://dzcode.io) | [stage.dzcode.io](https://stage.dzcode.io) | [localhost:8080](http://localhost:8080) |
| [data](./data) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=data)](https://codecov.io/gh/dzcode-io/dzcode.io) | [data.dzcode.io](https://data.dzcode.io) | [data.stage.dzcode.io](https://data.stage.dzcode.io) | [localhost:9090](http://localhost:9090) |
| [api](./api) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=api)](https://codecov.io/gh/dzcode-io/dzcode.io) | [api.dzcode.io/docs](https://api.dzcode.io/docs) | [api-stage.dzcode.io/docs](https://api-stage.dzcode.io/docs) | [localhost:7070/docs](http://localhost:7070/docs) |
| [web](./web) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=web)](https://codecov.io/gh/dzcode-io/dzcode.io) | [dzcode.io](https://dzcode.io) | [stage.dzcode.io](https://stage.dzcode.io) | [localhost:8080](http://localhost:8080) |
| [mobile](./mobile) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=mobile)](https://codecov.io/gh/dzcode-io/dzcode.io) | | [Android](https://play.google.com/store/apps/details?id=io.dzcode.mobile) \| [iOS](https://testflight.apple.com/join/XDcfIqdJ) \| [Expo](https://expo.dev/@zakman.dev/dzcode?release-channel=stage) | run `yarn --cwd=mobile start:expo` |
| [data](./data) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=data)](https://codecov.io/gh/dzcode-io/dzcode.io) | | | |
| **Packages** | | | | |
| [models](./packages/models) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=models)](https://codecov.io/gh/dzcode-io/dzcode.io) | | | |
| [utils](./packages/utils) | [![codecov](https://codecov.io/gh/dzcode-io/dzcode.io/graph/badge.svg?flag=utils)](https://codecov.io/gh/dzcode-io/dzcode.io) | | | |
Expand Down Expand Up @@ -65,10 +65,9 @@ yarn dev:mobile
yarn dev:all
```

- For web server go to <http://localhost:8080>
- For data server go to <http://localhost:9090>
- For api server go to <http://localhost:7070/docs>
- For mobile go to <http://localhost:19002> and scan QR code with your phone
- For web server go to <http://localhost:8080>
- For mobile run `yarn --cwd=mobile start:expo` and scan QR code with your phone

**Note**

Expand Down
4 changes: 2 additions & 2 deletions api/src/data/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getCollection } from "@dzcode.io/data/dist/get/collection";
import { getEntry } from "@dzcode.io/data/dist/get/entry";
import { getCollection } from "@dzcode.io/data/dist/collection";
import { getEntry } from "@dzcode.io/data/dist/entry";
import { join } from "path";
import { Service } from "typedi";

Expand Down
17 changes: 0 additions & 17 deletions data/firebase/.firebaserc

This file was deleted.

72 changes: 0 additions & 72 deletions data/firebase/.gitignore

This file was deleted.

38 changes: 0 additions & 38 deletions data/firebase/firebase.json

This file was deleted.

9 changes: 3 additions & 6 deletions data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,14 @@
"build:watch": "lerna run build:alone:watch [email protected]/data --include-dependencies --parallel",
"clean": "lerna run clean:alone [email protected]/api --include-dependencies --stream",
"clean:alone": "rimraf dist coverage",
"deploy": "yarn generate:data && rimraf ./firebase/public && cpx -u \"./dist/_data/**/*\" ./firebase/public && cd ./firebase && firebase deploy --only hosting:data.dzcode.io --token \"$FIREBASE_TOKEN\"",
"deploy:stg": "yarn generate:data && rimraf ./firebase/public && cpx -u \"./dist/_data/**/*\" ./firebase/public && cd ./firebase && firebase deploy --only hosting:data.stage.dzcode.io --token \"$FIREBASE_TOKEN\"",
"generate:data": "node dist/build.js",
"lint": "yarn build && yarn lint:alone",
"lint:alone": "yarn lint:eslint . && yarn lint:prettier --check .",
"lint:alone": "yarn lint:eslint . && yarn lint:prettier --check . && yarn lint:tsc && yarn lint:ts-prune",
"lint:eslint": "eslint --config ../packages/tooling/.eslintrc.json --ignore-path ../packages/tooling/.eslintignore --report-unused-disable-directives",
"lint:fix": "yarn build && yarn lint:fix:alone",
"lint:fix:alone": "yarn lint:eslint --fix . && yarn lint:prettier --write .",
"lint:prettier": "prettier --config ../packages/tooling/.prettierrc --ignore-path ../packages/tooling/.prettierignore --loglevel warn",
"start": "node dist/index.js",
"start:dev": "ts-node ../packages/tooling/nodemon.ts @dzcode.io/data && nodemon dist/index.js",
"lint:ts-prune": "ts-prune --error",
"lint:tsc": "tsc --noEmit",
"test": "jest src",
"test:cov": "jest src --coverage",
"test:cov:watch": "jest src --coverage --watchAll",
Expand Down
39 changes: 0 additions & 39 deletions data/src/build.ts

This file was deleted.

3 changes: 2 additions & 1 deletion data/src/get/collection.ts → data/src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { join } from "path";

import { getEntry } from "./entry";

export interface Collection {
interface Collection {
items: string[] | "all";
include: string[];
}

// ts-prune-ignore-next
export const getCollection = <T = Record<string, unknown>>(
dataFolder: string,
collectionType: string,
Expand Down
17 changes: 0 additions & 17 deletions data/src/config/index.ts

This file was deleted.

File renamed without changes.
50 changes: 0 additions & 50 deletions data/src/index.ts

This file was deleted.

9 changes: 4 additions & 5 deletions mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"expo-constants": "~14.2.1",
"expo-device": "~5.2.1",
"expo-status-bar": "~1.4.4",
"expo-updates": "~0.16.3",
"expo-updates": "~0.16.4",
"react": "18.2.0",
"react-native": "0.71.4",
"react-native": "0.71.6",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
Expand All @@ -37,8 +37,7 @@
"eas-cli": "^3.8.1",
"internal-ip": "^6.2.0",
"jest-expo": "^48.0.2",
"react-test-renderer": "^18.2.0",
"typescript": "^4.9.4"
"react-test-renderer": "^18.2.0"
},
"engines": {
"node": ">=16",
Expand Down Expand Up @@ -93,7 +92,7 @@
"lint:prettier": "prettier --config ../packages/tooling/.prettierrc --ignore-path ../packages/tooling/.prettierignore --loglevel warn",
"lint:tsc": "tsc --noEmit",
"start:dev": "echo \" \n\\033[0;32mPlease run in a separate terminal session the following command:\n \n\\033[0;32myarn --cwd=mobile start:expo\n \n \"",
"start:expo": "expo start --port 1010",
"start:expo": "rimraf .bundle-info.json && expo start --port 1010",
"test": "yarn build && yarn test:alone",
"test:alone": "jest --rootDir .",
"test:watch": "npm-run-all build --parallel build:watch \"test:alone --watch {@}\" --"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
"dev": "echo \"Please run one of these commands:\\n\\nyarn dev:web\\nyarn dev:mobile\\nyarn dev:all\n\"",
"dev:all": "npm-run-all \"build --include-dependencies {@}\" --parallel \"build:watch --include-dependencies {@}\" \"start:dev {@}\" --",
"dev:api": "yarn dev:all [email protected]/api",
"dev:mobile": "yarn dev:all [email protected]/{mobile,api,data}",
"dev:web": "yarn dev:all [email protected]/{web,api,data}",
"dev:mobile": "yarn dev:all [email protected]/{mobile,api}",
"dev:web": "yarn dev:all [email protected]/{web,api}",
"e2e:all": "npm-run-all \"build --include-dependencies {@}\" --parallel \"build:watch --include-dependencies {@}\" \"start:dev {@}\" \"e2e:dev [email protected]/web\" --",
"e2e:dev": "lerna run e2e:dev --parallel",
"e2e:web": "BROWSER=none yarn e2e:all [email protected]/{web,api,data}",
"e2e:web": "BROWSER=none yarn e2e:all [email protected]/{web,api}",
"generate:bundle-info": "lerna run generate:bundle-info --parallel --",
"generate:sentry-release": "lerna run generate:sentry-release --concurrency 1 --stream --",
"lint": "yarn build && yarn lint:alone",
Expand Down
4 changes: 4 additions & 0 deletions packages/tooling/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ firebase

# web
bundle
.bundle-info.json

# mobile
.expo

./.*
.gitignore
Expand Down
2 changes: 1 addition & 1 deletion web/src/build/pages/dynamic-pages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getCollection } from "@dzcode.io/data/dist/get/collection";
import { getCollection } from "@dzcode.io/data/dist/collection";
import { join } from "path";

import { PageInfo } from ".";
Expand Down
2 changes: 1 addition & 1 deletion web/src/build/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getCollection } from "@dzcode.io/data/dist/get/collection";
import { getCollection } from "@dzcode.io/data/dist/collection";
import { allLanguages } from "@dzcode.io/models/dist/language";
import { createWriteStream } from "fs";
import { join } from "path";
Expand Down
1 change: 0 additions & 1 deletion web/src/redux/actions/articles-page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const fetchArticlesList = async (): Promise<void> => {
/**
* Fetches the content of the current article
*/
// @TODO-ZM: remove this once ./data is migrated to ./api

export const fetchCurrentArticle = async (): Promise<void> => {
const match = matchPath<{ lang?: LanguageEntity["code"]; slug: string }>(
Expand Down
3 changes: 0 additions & 3 deletions web/src/utils/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export const fetchV2 = async <
let baseURL = "";

switch (domain) {
case "data":
baseURL = fullstackConfig.data.url;
break;
case "api":
baseURL = fullstackConfig.api.url;
break;
Expand Down
Loading

0 comments on commit 7503e0f

Please sign in to comment.