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

Sveltekit: v15 is not on npm, the latest available is 14.0.0-next.2 #924

Open
KaviiSuri opened this issue Apr 15, 2023 · 8 comments
Open
Labels
bug Something isn't working

Comments

@KaviiSuri
Copy link

Describe the bug
When installing sveltekit v15 through yarn or npm, the latest version available is not the one in the repo, but rather 14.0.0-next.2.

To Reproduce
Steps to reproduce the behavior:

  1. Go to: https://www.npmjs.com/package/@nxext/sveltekit
  2. Look at the version
    OR
  3. yarn add -D @nx-exst/sveltekit

Expected behavior
The latest version to be available on npm.

Additional context
I need to add sveltekit app to our monorepo, don't want to downgrade nx.

@KaviiSuri KaviiSuri added the bug Something isn't working label Apr 15, 2023
@t-mish
Copy link

t-mish commented May 1, 2023

@DominikPieper Maybe it can be published?

@fivehanz
Copy link

fivehanz commented May 5, 2023

I have the same issue, I presumed it will be solved with nx 16 merge. Perhaps not?

How do i use latest packages?

@kristianmandrup
Copy link
Contributor

kristianmandrup commented Jul 11, 2023

Yeah, the repo contains:

@nxext/svelte 16.5.0
@nxext/sveltekit 16.5.0-next.0

But they have not yet been published to npm. So unfortunate.
To test things out I cloned the repo and ran npm i and got an error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @angular-devkit/build-angular@16.1.4
npm ERR! Found: jest@29.4.3
npm ERR! node_modules/jest
npm ERR!   dev jest@"29.4.3" from the root project
npm ERR!   peer jest@"^29.0.0" from ts-jest@29.1.0
npm ERR!   node_modules/ts-jest
npm ERR!     dev ts-jest@"29.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional jest@"^29.5.0" from @angular-devkit/build-angular@16.1.4
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   peer @angular-devkit/build-angular@">= 14.0.0 < 17.0.0" from @nx/angular@16.5.0
npm ERR!   node_modules/@nx/angular
npm ERR!     dev @nx/angular@"16.5.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: jest@29.6.1
npm ERR! node_modules/jest
npm ERR!   peerOptional jest@"^29.5.0" from @angular-devkit/build-angular@16.1.4
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     peer @angular-devkit/build-angular@">= 14.0.0 < 17.0.0" from @nx/angular@16.5.0
npm ERR!     node_modules/@nx/angular
npm ERR!       dev @nx/angular@"16.5.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry

I then updated the jest dependency to "jest": "^29.4.3", and it resolved the conflict and installed all the packages.
Using ^29.0.0 seems to do the trick as well.

nx run sveltekit-e2e:e2e ran the tests but they were all set to be skipped (see sveltekit.spec.ts)

xdescribe('sveltekit e2e', () => {
  // ...
})

When I uncomment the x to skip the tests, I get the following errors:

 FAIL   sveltekit-e2e  e2e/sveltekit-e2e/tests/sveltekit.spec.ts (130.739 s)
  sveltekit e2e
    ✕ should create sveltekit app (89182 ms)
    ✓ should create sveltekit component (2233 ms)
    ✓ should lint sveltekit app (2592 ms)
    --directory
      ✕ should create src in the specified directory (795 ms)
    --tags
      ✓ should add tags to project (1033 ms)

  ● sveltekit e2e › should create sveltekit app

    Command failed: yarn nx build sveltekitapp489591
    warning ../../../../../package.json: No license field
    error Command failed with exit code 1.



  ● sveltekit e2e › --directory › should create src in the specified directory

    Command failed: yarn nx generate @nxext/sveltekit:app sveltekitdir3516589 --directory subdir --linter none
    warning ../../../../../package.json: No license field
    error Command failed with exit code 1.



Test Suites: 1 failed, 1 total
Tests:       2 failed, 3 passed, 5 total
Snapshots:   0 total
Time:        131.072 s
Ran all test suites.

 ——————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Ran target e2e for project sveltekit-e2e and 1 task(s) they depend on (3m)
 
    ✖    1/2 failed
    ✔    1/2 succeeded [0 read from cache]

Generators:

{
  "$schema": "http://json-schema.org/schema",
  "name": "sveltekit",
  "version": "0.0.1",
  "generators": {
    "application": {
      "factory": "./src/generators/application/generator#applicationGenerator",
      "schema": "./src/generators/application/schema.json",
      "description": "sveltekit app generator",
      "aliases": ["app"]
    },

Note that is uses app as an alias for the application generator.

Trying to figure out the issue

    Command failed: yarn nx generate @nxext/sveltekit:app sveltekitdir9259017 --directory subdir --linter none
    warning ../../../../../package.json: No license field
    Error: Cannot find configuration for 'sveltekitdir9259017'

      at readProjectConfiguration (../../tmp/nx-e2e/proj/node_modules/nx/src/generators/utils/project-configuration.js:90:15)
      at viteConfigurationGenerator (../../tmp/nx-e2e/proj/node_modules/@nx/vite/src/generators/configuration/configuration.js:28:84)
      at ../../tmp/nx-e2e/proj/node_modules/@nxext/sveltekit/src/generators/application/lib/add-vite.js:11:22
      at fulfilled (../../tmp/nx-e2e/proj/node_modules/tslib/tslib.js:166:62)
      error Command failed with exit code 1.

To debug it further, we would have to clone the main nx repo, (build devkit?) and then npm link it, I would think.
Also see 7 Ways to Debug Jest Tests in Terminal

Perhaps something like

node --inspect $(npm bin)/jest --runTestsByPath e2e/sveltekit-e2e/tests/sveltekit.spec.ts --runInBand

Looks like my issues are related to the following:

Failed to start verdaccio: undefined
local registry exit 1

Not sure how to ensure local verdaccio repository is up and running. Seems to be a requirement to run the tests.

@kristianmandrup
Copy link
Contributor

kristianmandrup commented Jul 11, 2023

I've temporarily published nxext-sveltekit-16 and nxext-svelte-16 so you/we can give it a try.

Alternatively I recommend cloning this repo then build each of the extension in your local clone/fork and using npm link to link the the extension from your project, since they are only dev dependencies. Then you can also play around with the extensions and add new functionality.

@kristianmandrup
Copy link
Contributor

I've created a PR with some suggested changes and improvements here: #980

@Sejmou
Copy link

Sejmou commented Jul 24, 2023

When can we expect this to get merged?

I would really want to use a SvelteKit app with nx, what can I do in the meantime?

@Suyashtnt
Copy link

Suyashtnt commented Aug 15, 2023

Also have this issue. When will it be fixed?

@Jedliu
Copy link

Jedliu commented Aug 25, 2023

Looking forward to the new release!

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

7 participants