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

Web extension for VSCode #23

Open
FreePhoenix888 opened this issue Dec 20, 2022 · 5 comments
Open

Web extension for VSCode #23

FreePhoenix888 opened this issue Dec 20, 2022 · 5 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@FreePhoenix888
Copy link
Member

FreePhoenix888 commented Dec 20, 2022

Extension must save history about user's file navigation

@FreePhoenix888 FreePhoenix888 converted this from a draft issue Dec 20, 2022
@FreePhoenix888 FreePhoenix888 moved this to In Progress in Deep Memo Dec 20, 2022
@FreePhoenix888
Copy link
Member Author

freephoenix888@freephoenix888:~/Programming/deep$ npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@vscode/[email protected]',
npm WARN EBADENGINE   required: { node: '>=16' },
npm WARN EBADENGINE   current: { node: 'v14.21.2', npm: '9.4.0' }
npm WARN EBADENGINE }

up to date, audited 212 packages in 929ms

46 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

@FreePhoenix888
Copy link
Member Author

FreePhoenix888 commented Feb 13, 2023

Main information

  1. Default web extension works
  2. Works if deeplinks is installed
  3. If we will restart vscode it works
  4. If we add imports from deeplinks
import { generateApolloClient } from '@deep-foundation/hasura/client';
import { DeepClient } from '@deep-foundation/deeplinks/imports/client';

we will get error
Cannot use JSX unless the '--jsx' flag is provided
Solution https://stackoverflow.com/a/64946881/13545849
5. If wee run extension command when the imports from deeplinks are added no error will be throwed
But if we restart vscode we will get errors
These errors dissappear if we run extension again

Extension is working
6. If we add deep client initialization inside hello world command:

let disposable = vscode.commands.registerCommand('deep.helloWorld', async () => {
		const nextPublicGqlPath = "";
		const apolloClient = generateApolloClient({
			path: nextPublicGqlPath, 
			ssl: !!nextPublicGqlPath.indexOf('localhost')
			  ? false
			  : true,
			// admin token in prealpha deep secret key
			// token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwczovL2hhc3VyYS5pby9qd3QvY2xhaW1zIjp7IngtaGFzdXJhLWFsbG93ZWQtcm9sZXMiOlsibGluayJdLCJ4LWhhc3VyYS1kZWZhdWx0LXJvbGUiOiJsaW5rIiwieC1oYXN1cmEtdXNlci1pZCI6IjI2MiJ9LCJpYXQiOjE2NTYxMzYyMTl9.dmyWwtQu9GLdS7ClSLxcXgQiKxmaG-JPDjQVxRXOpxs',
		 });
	  
		 const unloginedDeep = new DeepClient({ apolloClient });
		 const guest = await unloginedDeep.guest();
		 const guestDeep = new DeepClient({ deep: unloginedDeep, ...guest });
		 const admin = await guestDeep.login({
			linkId: await guestDeep.id('deep', 'admin'),
		 });
		 const deep = new DeepClient({ deep: guestDeep, ...admin });
		 vscode.window.showInformationMessage(`deep.linkId: ${deep.linkId}`);

		// Display a message box to the user
		vscode.window.showInformationMessage('Hello World from deep in a web extension host!');
	});

We will get these errors
The exact error is not found by google:
image

Additional information

extension.ts
webpack.config.js

@FreePhoenix888 FreePhoenix888 changed the title Extension for VSCode Web extension for VSCode Feb 13, 2023
@Konard
Copy link
Member

Konard commented Feb 14, 2023

Why didn't you paste the error message directly into issue text using Markdown code block?

@FreePhoenix888
Copy link
Member Author

Why didn't you paste the error message directly into issue text using Markdown code block?

Because the message will become a mess which will be hard to edit

@FreePhoenix888
Copy link
Member Author

FreePhoenix888 commented Mar 2, 2023

freephoenix888@freephoenix888:~/Programming/deep$ npm run watch-web 

> deep@0.0.1 watch-web
> webpack --watch

    [webpack-cli] Compiler starting... 
    [webpack-cli] Compiler is using config: '/home/freephoenix888/Programming/deep/webpack.config.js'
    [webpack-cli] Compiler finished
assets by path test/suite/ 796 KiB
  asset test/suite/index.js 795 KiB [compared for emit] [big] (name: test/suite/index) 1 related asset
  asset test/suite/index.d.ts 46 bytes [compared for emit]
  asset test/suite/extension.test.d.ts 11 bytes [compared for emit]
asset extension.js 5.31 KiB [compared for emit] (name: extension) 1 related asset
asset extension.d.ts 152 bytes [compared for emit]
runtime modules 309 bytes 2 modules
modules by path ./node_modules/ 823 KiB 44 modules
modules by path ./src/web/ 4.79 KiB
  modules by path ./src/web/test/suite/*.ts 2.15 KiB
    ./src/web/test/suite/index.ts 748 bytes [built] [code generated]
    ./src/web/test/suite/extension.test.ts 1.42 KiB [built] [code generated]
  ./src/web/extension.ts 2.46 KiB [built] [code generated]
  ./src/web/test/suite/ sync \.test$ 181 bytes [built] [code generated]
external "vscode" 42 bytes [built] [code generated]

WARNING in ./node_modules/mocha/mocha.js 19424:26-55
Critical dependency: the request of a dependency is an expression
 @ ./src/web/test/suite/index.ts 4:0-22

1 warning has detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

ERROR in ./node_modules/@deep-foundation/deeplinks/imports/client.tsx 23:17
Module parse failed: Unexpected token (23:17)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| Debug.enable(`${namespaces ? `${namespaces},` : ``}${error.namespace}`);
| 
> const corePckgIds: { [key: string]: number; } = {};
| corePckg.data.filter(l => !!l.type).forEach((l, i) => {
|   corePckgIds[l.id] = i+1;
 @ ./src/web/extension.ts 28:17-69

ERROR in ./node_modules/@deep-foundation/hasura/client.tsx 16:37
Module parse failed: Unexpected token (16:37)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| }
| 
> const DEEP_FOUNDATION_HASURA_RELATIVE: boolean | undefined = ((r) => r ? !!+r : undefined)(process.env.DEEP_FOUNDATION_HASURA_RELATIVE);
| const NEXT_PUBLIC_DEEP_FOUNDATION_HASURA_RELATIVE: boolean | undefined = ((r) => r ? !!+r : undefined)(process.env.NEXT_PUBLIC_DEEP_FOUNDATION_HASURA_RELATIVE);
| 
 @ ./src/web/extension.ts 27:17-58

webpack 5.75.0 compiled with 2 errors and 1 warning in 3386 ms
    [webpack-cli] Compiler is watching files for updates...
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: In Progress
Development

No branches or pull requests

3 participants