Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature/Enhancement] 请教一下 cli程序是否可以自行编译,如何编译? #1448

Open
xaserver opened this issue Oct 22, 2024 · 5 comments

Comments

@xaserver
Copy link

为何需要此功能 | Why is this needed

请教一下 cli程序是否可以自行编译,如何编译?

希望增加什么 | What would you like to be added

No response

此功能为谁设计? | Who is this feature for?

No response

@Miracle575
Copy link
Contributor

可以拉取代码后进入 apps/cli 目录下,先执行 pnpm i,再执行 pnpm build 进行编译

@xaserver
Copy link
Author

[root@iZj6cdk86wk0jx4xwoxunrZ cli]# pnpm i
Scope: all 31 workspace projects
../.. | +2474 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
../.. | Progress: resolved 2474, reused 2468, downloaded 0, added 2474, done
../../node_modules/.pnpm/[email protected]/node_modules/cpu-features: Running install script, failed in 1.1s (skipped as optional)
../../node_modules/.pnpm/[email protected]/node_modules/tree-sitter-json: Running install script, failed in 1.1s (skipped as optional)
../../node_modules/.pnpm/[email protected]/node_modules/tree-sitter-yaml: Running install script, failed in 1.1s (skipped as optional)
../../node_modules/.pnpm/[email protected]/node_modules/tree-sitter: Running install script, failed in 1.5s (skipped as optional)

dependencies:

  • @octokit/rest 20.1.1
  • @scow/config 1.5.2 <- ../../libs/config
  • @scow/lib-config 1.0.1 <- ../../libs/libconfig
  • @sinclair/typebox 0.32.34
  • death 1.1.0
  • dotenv 16.4.5
  • https-proxy-agent 7.0.4
  • js-yaml 4.1.0
  • jszip 3.10.1
  • node-fetch-commonjs 3.3.2
  • pino 8.16.2
  • pino-pretty 10.3.1
  • pkg 5.8.1
  • prompts 2.4.2
  • yargs 17.7.2

devDependencies:

  • @types/death 1.1.5
  • @types/js-yaml 4.0.9
  • @types/prompts 2.4.9
  • @types/yargs 17.0.32

../.. prepare$ node -e "try { import('husky').then((d) => console.log(d.default())) } catch (e) {if (e.code !== 'MODULE_NOT_FOUND' && !e.message.startsWith('.git')) throw e}"
└─ Done in 95ms
Done in 25s
[root@iZj6cdk86wk0jx4xwoxunrZ cli]# pnpm build

@scow/[email protected] build /opt/test/OpenSCOW/apps/cli
rimraf build && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && pkg --compress GZip --no-bytecode --public-packages "*" --public .

src/cmd/checkConfig.ts:13:29 - error TS2307: Cannot find module '@scow/config/build/ai' or its corresponding type declarations.

13 import { getAiConfig } from "@scow/config/build/ai";
~~~~~~~~~~~~~~~~~~~~~~~

src/cmd/checkConfig.ts:14:31 - error TS2307: Cannot find module '@scow/config/build/app' or its corresponding type declarations.

14 import { getAppConfigs } from "@scow/config/build/app";
~~~~~~~~~~~~~~~~~~~~~~~~

src/cmd/checkConfig.ts:15:35 - error TS2307: Cannot find module '@scow/config/build/cluster' or its corresponding type declarations.

15 import { getClusterConfigs } from "@scow/config/build/cluster";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/cmd/checkConfig.ts:16:39 - error TS2307: Cannot find module '@scow/config/build/clusterTexts' or its corresponding type declarations.

16 import { getClusterTextsConfig } from "@scow/config/build/clusterTexts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/cmd/checkConfig.ts:17:33 - error TS2307: Cannot find module '@scow/config/build/common' or its corresponding type declarations.

17 import { getCommonConfig } from "@scow/config/build/common";
~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/cmd/checkConfig.ts:18:30 - error TS2307: Cannot find module '@scow/config/build/mis' or its corresponding type declarations.

18 import { getMisConfig } from "@scow/config/build/mis";
~~~~~~~~~~~~~~~~~~~~~~~~

src/cmd/checkConfig.ts:19:33 - error TS2307: Cannot find module '@scow/config/build/portal' or its corresponding type declarations.

19 import { getPortalConfig } from "@scow/config/build/portal";
~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/cmd/checkConfig.ts:20:29 - error TS2307: Cannot find module '@scow/config/build/ui' or its corresponding type declarations.

20 import { getUiConfig } from "@scow/config/build/ui";
~~~~~~~~~~~~~~~~~~~~~~~

src/config/env.ts:13:38 - error TS2307: Cannot find module '@scow/lib-config' or its corresponding type declarations.

13 import { bool, envConfig, str } from "@scow/lib-config";
~~~~~~~~~~~~~~~~~~

src/config/install.ts:13:27 - error TS2307: Cannot find module '@scow/lib-config/build/fileConfig' or its corresponding type declarations.

13 import { getConfig } from "@scow/lib-config/build/fileConfig";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 10 errors in 3 files.

Errors Files
8 src/cmd/checkConfig.ts:13
1 src/config/env.ts:13
1 src/config/install.ts:13
 ELIFECYCLE  Command failed with exit code 2.
 报以上错误

@xaserver
Copy link
Author

当 docker build -f docker/Dockerfile.scow -t scow . 的编译过程中 看到有cli的 build过程,就是没有找到exe目录和其生成的文件

1 similar comment
@xaserver
Copy link
Author

当 docker build -f docker/Dockerfile.scow -t scow . 的编译过程中 看到有cli的 build过程,就是没有找到exe目录和其生成的文件

@Miracle575
Copy link
Contributor

不好意思,之前的回复有部分错误,由于项目时 monorepo 的所以直接在 cli 目录下执行 pnpm i 会有问题
您可以按一下步骤重新尝试:

  1. 在项目根目录下执行
pnpm i --frozen-lockfile --filter @scow/cli...
pnpm build "--filter=@scow/cli"
  1. apps/cli/exe 中寻找编译后的产物

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants