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

2Keys server build process broken #16

Closed
Gum-Joe opened this issue Jun 25, 2019 · 2 comments
Closed

2Keys server build process broken #16

Gum-Joe opened this issue Jun 25, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@Gum-Joe
Copy link
Owner

Gum-Joe commented Jun 25, 2019

Upon investigation in #15, it appears, when building from source, the typescript does not compile when running yarn (as I would expect). Therefore, typescript building needs to be added, either to the yarn install (provided NODE_ENV=development) or add instructions to the README.md

UPDATE: Add yarn run tsc to README.md should suffice, provided yarn install --production=false is also used.

UPDATE: yarn run tsc now fails, with this log:

server/src/init/daemon.ts:110:27 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

110   const VBS_SCRIPT = join(process.env.APPDATA, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", `${WINDOWS_DAEMON_PREFIX}${name}.vbs`);
                              ~~~~~~~~~~~~~~~~~~~

server/src/init/get-config.ts:92:15 - error TS2339: Property 'push' does not exist on type 'Questions<Answers>'.
  Property 'push' does not exist on type 'Question<Answers>'.

92     questions.push({
                 ~~~~

server/src/init/get-config.ts:100:15 - error TS2339: Property 'push' does not exist on type 'Questions<Answers>'.
  Property 'push' does not exist on type 'Question<Answers>'.

100     questions.push({
                  ~~~~

server/src/init/get-config.ts:127:26 - error TS2339: Property 'push' does not exist on type 'ReadonlyArray<Question<Answers>>'.

127       questions_keyboard.push({
                             ~~~~

server/src/init/get-config.ts:133:26 - error TS2339: Property 'push' does not exist on type 'ReadonlyArray<Question<Answers>>'.

133       questions_keyboard.push({
                             ~~~~

server/src/init/get-config.ts:168:40 - error TS2538: Type 'undefined' cannot be used as an index type.

168         const name = answers_keyboards[keyboard_q.name]; // Get answer user provided for name
                                           ~~~~~~~~~~~~~~~

server/src/init/get-config.ts:175:50 - error TS2538: Type 'undefined' cannot be used as an index type.

175         current_keyboard_dir = answers_keyboards[keyboard.name];
                                                     ~~~~~~~~~~~~~

server/src/init/get-config.ts:177:26 - error TS2538: Type 'undefined' cannot be used as an index type.

177         config.keyboards[current_keyboard_name] = {
                             ~~~~~~~~~~~~~~~~~~~~~

server/src/oobe/index.ts:55:9 - error TS2454: Variable 'config' is used before being assigned.

55     if (config.oobe && !argv.force) {
           ~~~~~~

server/src/oobe/index.ts:64:7 - error TS2454: Variable 'config' is used before being assigned.

64       config.oobe = true;
         ~~~~~~

server/src/oobe/software/zip-downloader.ts:114:36 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'PathLike'.
  Type 'undefined' is not assignable to type 'PathLike'.

114         res.pipe(createWriteStream(this.fullPath)); // Pipe to writer
                                       ~~~~~~~~~~~~~

server/src/routes/api.ts:100:22 - error TS2532: Object is possibly 'undefined'.

100             res.send(err.stack.toString());
                         ~~~~~~~~~

server/src/util/ahk.ts:83:122 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

83         const ahk_run = ahk.run_ahk_text(join(userspace_config.paths.software, userspace_config.software.ahk.paths.root, userspace_config.software.ahk.paths.dll), `#Include ${file}\n${func}()`);
                                                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

server/src/util/copy-contents.ts:84:56 - error TS2339: Property 'contents' does not exist on type 'FileTreeNode'.

84         const nextDirs = await get_dirs_from_tree(node.contents) // Dirs in this current dir
                                                          ~~~~~~~~

server/src/util/copy-contents.ts:106:58 - error TS2339: Property 'contents' does not exist on type 'FileTreeNode'.

106         const nextFiles = await get_files_from_tree(node.contents) // Dirs in this current dir
                                                             ~~~~~~~~

The terminal process terminated with exit code: 1

(from @codemicro , #15, replicatable on @Gum-Joe's machine)

@Gum-Joe Gum-Joe added the bug Something isn't working label Jun 25, 2019
@Gum-Joe Gum-Joe changed the title 2Keys server build process not correct 2Keys server build process broken Jun 25, 2019
@Gum-Joe
Copy link
Owner Author

Gum-Joe commented Jun 25, 2019

Fixed by #17, now merged (042c07f)

@Gum-Joe Gum-Joe closed this as completed Jun 25, 2019
@Gum-Joe
Copy link
Owner Author

Gum-Joe commented Jun 26, 2019

v0.3.7 is now published, should resolve the global install issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant