fluxion-ts 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -1
- package/Dockerfile +0 -13
- package/scripts/build-image.ts +0 -13
- package/scripts/configs.ts +0 -79
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluxion-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Kasukabe Tsumugi",
|
|
6
6
|
"email": "futami16237@gmail.com"
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"description": "Fluxion is able to start a server that can dynamically load routers and js files. It is designed to be used to replace PHP",
|
|
10
10
|
"description_zh": "Fluxion可以启动一个能够动态加载路由和js文件的服务器,旨在替代PHP",
|
|
11
11
|
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
"import": "./index.mjs",
|
|
14
|
+
"default": "./index.mjs",
|
|
15
|
+
"types": "./index.d.ts"
|
|
16
|
+
},
|
|
12
17
|
"homepage": "https://github.com/baendlorel/fluxion#readme",
|
|
13
18
|
"repository": {
|
|
14
19
|
"type": "git",
|
package/Dockerfile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
FROM node:24
|
|
2
|
-
WORKDIR /app
|
|
3
|
-
COPY package.json pnpm-lock.yaml ./
|
|
4
|
-
RUN npm install -g pnpm && pnpm install --frozen-lockfile
|
|
5
|
-
RUN pnpm install
|
|
6
|
-
COPY ./dist /app/
|
|
7
|
-
WORKDIR /app
|
|
8
|
-
|
|
9
|
-
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
|
10
|
-
|
|
11
|
-
ENV NODE_ENV=production
|
|
12
|
-
EXPOSE 3000
|
|
13
|
-
CMD ["pnpm", "start"]
|
package/scripts/build-image.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'node:child_process';
|
|
2
|
-
import { readFileSync } from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { bumpVersion } from './bump-version';
|
|
5
|
-
|
|
6
|
-
const pkgPath = path.resolve(import.meta.dirname, '..', '.image.json');
|
|
7
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')) as { name: string; version: string };
|
|
8
|
-
const imageName = `${pkg.name}:${pkg.version}`;
|
|
9
|
-
|
|
10
|
-
execSync('pnpm build', { stdio: 'inherit' });
|
|
11
|
-
execSync(`docker build -t ${imageName} .`, { stdio: 'inherit' });
|
|
12
|
-
|
|
13
|
-
bumpVersion(pkgPath);
|
package/scripts/configs.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
|
|
4
|
-
import type { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
5
|
-
|
|
6
|
-
export const getTSConfig = () => {
|
|
7
|
-
const tsconfigBuildPath = path.join(import.meta.dirname, '..', 'tsconfig.build.json');
|
|
8
|
-
const tsconfigPath = path.join(import.meta.dirname, '..', 'tsconfig.json');
|
|
9
|
-
return fs.existsSync(tsconfigBuildPath) ? tsconfigBuildPath : tsconfigPath;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// #region replace options
|
|
13
|
-
|
|
14
|
-
interface CommonPackageJson {
|
|
15
|
-
name: string;
|
|
16
|
-
version: string;
|
|
17
|
-
description: string;
|
|
18
|
-
description_zh: string;
|
|
19
|
-
author: {
|
|
20
|
-
name: string;
|
|
21
|
-
email: string;
|
|
22
|
-
};
|
|
23
|
-
license: string;
|
|
24
|
-
repository: {
|
|
25
|
-
type: string;
|
|
26
|
-
url: string;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function replaceOpts(): RollupReplaceOptions {
|
|
31
|
-
const pkg = JSON.parse(
|
|
32
|
-
fs.readFileSync(path.join(import.meta.dirname, '..', 'package.json'), 'utf-8'),
|
|
33
|
-
) as CommonPackageJson;
|
|
34
|
-
function formatDateFull(dt = new Date()) {
|
|
35
|
-
const y = dt.getFullYear();
|
|
36
|
-
const m = String(dt.getMonth() + 1).padStart(2, '0');
|
|
37
|
-
const d = String(dt.getDate()).padStart(2, '0');
|
|
38
|
-
const hh = String(dt.getHours()).padStart(2, '0');
|
|
39
|
-
const mm = String(dt.getMinutes()).padStart(2, '0');
|
|
40
|
-
const ss = String(dt.getSeconds()).padStart(2, '0');
|
|
41
|
-
const ms = String(dt.getMilliseconds()).padStart(3, '0');
|
|
42
|
-
return `${y}.${m}.${d} ${hh}:${mm}:${ss}.${ms}`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const __KEBAB_NAME__ = pkg.name.replace('rollup-plugin-', '');
|
|
46
|
-
const __VERSION__ = pkg.version;
|
|
47
|
-
const __NAME__ = __KEBAB_NAME__.replace(/(^|-)(\w)/g, (_, __, c) => c.toUpperCase());
|
|
48
|
-
|
|
49
|
-
const __PKG_INFO__ = `## About
|
|
50
|
-
* @package ${__NAME__}
|
|
51
|
-
* @author ${pkg.author.name} <${pkg.author.email}>
|
|
52
|
-
* @version ${pkg.version} (Last Update: ${formatDateFull()})
|
|
53
|
-
* @license ${pkg.license}
|
|
54
|
-
* @link ${pkg.repository.url}
|
|
55
|
-
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
56
|
-
* @description ${pkg.description.replace(/\n/g, '\n * \n * ')}
|
|
57
|
-
* @copyright Copyright (c) ${new Date().getFullYear()} ${pkg.author.name}. All rights reserved.`;
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
preventAssignment: true,
|
|
61
|
-
delimiters: ['', ''],
|
|
62
|
-
values: {
|
|
63
|
-
__IS_DEV__: 'false',
|
|
64
|
-
__NAME__,
|
|
65
|
-
__KEBAB_NAME__,
|
|
66
|
-
__PKG_INFO__,
|
|
67
|
-
__VERSION__,
|
|
68
|
-
|
|
69
|
-
// global error/warn/debug
|
|
70
|
-
"$throw('": `throw new Error('[${__NAME__} error] `,
|
|
71
|
-
'$throw(`': `throw new Error(\`[${__NAME__} error] `,
|
|
72
|
-
'$throw("': `throw new Error("[${__NAME__} error] `,
|
|
73
|
-
'$warn(': `console.warn('[${__NAME__} warn]',`,
|
|
74
|
-
'$error(': `console.error('[${__NAME__} error]',`,
|
|
75
|
-
'$debug(': `console.debug('[${__NAME__} debug]',`,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
// #endregion
|