Skip to content

Commit e38614a

Browse files
committed
Refactor source paths
1 parent dd0b3c5 commit e38614a

Some content is hidden

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

45 files changed

+32
-36
lines changed

README.md

Lines changed: 6 additions & 9 deletions

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ inputs:
5454
default: 100
5555

5656
# Template to use
57-
# See https://github.com/lowlighter/metrics/tree/master/src/templates for supported templates
57+
# See https://github.com/lowlighter/metrics/tree/master/source/templates for supported templates
5858
template:
5959
description: Template to use
6060
default: classic

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"description": "An image generator with 20+ metrics about your GitHub account such as activity, community, repositories, coding habits, website performances, music played, starred topics, etc. that you can put on your profile or elsewhere !",
55
"main": "index.mjs",
66
"scripts": {
7-
"start": "node index.mjs",
8-
"build": "node utils/build.mjs",
7+
"start": "node source/app/web/index.mjs",
98
"test": "npx jest",
109
"upgrade": "npm install @actions/core@latest @actions/github@latest @octokit/graphql@latest @octokit/rest@latest axios@latest colors@latest compression@latest ejs@latest express@latest express-rate-limit@latest image-to-base64@latest memory-cache@latest prismjs@latest puppeteer@latest svgo@latest vue@latest vue-prism-component@latest jest@latest js-yaml@latest libxmljs@latest"
1110
},
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//Imports
2-
import setup from "./../src/setup.mjs"
3-
import metrics from "./../src/metrics.mjs"
4-
import octokit from "@octokit/graphql"
52
import core from "@actions/core"
63
import github from "@actions/github"
7-
import mocks from "./../src/mocks.mjs"
4+
import octokit from "@octokit/graphql"
5+
import setup from "../setup.mjs"
6+
import mocks from "../mocks.mjs"
7+
import metrics from "../metrics.mjs"
88

99
;((async function () {
1010
//Yaml boolean converter

src/metrics.mjs renamed to source/app/metrics.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//Imports
2-
import ejs from "ejs"
3-
import SVGO from "svgo"
4-
import imgb64 from "image-to-base64"
5-
import axios from "axios"
6-
import puppeteer from "puppeteer"
7-
import url from "url"
8-
import processes from "child_process"
92
import fs from "fs/promises"
103
import os from "os"
114
import paths from "path"
125
import util from "util"
6+
import axios from "axios"
7+
import url from "url"
8+
import puppeteer from "puppeteer"
9+
import processes from "child_process"
10+
import ejs from "ejs"
11+
import imgb64 from "image-to-base64"
12+
import SVGO from "svgo"
1313

1414
//Setup
1515
export default async function metrics({login, q, dflags = []}, {graphql, rest, plugins, conf, die = false, verify = false}, {Plugins, Templates}) {
File renamed without changes.

src/setup.mjs renamed to source/app/setup.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
export default async function ({log = true} = {}) {
1111

1212
//Paths
13-
const __metrics = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "..")
14-
const __templates = path.join(__metrics, "src/templates")
15-
const __plugins = path.join(__metrics, "src/plugins")
16-
const __queries = path.join(__metrics, "src/queries")
13+
const __metrics = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "../..")
14+
const __statics = path.join(__metrics, "source/app/web/statics")
15+
const __templates = path.join(__metrics, "source/templates")
16+
const __plugins = path.join(__metrics, "source/plugins")
17+
const __queries = path.join(__metrics, "source/queries")
1718
const __package = path.join(__metrics, "package.json")
1819
const __settings = path.join(__metrics, "settings.json")
19-
const __statics = path.join(__metrics, "src/web")
2020
const __modules = path.join(__metrics, "node_modules")
2121

2222
//Init
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//Imports
2-
import app from "./src/app.mjs"
2+
import app from "./instance.mjs"
33

44
//Start app
55
await app({mock:process.env.USE_MOCKED_DATA})

src/app.mjs renamed to source/app/web/instance.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//Imports
2-
import express from "express"
32
import octokit from "@octokit/graphql"
43
import OctokitRest from "@octokit/rest"
5-
import cache from "memory-cache"
4+
import express from "express"
65
import ratelimit from "express-rate-limit"
76
import compression from "compression"
7+
import cache from "memory-cache"
88
import util from "util"
9-
import setup from "./setup.mjs"
10-
import metrics from "./metrics.mjs"
11-
import mocks from "./mocks.mjs"
9+
import setup from "../setup.mjs"
10+
import mocks from "../mocks.mjs"
11+
import metrics from "../metrics.mjs"
1212

1313
/** App */
1414
export default async function ({mock = false} = {}) {

0 commit comments

Comments
 (0)