benwinding / command-pal

The hackable command palette for the web, inspired by Visual Studio Code.
https://benwinding.github.io/command-pal/docs
MIT License
75 stars 8 forks source link

How to create dev environment #15

Open rouilj opened 1 year ago

rouilj commented 1 year ago

Hi Ben:

So far I have cloned the repo. Then added:

% sudo apt-get install npm

then after npm run dev reported it can't find rollup I did:

% sudo apt-get install rollup

Now I get:

%  npm run dev

> command-pal@0.2.7 dev
> rollup -c -w

[!] Error: Cannot find module 'rollup-plugin-svelte'
Require stack:
- /home/rouilj/develop/command-pal/rollup.config.js
- /usr/share/nodejs/rollup/dist/shared/loadConfigFile.js
- /usr/share/nodejs/rollup/dist/bin/rollup
Error: Cannot find module 'rollup-plugin-svelte'
Require stack:
- /home/rouilj/develop/command-pal/rollup.config.js
- /usr/share/nodejs/rollup/dist/shared/loadConfigFile.js
- /usr/share/nodejs/rollup/dist/bin/rollup
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/rouilj/develop/command-pal/rollup.config.js:5:14)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.require.extensions.<computed> [as .js] (/usr/share/nodejs/rollup/dist/shared/loadConfigFile.js:619:20)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)

and the command hangs. ^c gets me back to the prompt.

apt search svelte doesn't return any hits.

% npm install rollup-plugin-svelte

works, but generates a bunch (20+) of deprecation warnings including for core-js@2.6.11 (upgrade to core > 3.23.3), highlight.js etc.

54 vulnerabilities (1 low, 20 moderate, 28 high, 5 critical)

is the result.

However npm run dev does start a server. Navigating to it and opening public/cp-advanced/ gives me a working page that I can invoke command-pal. However inspecting the button icon shows me an SVG without the viewBox. Checking the source in src/MobileButton.svelte shows the viewBox.

Where do I go from here?

Am I missing a build/update step or something?

Details:

OS Ubuntu 22.04 nodejs 12.22.9

npm list
command-pal@0.2.7 /home/rouilj/develop/command-pal
├── @rollup/plugin-commonjs@11.0.2
├── @rollup/plugin-node-resolve@7.1.3
├── docpress@0.8.1
├── fuse.js@5.2.3
├── gh-pages@2.2.0
├── hotkeys-js@3.7.6
├── micro-pubsub@1.0.0
├── rollup-plugin-livereload@1.3.0
├── rollup-plugin-svelte@5.2.1
├── rollup-plugin-terser@5.3.0
├── rollup@1.32.1
├── serve@11.3.2
└── svelte@3.21.0
rouilj commented 1 year ago

Ah got it. I need to explicitly request cp-advanced/local-dev. Pays to read the documentation 8-).

I see that it is still pulling style sheets and highlight.js from the CDN. Is that expected?