mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-21 03:30:42 +00:00
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:
@@ -23,7 +23,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile-config": "cd packages/backend && pnpm compile-config",
|
"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-assets": "node ./scripts/build-assets.mjs",
|
||||||
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
|
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
|
||||||
"build-storybook": "pnpm --filter frontend build-storybook",
|
"build-storybook": "pnpm --filter frontend build-storybook",
|
||||||
@@ -48,8 +48,8 @@
|
|||||||
"jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage",
|
"jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage",
|
||||||
"test": "pnpm -r test",
|
"test": "pnpm -r test",
|
||||||
"test-and-coverage": "pnpm -r test-and-coverage",
|
"test-and-coverage": "pnpm -r test-and-coverage",
|
||||||
"clean": "node ./scripts/clean.js",
|
"clean": "node scripts/clean.mjs",
|
||||||
"clean-all": "node ./scripts/clean-all.js",
|
"clean-all": "node scripts/clean-all.mjs",
|
||||||
"cleanall": "pnpm clean-all"
|
"cleanall": "pnpm clean-all"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import * as fs from 'node:fs/promises';
|
|||||||
import * as path from 'node:path';
|
import * as path from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import * as yaml from 'js-yaml';
|
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 configDir = fileURLToPath(new URL('../.config', import.meta.url));
|
||||||
const configPath = process.env.MISSKEY_CONFIG_YML
|
const configPath = process.env.MISSKEY_CONFIG_YML
|
||||||
|
|||||||
@@ -3,7 +3,10 @@
|
|||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* 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'
|
const packageJsonPath = __dirname + '/../package.json'
|
||||||
|
|
||||||
function build() {
|
function build() {
|
||||||
@@ -3,8 +3,10 @@
|
|||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { execSync } = require('child_process');
|
import { execSync } from 'note:child_process';
|
||||||
const fs = require('fs');
|
import * as fs from 'note:fs';
|
||||||
|
|
||||||
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
|
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fs = require('fs');
|
import * as fs from 'note:fs';
|
||||||
|
|
||||||
|
const __dirname = import.meta.dirname;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
fs.rmSync(__dirname + '/../packages/backend/built', { recursive: true, force: true });
|
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
|
// 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 mkdirPromise = mkdir(resolve(cwd, 'built', 'tarball'), { recursive: true });
|
||||||
const pack = new Pack({ cwd, gzip: true });
|
const pack = new Pack({ cwd, gzip: true });
|
||||||
const patterns = await walk({ path: cwd, ignoreFiles: ['.gitignore'] });
|
const patterns = await walk({ path: cwd, ignoreFiles: ['.gitignore'] });
|
||||||
|
|||||||
Reference in New Issue
Block a user