forked from mirrors/misskey
migrate build scripts to esmodules (#17071)
* chore: migrate build scripts to esmodules * chore: do not use export default in build script
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
@@ -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';
|
||||
|
||||
const __dirname = import.meta.dirname;
|
||||
|
||||
(async () => {
|
||||
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
|
||||
@@ -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 });
|
||||
@@ -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'] });
|
||||
|
||||
Reference in New Issue
Block a user