Skip to content

Commit

Permalink
refactor: use src/ as root
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Dec 21, 2023
1 parent d533ac4 commit fa4045e
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ coverage/
dist/
exe/
node_modules/

# required for building with TS
src/package.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"debug": "ts-node src/cli.ts",
"lint": "alex . && knip && npm run lint:ts && npm run prettier && npm run schemas:check",
"lint:ts": "eslint . --ext .js,.ts",
"prebuild": "rm -rf dist/",
"prebuild": "rm -rf dist/ && rm -f src/package.json && ln package.json src/package.json",
"prepack": "npm run build",
"prepare": "husky install",
"pretest": "npm run build",
Expand Down
3 changes: 1 addition & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import * as core from '@actions/core';
import chalk from 'chalk';
import updateNotifier from 'update-notifier';

import pkg from '../package.json' assert { type: 'json' };

import { isGHA } from './lib/isCI.js';
import pkg from './package.json' assert { type: 'json' };

import rdme from './index.js';

Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import chalk from 'chalk';
import cliArgs from 'command-line-args';
import parseArgsStringToArgv from 'string-argv';

import pkg from '../package.json' assert { type: 'json' };

import * as commands from './lib/commands.js';
import config from './lib/config.js';
import createGHA from './lib/createGHA/index.js';
import getCurrentConfig from './lib/getCurrentConfig.js';
import * as help from './lib/help.js';
import { debug } from './lib/logger.js';
import pkg from './package.json' assert { type: 'json' };

const { version } = pkg;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pkg from '../../package.json' assert { type: 'json' };
import pkg from '../package.json' assert { type: 'json' };

const config = {
cli: pkg.name,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/configstore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Configstore from 'configstore';

import pkg from '../../package.json' assert { type: 'json' };
import pkg from '../package.json' assert { type: 'json' };

const configstore = new Configstore(
/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/getPkgVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import fetch from 'node-fetch';
import semver from 'semver';

import pkg from '../../package.json' assert { type: 'json' };
import pkg from '../package.json' assert { type: 'json' };

import { error } from './logger.js';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/readmeAPIFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import path from 'node:path';
import mime from 'mime-types';
import nodeFetch, { Headers } from 'node-fetch'; // eslint-disable-line no-restricted-imports

import pkg from '../../package.json' assert { type: 'json' };
import pkg from '../package.json' assert { type: 'json' };

import APIError from './apiError.js';
import config from './config.js';
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"module": "NodeNext",
"outDir": "dist/",
"resolveJsonModule": true,
"rootDir": "src",
"skipLibCheck": true,
"strict": true,
"target": "ES2022",
Expand Down

0 comments on commit fa4045e

Please sign in to comment.