Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"private": true,
"scripts": {
"compile-config": "cd packages/backend && pnpm compile-config",
"build-pre": "node ./scripts/build-pre.js",
"build-pre": "node scripts/build-pre.mjs",
"build-assets": "node ./scripts/build-assets.mjs",
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
"build-storybook": "pnpm --filter frontend build-storybook",
Expand All @@ -48,8 +48,8 @@
"jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage",
"test": "pnpm -r test",
"test-and-coverage": "pnpm -r test-and-coverage",
"clean": "node ./scripts/clean.js",
"clean-all": "node ./scripts/clean-all.js",
"clean": "node scripts/clean.mjs",
"clean-all": "node scripts/clean-all.mjs",
"cleanall": "pnpm clean-all"
},
"resolutions": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-assets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';
import * as yaml from 'js-yaml';
import buildTarball from './tarball.mjs';
import { buildTarball } from './tarball.mjs';

const configDir = fileURLToPath(new URL('../.config', import.meta.url));
const configPath = process.env.MISSKEY_CONFIG_YML
Expand Down
5 changes: 4 additions & 1 deletion scripts/build-pre.js → scripts/build-pre.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

const fs = require('fs');
import * as fs from 'node:fs';

const __dirname = import.meta.dirname;

const packageJsonPath = __dirname + '/../package.json'

function build() {
Expand Down
6 changes: 4 additions & 2 deletions scripts/clean-all.js → scripts/clean-all.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

const { execSync } = require('child_process');
const fs = require('fs');
import { execSync } from 'note:child_process';
import * as fs from 'note:fs';
Comment on lines +6 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodeのtypoっぽい

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみませんでした。=> #17076


const __dirname = import.meta.dirname;

(async () => {
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
Expand Down
4 changes: 3 additions & 1 deletion scripts/clean.js → scripts/clean.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

const fs = require('fs');
import * as fs from 'note:fs';

const __dirname = import.meta.dirname;

(async () => {
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
Expand Down
2 changes: 1 addition & 1 deletion scripts/tarball.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ignore = [
// Exclude files you don't want to include in the tarball here
];

export default async function build() {
export async function buildTarball() {
const mkdirPromise = mkdir(resolve(cwd, 'built', 'tarball'), { recursive: true });
const pack = new Pack({ cwd, gzip: true });
const patterns = await walk({ path: cwd, ignoreFiles: ['.gitignore'] });
Expand Down