๐Ÿ’ป VSCode Extension for AdonisJS

Overview

๐Ÿ’ป Official AdonisJS extension for VSCode

Features

  • Use all Adonis Assembler commands ( make:* )
  • Migrate and seed your database ( db:*, migration:* )
  • View your routes within VSCode
  • Open and see docs within VSCode
  • .adonisrc.json file validation with JSON Schema
  • Edge Support, syntax highlighting + formatting
  • Edge and AdonisJS Snippets
  • Go To Controller
  • Go To View

Ace commands

Launch ace commands directly from VScode. Files created by adonis/assembler are automatically opened after their creation.

List Routes

List all routes in your project from VSCode and filter them.

Documentations

Consult and search the Adonis and Japa documentation directly from VSCode.

JSON Schema for .adonisrc

Route controller completion + Go To

Autocompletion for the name and handler of the controllers, alt+click to open the file, and the docblock documentation of the method that is displayed in hover.

Edge support

Syntax highlighting, auto-completion of the tags that includes partials/components/layouts, alt+click to open an included file, many snippets... No automatic formatting for the moment

Known Issues

Below is the list of unsupported features (for the moment), feel free to make a PR if you want them to be delivered faster:

  • Edge Links Provider for Component as tags
  • Edge Links Provider for @includeIf tag
  • Multiple workspaces support

Contributing

  • See contributing guide
  • Clone the project and open it in VS Code
  • Run npm install
  • Press F5 to open a new VSCode window with your extension loaded.
  • You can relaunch the extension from the debug toolbar after changing code in src/extension.ts.
  • You can also reload (Ctrl+R or Cmd+R on Mac) the VS Code window with your extension to load your changes.
Comments
  • Support monorepo structures

    Support monorepo structures

    Why this feature is required (specific use-cases will be appreciated)?

    It would be nice to be able to use the extension with a monorepo structure where the AdonisJS files are in a subdirectory. For example, I have an app where there is an AdonisJS API in ./api and a React frontend in ./front.

    I get this kind of error:

    Error: Command failed: cd /d "d:/Git/project" && node ace generate:manifest
    node:internal/modules/cjs/loader:936
      throw err;
      ^
    
    Error: Cannot find module 'd:\Git\project\ace'
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
        at Function.Module._load (node:internal/modules/cjs/loader:778:27)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
        at node:internal/main/run_main_module:17:47 {
      code: 'MODULE_NOT_FOUND',
      requireStack: []
    }
    
    

    Have you tried any other work arounds?

    Couldn't think of one.

    Are you willing to work on it with little guidance?

    Maybe, but I'm short on time at the moment.

    enhancement 
    opened by targos 8
  • Running commands on click is risky

    Running commands on click is risky

    I have a few commands that wipe out the data/db. A simple missclick can end up with bad consequences (even if it's just the local dev environment, time can be lost).

    enhancement 
    opened by targos 6
  • Running commands doesn't work on Windows

    Running commands doesn't work on Windows

    PS C:\git\project> cd /d "c:\git\project\api" && "node" ace playground  
    ParserError: 
    Line |
       1 |  cd /d "c:\git\project\api" && "node" ace playground
         |                                       ~~~
         | Unexpected token 'ace' in expression or statement.
    
    bug 
    opened by targos 3
  • Error

    Error "Unexpected token S in JSON at position 0" after v0.6.0 update

    Package version

    v0.6.0

    Node.js and npm version

    Node: v18.7.0 Npm: 8.15.0 Installed through NVM

    Description

    Hello. I'm getting these errors after yesterday update. My routes are completely standard, I didn't change their location and etc. node ace list:routes works just fine. I'm using vscode remote development extension.

    image image

    App/Start/Routes.ts

    import Route from '@ioc:Adonis/Core/Route';
    import HealthCheck from '@ioc:Adonis/Core/HealthCheck';
    import './routes/users';
    
    Route.get('/', async () => {
    
      return { hello: 'world' }
    
    });
    
    Route.get('test', async () => {
    
      return { app: 'is working.' }
      
    });
    
    Route.get('health', async ({ response }) => {
      const report = await HealthCheck.getReport()
    
      return report.healthy
        ? response.ok(report)
        : response.badRequest(report)
    });
    

    App/Start/routes/users.ts

    import Route from '@ioc:Adonis/Core/Route';
    
    Route.group(() => {
    
      Route.group(() => {
    
        Route.get('login', 'SignInController.create');
    
        Route.post('login', 'SignInController.store');
    
        Route.post('register', 'SignUpController.store');
    
        Route.get('logout', 'SignInController.destroy');
    
        Route.get('forgot', 'ForgotPasswordController.getForm');
    
        Route.post('forgot', 'ForgotPasswordController.postEmail');
    
        Route.get('forgot/:hash', 'ForgotPasswordController.checkHash');
    
        Route.post('forgot/:hash', 'ForgotPasswordController.changePassword');
    
      }).prefix('web');
    
    }).prefix('u');
    
    Route.resource('u', 'UsersController')
      .except(['index', 'create', 'store'])
      .paramFor('u', 'userId');
    

    Thanks in advance.

    opened by sowind 3
  • adding the extension on vscodium oss store

    adding the extension on vscodium oss store

    vscodium is bloatware free VSCODE. A lot of extensions from massive companies popular for OSS are on https://open-vsx.org/ (some including RedHat, Gitlab etc)

    I have just started learning Adonis and we use it for our product. It would be really helpful if the extension can be made available on opne-vsx store. It's not very difficult or time consuming task. It's a matter of just uploading vsix

    enhancement 
    opened by AbhimanyuAryan 2
  • Issue loading extension in project

    Issue loading extension in project

    Package version

    yarn list v1.22.19
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”‚  โ””โ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ @adonisjs/[email protected]
    โ”œโ”€ [email protected]
    โ”œโ”€ [email protected]
    โ”‚  โ”œโ”€ @adonisjs/[email protected]
    โ”‚  โ””โ”€ @adonisjs/[email protected]
    โ”œโ”€ [email protected]
    โ”œโ”€ [email protected]
    โ””โ”€ [email protected]
    

    Node.js and npm version

    Node: v14.17.6 Yarn: 1.22.19

    Description

    When open my project i get a error for the extension with the message Cannot convert undefined or null to object and not show any more information

    wontfix 
    opened by Doc94 2
  • Error: Command failed:

    Error: Command failed: "node" ace list:routes --json

    Package version

    0.8.0

    Node.js and npm version

    16.14.2 & 8.5.0

    Not able to see routes list, getting this error Error: Command failed: "node" ace list:routes --json

    duplicate 
    opened by RockyScube 2
  • Add make:policy Command

    Add make:policy Command

    Proposed changes

    https://docs.adonisjs.com/guides/authorization Add make:policy Command from Bouncer package imagen

    Types of changes

    What types of changes does your code introduce?

    Put an x in the boxes that apply

    • [ ] Bugfix (non-breaking change which fixes an issue)
    • [X] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist

    Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

    • [X] I have read the CONTRIBUTING doc
    • [ ] Lint and unit tests pass locally with my changes
    • [ ] I have added tests that prove my fix is effective or that my feature works.
    • [X] I have added necessary documentation (if appropriate)

    Further comments

    Lint was ok, but test yell at me about things I didn't touch, is that normal? I would like some help implementing this commands test. I didn't see how to test a single Command. Thanks!

    opened by TheJltres 2
  • List Routes does not show routes with .domain()

    List Routes does not show routes with .domain()

    The "list routes" table is missing routes that use .domain(), e.g.

    Route.get('/', ({ view }) => view.render('landing/index'))
    Route.get('/caddy/allowed-domain', 'TenantsController.checkAllowedDomain')
    
    // Tenant routes
    Route.group(() => {
        Route.get('/admin/reports', 'ReportsController.index')
        Route.get('/admin/sessions', 'SessionsController.index')
        Route.get('/admin/tickets', 'TicketsController.index')
    })
      .domain(`:tenantSlug.${Env.get('BASE_DOMAIN')}`) // ๐Ÿ‘ˆ without this line, it seems to work fine
      .middleware(['auth:web'])
    

    The result

    Note that the following routes are missing:

    • /admin/reports
    • /admin/sessions
    • /admin/tickets

    image

    Package versions

    • adonis-vscode-extension - v0.3.0
    • Node.js - v16.15.0
    • NPM - v8.5.5
    enhancement 
    opened by joelcieslar 2
  • npm workspaces detection should not find the same workspace twice

    npm workspaces detection should not find the same workspace twice

    When npm workspaces are used, npm creates for each workspace a symbolic link under node_modules that points to the module in the workspace. The problem is that this extension finds it and then proposes two options when you try for example to list routes: Screenshot 2022-04-30 at 13 25 51

    If there are no use cases for looking inside node_modules, these folders can just be ignored. Otherwise, it may be possible to use fs.realpath to make sure the same absolute path isn't listed twice.

    bug 
    opened by targos 0
  • Extension don't work with Yarn PnP

    Extension don't work with Yarn PnP

    An error occurs when executing a command or checking the route list in an AdonisJS application that uses Yarn PnP:

    Error: Command failed: "node" ace list:routes --json
    node:internal/modules/cjs/loader:998
      throw err;
      ^
    
    Error: Cannot find module 'reflect-metadata'
    Require stack:
    - /home/user/adonis-app/ace
        at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
        at Module._load (node:internal/modules/cjs/loader:841:27)
        at Module.require (node:internal/modules/cjs/loader:1061:19)
        at require (node:internal/modules/cjs/helpers:103:18)
        at Object.<anonymous> (/home/user/adonis-app/ace:10:1)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [ '/home/user/adonis-app/ace' ]
    }
    

    In fact, the extension runs the Ace cli file using Node and not Yarn, so the installed packages are not found. It would be great to add a system to detect the package manager used by the user (as it is the case in the create-adonis-ts-app package).

    Package version

    v0.9.1

    Node.js and Yarn version

    Node.js: v18.12.1 Yarn: v3.3.0

    opened by B-Derouet 2
Releases(0.9.0)
  • 0.9.0(Oct 31, 2022)

    Features

    • We can now Alt + click on a View method to go directly to the Edge file goview

    • Add db:seed command

    • Add db:wipe command

    • Add make:mailer command

    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Sep 27, 2022)

    Japa snippets have been moved to the extension dedicated to Japa that you can download here :

    https://marketplace.visualstudio.com/items?itemName=jripouteau.japa-vscode

    Full Changelog: https://github.com/Julien-R44/adonis-vscode-extension/compare/0.7.0...0.8.0

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Sep 17, 2022)

    ๐Ÿš€ Enhancements

    • Add syntax highlighting for new @js tag (ee3df03)
    • Add first version of TestsExtractor (d2ce93d)
    • Add a CodeLens for each tests in the file (6bed418)
    • Launching commands on icon click (84bce4d)

    ๐Ÿฉน Fixes

    • Run command in cmd.exe if windows (ccf99aa)

    ๐Ÿ’… Refactors

    • Include brisk routes in tree view (507f7b6)
    • Replaced @poppinns/module-methods-extractor (e9b6a2b)
    • Rename ConfigWrapper to ExtConfig (9891255)
    • Remove tests code lens (c64d72b)

    ๐Ÿก Chore

    • Update tsup config (2dccecb)
    • Add test script that executes electron and pure tests (992165e)
    • Update dependencies (a9d95c9)
    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Aug 21, 2022)

    New Features

    Run custom commands

    You can now launch your custom commands directly from the activity bar, or from the palette command. The extension will ask you, via prompts, the value to set for each argument and flag.

    image

    Re-design and some feature for the route tree view

    • The Tree View of the routes is now a bit more sexy. The route dots are colored according to the HTTP methods.

    • You can now also copy the links of the endpoints, or open them directly in your browser via a click on the icon on the right. Very useful especially for GET routes that render HTML.

    • You can also flatten the routes to ignore the groups.

    image

    Edge + VSCode's HTML Language Server

    VSCode has just released a feature that allows us to integrate HTML server language features without having to write a complete server language.

    https://twitter.com/julien_rpt/status/1561403307779915777

    Thanks to this, we can now take advantage of all the features of the HTML server language, directly from our Edge files !

    Misc

    • Added node ace serve as a new command runnable from the command palette and activity bar.
    • Updated route grouping regex to also ignore /v1/xxxx like patterns

    Changelog

    ๐Ÿš€ Enhancements

    • More error handling on Routes Tree View (da0a3da)
    • Parse env and manifest file for each adonis projects in the workspace (a6c19cb)
    • Allow to copy url + open route in browser (f24412c)
    • Allow to flatten routes (7e70319)
    • Add colors to routes node items based on methods (cb332c8)
    • Add htmlLanguageParticipants for edge language (29e9da3)
    • Add node ace serve command (db7242e)
    • Update grouping regex (147d702)
    • Add way to run custom commands (9376c2e)
    • Display customs commands in activity bar (7ab695d)

    ๐Ÿฉน Fixes

    • Make metaFiles optional in .adonisrc schema (6b9ce09)
    • Load activity bar view only if an Adonis project is in the workspace (a852ada)

    ๐Ÿ’… Refactors

    • Extract Notifier class from BaseCommand (1f2cfbd)
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Aug 20, 2022)

    Features

    Added a new Tree view that display your routes. They are grouped by domains, then by common URL. A click on a route redirects you directly to the associated controller method.

    image

    Refactor

    • migrated from webpack to tsup
    • migrated to a snake_case directory/filename structure.
    • migrated to my own eslint/typescript config. More strictness
    • migrated from glob to fast-glob
    • Reduced extension size by 60% by externalizing typescript dependency that was imported by @poppinss/module-methods-extractor

    Full Changelog: https://github.com/Julien-R44/adonis-vscode-extension/compare/0.4.0...0.5.0

    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Jul 9, 2022)

    What's Changed

    • Add make:policy Command by @TheJltres in https://github.com/Julien-R44/adonis-vscode-extension/pull/8
    • Add make:suite command (8b1eea0)
    • Add make:factory command (3e1e310)
    • Can now generate factory along a model (5cc50d0)
    • Handle multiple domains on Routes command (2b8bd8e)
    • Add Adonis activity bar view (108f2b8) image

    New Contributors

    • @TheJltres made their first contribution in https://github.com/Julien-R44/adonis-vscode-extension/pull/8

    Full Changelog: https://github.com/Julien-R44/adonis-vscode-extension/compare/0.3.0...0.4.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(May 5, 2022)

    ๐Ÿš€ Features

    • #5 Display Ace commands only when the extension is activated
    • e7b2ae8 Add "nodePath" VSCode setting that allows you to manually enter the path to a NodeJS executable
    • e2a3aac Add migration:run and migration:rollback to VSCode Commands palette, and added a runMigrationInBackground vscode setting
    • cad97e8 Add tests and testProviders to adonisrc json schema

    ๐Ÿ› Fixes

    • a38b826 Configure command > package name not escaped
    • 3898b92 RunTest now runs in VSCode Terminal
    • c45a0b7 Replace edge dots separator by slashes
    • 454b2c6 Only display success message when set
    • 7a735f8 Run "typecheck" in foreground
    • c8f07a4 Re-use adonis terminal if already opened

    ๐Ÿ“– Documentation

    • ccf3e6d Some note on configuration + snippets
    • 76c81b5 Add note about intellisense not opening while typing
    • e712cce Add runMigrationInBackground note

    ๐Ÿ’… Refactors

    • 9554eb6 Use exec cwd instead of cd for executing background commands
    • 360c9a1 Rename Extension service class to ProjectFinder

    Full Changelog: https://github.com/Julien-R44/adonis-vscode-extension/compare/0.2.0...0.3.0

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(May 1, 2022)

    Bugfixes

    • The Adonis projects under monorepo was listed several times #2
    • Error when the user does not select any adonis project before executing the ace command #3
    • Route list WebView not working on Mac with many routes ๐Ÿ‘‰ Will be fixed with next adonisjs/core version #4

    Features

    • Added a refresh icon on the ListRoutes webview
    • Added new Japa Snippets
    • All methods in a controller are now listed in the suggestions documentation. In the context of a controller handler completion, the docblock of the method is displayed :

    Animation7

    Full Changelog: https://github.com/Julien-R44/adonis-vscode-extension/compare/0.1.0...0.2.0

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Apr 30, 2022)

    • We now support Adonis projects distributed in several workspaces and also in the same workspace but in subfolders (as can be the case with a monorepo).

      If your workspace(s) contains more than one Adonis project, then at the end of the adonisjs/assembler commands, the project on which you want to run your command should be selected from a quick pick VSCode menu :

    Animation6

    • Better autocompletion on edge inline edge tags

    Full Changelog: https://github.com/Julien-R44/adonis-vscode-extension/compare/0.0.3...0.1.0

    Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Apr 22, 2022)

Grupprojekt fรถr kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet fรถr kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide Fรถr information om hur utv

Svante Jonsson IT-Hรถgskolan 3 May 18, 2022
Hemsida fรถr personer i Sverige som kan och vill erbjuda boende till mรคnniskor pรฅ flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo fรถr kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
VSCode extension that creates overlay for your Broadcasting Software of choice.

BSOverlay VSCode extension that creates an overlay for your Broadcasting Software of choice. Documentation Please refer to the Wiki Section. Installin

chocoearly44 4 Sep 30, 2022
A vscode extension to quickly print variable, variable type, tensor shape etc by using shortcuts

Quick Python Print This repo is inspired by "Python Quick Print". "Python Quick Print" can quickly print out variables on the console by using shortcu

weida wang 5 Oct 28, 2022
VSCode extension for managing text selection.

Selection Manager This Visual Studio Code extension will allow you to manage selected text. The aim of this extension is to increase productivity by u

Sanel Hadลพini 2 Apr 12, 2022
VSCode extension for the rickroll-lang programming language (incomplete)

Rickroll-Lang VSCode Extension The Rick Roll programming language is a rickroll based, process oriented, dynamic, strong, esoteric programming languag

Siddhesh Zantye 6 Oct 10, 2022
NextJS VScode extension to visualize component tree.

Nexus A component tree extension for NextJS Report Bugs ยท Request Features Table of Contents About The Project Built With Installation Getting Started

OSLabs Beta 62 Nov 24, 2022
JSDoc generator for JavaScript, TypeScript using AI. (VSCode extension)

JSDoc generator for JavaScript, TypeScript using AI. (VSCode extension)

Amir Reza Dalir 3 Aug 18, 2022
VSCode extension with helpful code snippets for SolidJS.

Solid Snippets VSCode extension with helpful code snippets for SolidJS. GET THE EXTENSION Snippets Trigger Content Languages JSX sinputโ†’ Input two-way

SolidJS Community 11 Dec 8, 2022
Optimized dracula theme vscode extension for flutter, web, electron and golang development.

Optimized Dracula Theme A color theme inspired by dracula color theme. This color theme is not based on dracula color theme. The color styles are simi

wuchuran 1 Jul 11, 2022
a vscode extension for http response data auto transform ts type.

Api2ts ่ฟ™ๆ˜ฏไธ€ไธช่‡ชๅŠจๅฐ† http ็š„ๅ“ๅบ”ๆ•ฐๆฎ่ฝฌๅŒ–ไธบ ts ็š„็ฑปๅž‹๏ผŒไฝฟ็”จ json-to-ts ๅš็š„ใ€‚ Features ๆก†้€‰้…็ฝฎ้กนๅŽ๏ผŒไฝฟ็”จๅฟซๆท้”ฎ alt+Q : ่ฏทๆฑ‚ๅ‚ๆ•ฐ้…็ฝฎๆ–‡ไปถ ๅœจๆ น็›ฎๅฝ•ไธ‹ๅˆ›ๅปบ Api2ts.config.json ๆ–‡ไปถ๏ผŒ้…็ฝฎ้กนๅฆ‚ไธ‹๏ผš { "baseURL": "http

phy-lei 6 Jun 30, 2022
An enhanced VSCode extension for the Move programming language.

Move Analyzer Plus Provides language support for the Move programming language. Install on the VSCode Extension Marketplace: Move Analyzer Plus on the

The Moving Company 10 Aug 12, 2022
Simple and intuitive API Client made into a VSCode extension ๐Ÿ˜Š

REST API Client Simple and intuitive API Client made into a VSCode extension. Visual Studio Marketplace โ€ข Repository โ€ข Releases Visual Studio Code ext

REST API Client 19 Dec 23, 2022
๐Ÿ”Ž (Draft!) VSCode extension to show the search results in a tree view

vscode-search-tree ?? (Draft!) VSCode extension to show the search results in a tree view The work on this extension is on-pause for now since VSCode

Oleksii Trekhleb 16 Sep 7, 2022
Lightweight VSCode extension for Ruby.

vscode-ruby-light Lightweight VSCode extension for Ruby. Install Install via Visual Studio Marketplace: Ruby Light - Visual Studio Marketplace For Dia

Ryo Nakamura 23 Jan 2, 2023
๐Ÿงช A Japa extension for VSCode

?? Japa extension for VSCode Features Run tests without typing anything. Either with a shortcut, or via Code Lenses Support multiple workspaces Suppor

Julien Ripouteau 10 Sep 27, 2022
A VSCode extension to execute terminal command in multiple directories.

SiteFlex ?? Introduction The emergence of microservices and microfrontends posed a real threat on lazy programmers. Consider this scenario, you have m

CuteTN 3 Sep 6, 2022
VSCode extension to paste text as a string array

VSCode extension to paste text as a string array. This is useful when copying command line into launch.json args

Shady Boukhary 4 Dec 28, 2022