Skip to content

Commit c0db1a3

Browse files
committed
ESM
1 parent 45a651e commit c0db1a3

13 files changed

+42
-40
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "MIT",
66
"author": "sosukesuzuki <[email protected]>",
77
"main": "index.js",
8+
"type": "module",
89
"scripts": {
910
"fix": "prettier . -w",
1011
"lint": "run-p \"lint:*\"",

src/artifact.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as artifact from "@actions/artifact";
22
import * as github from "@actions/github";
33
import * as path from "path";
44
import * as fs from "fs";
5-
import { getOctokit } from "./octokit";
5+
import { getOctokit } from "./octokit.ts";
66

77
export async function uploadToArtifact(
88
texts: string[],

src/execute/get-pretty-head-commit-hash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as git from "../tools/git";
1+
import * as git from "../tools/git.ts";
22

33
/**
44
* Returns head commit hash and repository name like "sosukesuzuki/prettier@foo"

src/execute/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { existsSync } from "fs";
2-
import { Command } from "../parse";
3-
import { getPrettyHeadCommitHash } from "./get-pretty-head-commit-hash";
4-
import { preparePrettierIgnoreFile } from "./prepare-prettier-ignore-file";
5-
import { runPrettier } from "./run-prettier";
6-
import { setupPrettierRepository } from "./setup-repository";
7-
import * as configuration from "../configuration";
8-
import * as git from "../tools/git";
9-
import * as logger from "../logger";
10-
import { getProjects, getTargetRepositoryPath } from "../projects";
2+
import { Command } from "../parse.ts";
3+
import { getPrettyHeadCommitHash } from "./get-pretty-head-commit-hash.ts";
4+
import { preparePrettierIgnoreFile } from "./prepare-prettier-ignore-file.ts";
5+
import { runPrettier } from "./run-prettier.ts";
6+
import { setupPrettierRepository } from "./setup-repository.ts";
7+
import * as configuration from "../configuration.ts";
8+
import * as git from "../tools/git.ts";
9+
import * as logger from "../logger.ts";
10+
import { getProjects, getTargetRepositoryPath } from "../projects.ts";
1111

1212
export interface ExecuteResultEntry {
1313
commitHash: string;

src/execute/prepare-prettier-ignore-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
getProjectName,
55
type Project,
66
getTargetRepositoryPath,
7-
} from "../projects";
7+
} from "../projects.ts";
88

99
export async function preparePrettierIgnoreFile(
1010
project: Project,

src/execute/run-prettier.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from "path";
22
import spawn from "nano-spawn";
3-
import { type Project, getTargetRepositoryPath } from "../projects";
4-
import * as yarn from "../tools/yarn";
3+
import { type Project, getTargetRepositoryPath } from "../projects.ts";
4+
import * as yarn from "../tools/yarn.ts";
55

66
export async function runPrettier(
77
prettierRepositoryPath: string,

src/execute/setup-repository.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import {
33
PrettierRepositorySourcePrNumber,
44
PrettierRepositorySourceRepositoryAndRef,
55
PrettierRepositorySource,
6-
} from "../parse";
7-
import * as configuration from "../configuration";
8-
import * as brew from "../tools/brew";
9-
import * as gh from "../tools/gh";
10-
import * as git from "../tools/git";
11-
import * as yarn from "../tools/yarn";
12-
import * as unix from "../tools/unix";
6+
} from "../parse.ts";
7+
import * as configuration from "../configuration.ts";
8+
import * as brew from "../tools/brew.ts";
9+
import * as gh from "../tools/gh.ts";
10+
import * as git from "../tools/git.ts";
11+
import * as yarn from "../tools/yarn.ts";
12+
import * as unix from "../tools/unix.ts";
1313

1414
export async function setupPrettierRepository(
1515
prettierRepositorySource: PrettierRepositorySource,

src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import fs from "fs/promises";
22
import {inspect} from 'node:util'
33
import * as core from "@actions/core";
4-
import * as configuration from "./configuration";
5-
import * as logger from "./logger";
6-
import { execute } from "./execute";
7-
import { getLogText } from "./log-text";
8-
import { parse } from "./parse";
9-
import { getIssueComment } from "./get-issue-comment";
10-
import { cloneProjects } from "./projects";
11-
import { uploadToArtifact } from "./artifact";
4+
import * as configuration from "./configuration.ts";
5+
import * as logger from "./logger.ts";
6+
import { execute } from "./execute/index.ts";
7+
import { getLogText } from "./log-text.ts";
8+
import { parse } from "./parse.ts";
9+
import { getIssueComment } from "./get-issue-comment.ts";
10+
import { cloneProjects } from "./projects.ts";
11+
import { uploadToArtifact } from "./artifact.ts";
1212
import { outdent } from "outdent";
1313

1414
async function exit(error: Error | string) {

src/log-text.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as configuration from "./configuration";
2-
import { ExecuteResultEntry } from "./execute";
3-
import { Command, PrettierRepositorySource } from "./parse";
1+
import * as configuration from "./configuration.ts";
2+
import { ExecuteResultEntry } from "./execute/index.ts";
3+
import { Command, PrettierRepositorySource } from "./parse.ts";
44

55
function getPrettierRepositorySourceText(
66
prettierRepositorySource: PrettierRepositorySource,

src/logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from "fs/promises";
22
import * as github from "@actions/github";
3-
import * as configuration from "./configuration";
4-
import { getOctokit } from "./octokit";
3+
import * as configuration from "./configuration.ts";
4+
import { getOctokit } from "./octokit.ts";
55

66
let commentId: number | undefined;
77
async function logToIssueComment(logText: string, separateComment = false) {

0 commit comments

Comments
 (0)