Skip to content

Commit

Permalink
Revert "refactor: console 제거 및 사용하지 않는 dependency 삭제" (#258)
Browse files Browse the repository at this point in the history
This reverts commit 1f02c74.
  • Loading branch information
saseungmin authored Dec 7, 2024
1 parent 1f02c74 commit 13f5986
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
Binary file not shown.
12 changes: 2 additions & 10 deletions apps/web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,12 @@ module.exports = {
{
extends: ['plugin:storybook/recommended'],
files: ['**/*.stories.ts?(x)'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['scripts/**/*.ts'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
rules: {},
},
],
rules: {
'import/no-extraneous-dependencies': ['error', {
devDependencies: ['**/*.test.ts', '**/*.test.tsx', 'next.config.js'],
devDependencies: ['**/*.test.ts', '**/*.test.tsx', '**/*.stories.tsx', '**/*.stories.ts', 'next.config.js', 'scripts/**/*.ts'],
}],
},
};
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"cypress": "12.1.0",
"dotenv": "16.4.7",
"eslint": "8.56.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "18.0.0",
Expand Down
18 changes: 14 additions & 4 deletions apps/web/scripts/generate-applicant-count.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint-disable import/no-extraneous-dependencies */
import 'dotenv/config';

import * as fs from 'fs';
import * as path from 'path';

import { loadEnvConfig } from '@next/env';
import { JWT } from 'google-auth-library';
import { GoogleSpreadsheet } from 'google-spreadsheet';

Expand All @@ -13,21 +15,29 @@ const checkNumber = (value?: number | null): number => {
return 0;
};

const projectDir = process.cwd();
loadEnvConfig(projectDir);

const PROJECT_ROOT = path.resolve(__dirname, '../..');

async function generateApplicantCount() {
try {
console.log('Environment check:');
console.log('GOOGLE_CLIENT_EMAIL:', process.env.GOOGLE_CLIENT_EMAIL);
console.log('GOOGLE_PRIVATE_KEY exists:', !!process.env.GOOGLE_PRIVATE_KEY);

const key = process.env.GOOGLE_PRIVATE_KEY?.replace(/\\n/g, '\n');
console.log('Formatted key starts with:', key?.substring(0, 50));
console.log('Formatted key ends with:', key?.substring(key.length - 50));

const serviceAccountAuth = new JWT({
email: process.env.GOOGLE_CLIENT_EMAIL,
key,
scopes: ['https://www.googleapis.com/auth/spreadsheets'],
});

// 인증 테스트
console.log('Attempting to authenticate...');
await serviceAccountAuth.authorize();
console.log('Authentication successful!');

const developerApplicantDoc = new GoogleSpreadsheet('1OLzUsZ1TBmKeEJh-ENoXWdccfwTg7WY3-zeOmcACxRc', serviceAccountAuth);
const designerApplicantDoc = new GoogleSpreadsheet('1KrwSZoUY3i6asMWtxIQsaofMP9rCmxnDpD_sZ4yOC-c', serviceAccountAuth);

Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8994,6 +8994,13 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:16.4.7":
version: 16.4.7
resolution: "dotenv@npm:16.4.7"
checksum: 10/f13bfe97db88f0df4ec505eeffb8925ec51f2d56a3d0b6d916964d8b4af494e6fb1633ba5d09089b552e77ab2a25de58d70259b2c5ed45ec148221835fc99a0c
languageName: node
linkType: hard

"duplexer@npm:~0.1.1":
version: 0.1.2
resolution: "duplexer@npm:0.1.2"
Expand Down Expand Up @@ -19202,6 +19209,7 @@ __metadata:
clsx: "npm:2.1.1"
cypress: "npm:12.1.0"
dayjs: "npm:1.11.11"
dotenv: "npm:16.4.7"
eslint: "npm:8.56.0"
eslint-config-airbnb: "npm:19.0.4"
eslint-config-airbnb-typescript: "npm:18.0.0"
Expand Down

0 comments on commit 13f5986

Please sign in to comment.