@cieloazul310/jclub-financial-utils 0.0.1-alpha.0 → 0.0.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-fields.d.cts.map +1 -1
- package/dist/all-fields.d.mts.map +1 -1
- package/package.json +6 -3
- package/.turbo/turbo-build.log +0 -93
- package/CHANGELOG.md +0 -7
- package/__tests__/club.test.ts +0 -40
- package/__tests__/dictionary.test.ts +0 -26
- package/__tests__/years.test.ts +0 -11
- package/clubs.yml +0 -850
- package/dictionary.yml +0 -69
- package/eslint.config.mjs +0 -4
- package/scripts/build-clubs.ts +0 -18
- package/scripts/build-dictionary.ts +0 -18
- package/scripts/build-years.ts +0 -18
- package/scripts/build.ts +0 -21
- package/src/all-fields.ts +0 -100
- package/src/clubs.ts +0 -20
- package/src/data/clubs.json +0 -949
- package/src/data/dictionary.json +0 -71
- package/src/data/years.json +0 -173
- package/src/dictionary.ts +0 -39
- package/src/index.ts +0 -5
- package/src/types/club.ts +0 -16
- package/src/types/data.ts +0 -161
- package/src/types/index.ts +0 -3
- package/src/types/year.ts +0 -5
- package/src/years.ts +0 -6
- package/tsconfig.json +0 -4
- package/tsdown.config.ts +0 -15
- package/years.yml +0 -111
package/dictionary.yml
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
name: クラブ
|
|
2
|
-
fullname: 呼称
|
|
3
|
-
id: id
|
|
4
|
-
year: 年
|
|
5
|
-
category: 所属
|
|
6
|
-
license: ライセンス
|
|
7
|
-
revenue: 営業収入
|
|
8
|
-
sponsor: スポンサー収入
|
|
9
|
-
ticket: 入場料収入
|
|
10
|
-
broadcast: Jリーグ配分金
|
|
11
|
-
academy_rev: アカデミー関連収入
|
|
12
|
-
women_rev: 女子チーム関連収入
|
|
13
|
-
goods_rev: 物販収入
|
|
14
|
-
transfer_rev: 移籍補償金等収入
|
|
15
|
-
transfer_int_rev: 国外クラブからの収入
|
|
16
|
-
transfer_dom_rev: 国内クラブからの収入
|
|
17
|
-
other_revs: その他収入
|
|
18
|
-
expense: 営業費用
|
|
19
|
-
salary: チーム人件費
|
|
20
|
-
transfer_exp: 移籍関連費用
|
|
21
|
-
transfer_int_exp: 国外クラブからの移籍に関する費用
|
|
22
|
-
transfer_dom_exp: 国内クラブからの移籍に関する費用
|
|
23
|
-
manage_exp: 事業費
|
|
24
|
-
general_exp: 総事業費
|
|
25
|
-
game_exp: 試合関連経費
|
|
26
|
-
team_exp: トップチーム運営経費
|
|
27
|
-
academy_exp: アカデミー運営経費
|
|
28
|
-
women_exp: 女子チーム運営経費
|
|
29
|
-
goods_exp: 物販関連費
|
|
30
|
-
other_cost: その他売上原価
|
|
31
|
-
sga: 販売費および一般管理費
|
|
32
|
-
op_profit: 営業利益
|
|
33
|
-
no_rev: 営業外収益
|
|
34
|
-
no_exp: 営業外費用
|
|
35
|
-
ordinary_profit: 経常利益
|
|
36
|
-
sp_rev: 特別利益
|
|
37
|
-
sp_exp: 特別損失
|
|
38
|
-
profit_before_tax: 税引前当期利益
|
|
39
|
-
related_revenue: 関連する法人の営業収入
|
|
40
|
-
tax: 法人税および住民税等
|
|
41
|
-
profit: 当期純利益
|
|
42
|
-
curr_assets: 流動資産
|
|
43
|
-
fixed_assets: 固定資産等
|
|
44
|
-
assets: 総資産(資産の部)
|
|
45
|
-
curr_liabilities: 流動負債
|
|
46
|
-
fixed_liabilities: 固定負債
|
|
47
|
-
liabilities: 総負債(負債の部)
|
|
48
|
-
capital_stock: 資本金
|
|
49
|
-
capital_surplus: 資本剰余金等
|
|
50
|
-
retained_earnings: 利益剰余金
|
|
51
|
-
net_worth: 純資産(純資産の部)
|
|
52
|
-
rank: 順位
|
|
53
|
-
points: 勝ち点
|
|
54
|
-
ppg: PPG
|
|
55
|
-
elevation: 昇降格
|
|
56
|
-
league_attd: リーグ戦入場者数
|
|
57
|
-
league_games: リーグ戦ホーム試合数
|
|
58
|
-
leaguecup_attd: リーグカップ入場者数
|
|
59
|
-
leaguecup_games: リーグカップホーム試合数
|
|
60
|
-
po_attd: PO入場者数
|
|
61
|
-
po_games: POホーム試合数
|
|
62
|
-
acl_attd: ACL入場者数
|
|
63
|
-
acl_games: ACLホーム試合数
|
|
64
|
-
second_attd: セカンドチーム入場者数
|
|
65
|
-
second_games: セカンドチームホーム試合数
|
|
66
|
-
all_attd: 年間総入場者数
|
|
67
|
-
all_games: 年間ホーム試合数
|
|
68
|
-
average_attd: リーグ戦平均入場者数
|
|
69
|
-
unit_price: 客単価
|
package/eslint.config.mjs
DELETED
package/scripts/build-clubs.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
2
|
-
import { resolve, join } from "path";
|
|
3
|
-
import { parse } from "yaml";
|
|
4
|
-
|
|
5
|
-
export async function buildClubs() {
|
|
6
|
-
const __dirname = import.meta.dirname;
|
|
7
|
-
const outDir = resolve(__dirname, "../src/data");
|
|
8
|
-
await mkdir(outDir, { recursive: true });
|
|
9
|
-
|
|
10
|
-
const file = await readFile(resolve(__dirname, "../clubs.yml"), "utf8");
|
|
11
|
-
const parsed = parse(file);
|
|
12
|
-
|
|
13
|
-
await writeFile(
|
|
14
|
-
join(outDir, "clubs.json"),
|
|
15
|
-
JSON.stringify(parsed, null, 2),
|
|
16
|
-
"utf8",
|
|
17
|
-
);
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
2
|
-
import { resolve, join } from "path";
|
|
3
|
-
import { parse } from "yaml";
|
|
4
|
-
|
|
5
|
-
export async function buildDictonary() {
|
|
6
|
-
const __dirname = import.meta.dirname;
|
|
7
|
-
const outDir = resolve(__dirname, "../src/data");
|
|
8
|
-
await mkdir(outDir, { recursive: true });
|
|
9
|
-
|
|
10
|
-
const file = await readFile(resolve(__dirname, "../dictionary.yml"), "utf8");
|
|
11
|
-
const parsed = parse(file);
|
|
12
|
-
|
|
13
|
-
await writeFile(
|
|
14
|
-
join(outDir, "dictionary.json"),
|
|
15
|
-
JSON.stringify(parsed, null, 2),
|
|
16
|
-
"utf8",
|
|
17
|
-
);
|
|
18
|
-
}
|
package/scripts/build-years.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
2
|
-
import { resolve, join } from "path";
|
|
3
|
-
import { parse } from "yaml";
|
|
4
|
-
|
|
5
|
-
export async function buildYears() {
|
|
6
|
-
const __dirname = import.meta.dirname;
|
|
7
|
-
const outDir = resolve(__dirname, "../src/data");
|
|
8
|
-
await mkdir(outDir, { recursive: true });
|
|
9
|
-
|
|
10
|
-
const file = await readFile(resolve(__dirname, "../years.yml"), "utf8");
|
|
11
|
-
const parsed = parse(file);
|
|
12
|
-
|
|
13
|
-
await writeFile(
|
|
14
|
-
join(outDir, "years.json"),
|
|
15
|
-
JSON.stringify(parsed, null, 2),
|
|
16
|
-
"utf8",
|
|
17
|
-
);
|
|
18
|
-
}
|
package/scripts/build.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { mkdir } from "fs/promises";
|
|
2
|
-
import { resolve } from "path";
|
|
3
|
-
|
|
4
|
-
import { buildClubs } from "./build-clubs";
|
|
5
|
-
import { buildDictonary } from "./build-dictionary";
|
|
6
|
-
import { buildYears } from "./build-years";
|
|
7
|
-
|
|
8
|
-
const __dirname = import.meta.dirname;
|
|
9
|
-
const outDir = resolve(__dirname, "../src/data");
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
await mkdir(outDir, { recursive: true });
|
|
13
|
-
await buildDictonary();
|
|
14
|
-
console.log("Build dictionary");
|
|
15
|
-
await buildClubs();
|
|
16
|
-
console.log("Build clubs");
|
|
17
|
-
await buildYears();
|
|
18
|
-
console.log("Build years");
|
|
19
|
-
} catch (e) {
|
|
20
|
-
console.error(e);
|
|
21
|
-
}
|
package/src/all-fields.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
General,
|
|
3
|
-
SeasonResult,
|
|
4
|
-
PL,
|
|
5
|
-
BS,
|
|
6
|
-
Revenue,
|
|
7
|
-
Expense,
|
|
8
|
-
Attd,
|
|
9
|
-
FinancialDatum,
|
|
10
|
-
} from "./types/data";
|
|
11
|
-
|
|
12
|
-
export const generalFields: (keyof General | keyof SeasonResult)[] = [
|
|
13
|
-
"fullname",
|
|
14
|
-
"license",
|
|
15
|
-
"rank",
|
|
16
|
-
"points",
|
|
17
|
-
"ppg",
|
|
18
|
-
"elevation",
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
export const plFields: (keyof PL)[] = [
|
|
22
|
-
"revenue",
|
|
23
|
-
"expense",
|
|
24
|
-
"op_profit",
|
|
25
|
-
"no_rev",
|
|
26
|
-
"no_exp",
|
|
27
|
-
"ordinary_profit",
|
|
28
|
-
"sp_rev",
|
|
29
|
-
"sp_exp",
|
|
30
|
-
"profit_before_tax",
|
|
31
|
-
"tax",
|
|
32
|
-
"profit",
|
|
33
|
-
"related_revenue",
|
|
34
|
-
];
|
|
35
|
-
export const bsFields: (keyof BS)[] = [
|
|
36
|
-
"assets",
|
|
37
|
-
"curr_assets",
|
|
38
|
-
"fixed_assets",
|
|
39
|
-
"liabilities",
|
|
40
|
-
"curr_liabilities",
|
|
41
|
-
"fixed_liabilities",
|
|
42
|
-
"net_worth",
|
|
43
|
-
"capital_stock",
|
|
44
|
-
"capital_surplus",
|
|
45
|
-
"retained_earnings",
|
|
46
|
-
];
|
|
47
|
-
export const revenueFields: (keyof Revenue)[] = [
|
|
48
|
-
"sponsor",
|
|
49
|
-
"ticket",
|
|
50
|
-
"broadcast",
|
|
51
|
-
"academy_rev",
|
|
52
|
-
"women_rev",
|
|
53
|
-
"goods_rev",
|
|
54
|
-
"transfer_rev",
|
|
55
|
-
"transfer_int_rev",
|
|
56
|
-
"transfer_dom_rev",
|
|
57
|
-
"other_revs",
|
|
58
|
-
];
|
|
59
|
-
export const expenseFields: (keyof Expense)[] = [
|
|
60
|
-
"salary",
|
|
61
|
-
"transfer_exp",
|
|
62
|
-
"transfer_int_exp",
|
|
63
|
-
"transfer_dom_exp",
|
|
64
|
-
"game_exp",
|
|
65
|
-
"team_exp",
|
|
66
|
-
"academy_exp",
|
|
67
|
-
"women_exp",
|
|
68
|
-
"goods_exp",
|
|
69
|
-
"other_cost",
|
|
70
|
-
"manage_exp",
|
|
71
|
-
"sga",
|
|
72
|
-
];
|
|
73
|
-
export const attdFields: (keyof Attd)[] = [
|
|
74
|
-
"all_attd",
|
|
75
|
-
"all_games",
|
|
76
|
-
"average_attd",
|
|
77
|
-
"unit_price",
|
|
78
|
-
"league_attd",
|
|
79
|
-
"league_games",
|
|
80
|
-
"leaguecup_attd",
|
|
81
|
-
"leaguecup_games",
|
|
82
|
-
"po_attd",
|
|
83
|
-
"po_games",
|
|
84
|
-
"acl_attd",
|
|
85
|
-
"acl_games",
|
|
86
|
-
"second_attd",
|
|
87
|
-
"second_games",
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
export const allSortableFields = [
|
|
91
|
-
...plFields,
|
|
92
|
-
...bsFields,
|
|
93
|
-
...revenueFields,
|
|
94
|
-
...expenseFields,
|
|
95
|
-
...attdFields,
|
|
96
|
-
];
|
|
97
|
-
export const allFields: (keyof FinancialDatum)[] = [
|
|
98
|
-
...generalFields,
|
|
99
|
-
...allSortableFields,
|
|
100
|
-
];
|
package/src/clubs.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ClubInfo } from "./types";
|
|
2
|
-
import clubs from "./data/clubs.json";
|
|
3
|
-
|
|
4
|
-
export function getAllClubs() {
|
|
5
|
-
return clubs as ClubInfo[];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function getClubBySlug(slug: string) {
|
|
9
|
-
const clubs = getAllClubs();
|
|
10
|
-
return clubs.find((club) => club.slug === slug);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function getClubsByCategory(category: string) {
|
|
14
|
-
const clubs = getAllClubs();
|
|
15
|
-
return clubs.filter((club) =>
|
|
16
|
-
["J1", "J2", "J3"].includes(category)
|
|
17
|
-
? club.category === category
|
|
18
|
-
: ["JFL"].includes(club.category),
|
|
19
|
-
);
|
|
20
|
-
}
|