qwikifiers / qwik-nx

Nx plugin for Qwik
130 stars 23 forks source link

Add Slot import in layout template when creating route #162

Closed aboudard closed 1 year ago

aboudard commented 1 year ago

Current Behavior

When creating a route, the layout does miss the import of Slot:

import { component$ } from '@builder.io/qwik';

export default component$(() => {
  return (
    <>
      <Slot />
    </>
  );
});

Expected Behavior

Slot import should be present in the template of layout :

import { Slot, component$ } from '@builder.io/qwik';

GitHub Repo

No response

Steps to Reproduce

  1. create a new qwik-nx workspace
  2. create a new route with layout option : npx nx generate qwik-nx:route todo --project=nx-qwik-app --addLayout --no-interactive

Nx Report

Node   : 18.14.0
   OS     : win32 x64
   npm    : 9.3.1
   Hasher : Native

   nx (global)        : 16.1.4
   nx                 : 16.1.4
   @nx/js             : 16.1.4
   @nx/linter         : 16.1.4
   @nx/workspace      : 16.1.4
   @nx/devkit         : 16.1.4
   @nx/eslint-plugin  : 16.1.4
   @nrwl/tao          : 16.1.4
   @nx/vite           : 16.1.4
   typescript         : 5.0.4
   ---------------------------------------
   Community plugins:
   qwik-nx : 1.0.3

Failure Logs

No response

Additional Information

file : packages/qwik-nx/src/generators/route/files/layout/routeName/layout.tsxtemplate

dmitry-stepanenko commented 1 year ago

Thank you for raising this, the fix will be included in the next release!