Giter VIP home page Giter VIP logo

socketsupply / create-socket-app Goto Github PK

View Code? Open in Web Editor NEW
132.0 8.0 14.0 261 KB

Create Socket App, is like Create React App but helps you build native apps for mobile and desktop with Svelte, Reactjs, Vuejs and others!

JavaScript 60.37% CSS 23.17% HTML 9.97% Vue 2.20% Svelte 2.19% TypeScript 2.09%
create-react-app cross-platform cross-platform-app desktop-app electron-app electron-react electron-svelte electron-vite electron-vue mobile-app

create-socket-app's People

Contributors

bcomnes avatar chicoxyzzy avatar dependabot[bot] avatar heapwolf avatar jwerle avatar lamiazar avatar mribbons avatar rdela avatar wujekbizon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-socket-app's Issues

create socket-app react-ts not working

What OS are you using (uname -a, or Windows version)?

Darwin MacBook-Pro.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64

What version Socket Runtime are you using?

I'm not. I'm attempting (and failing) to install Socket.

What programming language are you using (C/C++/Go/Rust)?

I'm not. I'm attempting (and failing) to install Socket.

What did you expect to see and what you saw instead?

I expected installation to complete without errors. Instead the following commands all failed with the same error.

The error

Create a new, empty directory, cd into it, then run one of the following.

  • yarn create socket-app react-ts
  • npm create socket-app react-ts
  • npx create-socket-app react-ts
Initializing npm package...Ok.
Installing developer dependencies...Ok.
Installing '@socketsupply/socket' locally (ssc not in PATH)
Installing dependencies...
Ok.
Adding package scripts...Ok.
Creating socket files...
> [email protected] init-project
> ssc init

warn - using '/usr/bin/clang++' as CXX
# Determining default Android search paths.
ok - ANDROID_HOME, JAVA_HOME, and GRADLE_HOME search paths configured.
# Determining Android paths.
warn - Ignoring system java selector (/usr/bin/javac)
warn - Ignoring system java selector (/usr/bin/javac)
Do you want to install Android build dependencies?
Download size: 5.5GB, Installed size: 12.0GB [y/N]
> n
warn - You have elected to not install Android dependencies.
warn - You can use 'export NO_ANDROID=1' to avoid this prompt in the future.
• socket.ini created in /Users/john/code/issues/socket-test +1ms
• Current directory was not empty. Assuming index.html is already in place. +0ms
• .gitignore created in /Users/john/code/issues/socket-test +0ms
Ok.
Creating tsconfig...Ok.
Setting up TS configuration...Ok.
Updating project configuration...Ok.
Copying project boilerplate...
Unable to copy files: Error: EEXIST: file already exists, mkdir '/Users/jo/code/issues/socket-test/src'

ssc setup --platform=android causes Error: spawn powershell.exe ENOENT

Hello,
I finally were able to run the desktop example on my windows machine yesterday after much help from @mribbons
I did install all options and made sure I used paths with no spaces (everything under: C:\root.gradle & C:\root\Android )
I also added to the PATH all of:
C:\root\Android\platform-tools C:\root\Android\cmdline-tools\latest\bin C:\root\Android\[A[BC\root\JAVA_HOME\jdk-19.0.2\bin C:\root\.gradle\gradle-8.0.2\bin

However, when running
C:\projects\app> ssc setup --platform=android
I get the error below:
`

Checking build dependencies...

Error: spawn powershell.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn powershell.exe',
path: 'powershell.exe',
spawnargs: [ '.\bin\install.ps1', '-fte:android' ]
}
Similarly, running C:\projects\app> **ssc build --platform=android-emulator -r** We also get the error below:
Error: spawn powershell.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn powershell.exe',
path: 'powershell.exe',
spawnargs: [ '.\bin\install.ps1', '-fte:android' ]
}
`

I spent more than an hour trying to fix this with no success. Any idea?
PS: The path to powershell is in the PATH env as expected!

Help message

It should be possible to request a help message from the create-socket-app cli tool. It should detail similar usage examples and options as seen in the README.md file
Fixes #15

Issue while running npm start after creating the application

I have followed the steps to create an application using the command npx create-socket-app react . Everything went fine. But when I ran npm start I got following error
error: 'auto' not allowed in function prototype inline auto msleep (auto n) { ^~~~

Following is the complete log of the command


> [email protected] start
> ssc build -r -o

• cleaned: /Users/diwakersingh/personal/code/SocketSupply/build/mac +23ms
• preparing build for mac +14ms
• package prepared +49ms
• ran user build command +258ms
• Unable to build +2159ms
• Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1"
 "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx11.1.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name init.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=11.1 -target-cpu penryn -dwarf-column-info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=lldb -target-linker-version 609.8 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D MACOS=1 -I /Users/diwakersingh/.volta/tools/image/packages/@socketsupply/socket/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-x64/ -I /Users/diwakersingh/.volta/tools/image/packages/@socketsupply/socket/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-x64/include -I /Users/diwakersingh/personal/code/SocketSupply/build/mac/include -D IOS=0 -D ANDROID=0 -D DEBUG=1 -D HOST=localhost -D PORT=0 -D SSC_SETTINGS= -D SSC_VERSION=0.3.3 -D SSC_VERSION_HASH=7205993d -I/usr/local/include -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -std=c++2a -fdeprecated-macro -fdebug-compilation-dir /Users/diwakersingh/personal/code/SocketSupply -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-implicit-modules -fobjc-runtime=macosx-11.1.0 -fobjc-exceptions -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o /var/folders/t_/j5_1ncls51l50t_760kg_dl40000gn/T/init-a02b3f.o -x objective-c++ /Users/diwakersingh/.volta/tools/image/packages/@socketsupply/socket/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-x64/src/init.cc
clang -cc1 version 12.0.0 (clang-1200.0.32.29) default target x86_64-apple-darwin22.6.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Users/diwakersingh/.volta/tools/image/packages/@socketsupply/socket/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-x64
 /Users/diwakersingh/.volta/tools/image/packages/@socketsupply/socket/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-x64/include
 /Users/diwakersingh/personal/code/SocketSupply/build/mac/include
 /usr/local/include
 /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1
 /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.
In file included from /Users/diwakersingh/.volta/tools/image/packages/@socketsupply/socket/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-x64/src/init.cc:1:
/Users/diwakersingh/.volta/tools/image/packages/@socketsupply/socket/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-x64/src/common.hh:980:23: error: 'auto' not allowed in function prototype
  inline auto msleep (auto n) {
                      ^~~~
1 error generated.
 +0ms

I am using macbook pro with macOS 13.5. I tried other methods of installing and running the application mentioned in the docs, But I reach to the same error.

`npm test`

The command npm test hangs indefinitely. This is after npx create-socket-app tonic.

image

Failed to export project

I think everything is set up correctly for code signing.

When I run:

$ ssc build --platform=ios -c -p
• cleaned: /Users/s/Development/perchd/build/ios +20ms
• package prepared +213ms
• ran user build command +257ms
• building for iOS +91ms
• created archive +3466ms
• ERROR: failed to export project +463ms

Is there any way to see any further error details? How can I dig deeper on this?

[macos] This app has crashed because it attempted to access privacy-sensitive data without a usage description

When launching the app (immediately after generating it) on MacOS results in the following dialog:

Screenshot 2023-03-14 at 10 05 56

Selecting 'Reopen' allows the app to launch successfully.

Closing the app and relaunching it results in the same behaviour every time, essentially forcing the user to press 'Reopen' in order to successfully launch the app each time.

Looking at the Report log, the pertinent section is:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data.

This is odd since the key seems to be present in the Info.plist file:

grep -C2 NSBluetoothAlwaysUsageDescription ./dist/mac/play-dev.app/Contents/Info.plist
  <key>NSCameraUsageDescription</key>
  <string>This app needs access to the camera</string>
  <key>NSBluetoothAlwaysUsageDescription</key>
  <string>The app would like to discover and connect to peers</string>
  <key>NSMainNibFile</key>

Feels to me like a race condition, I could be way off but shouldn't the writeFile function explicitly call flush()?

why it ask elevated permissions?

Initializing npm package...Ok.
Installing developer dependencies...Ok.
Installing '@socketsupply/socket' locally (ssc not in PATH)
Installing dependencies...
Ok.
Adding package scripts...Ok.
Creating socket files...
> [email protected] init-project
> ssc init

[sudo] password for user: 

`npm create socket-app tonic && npm start`

npm start shows this error in terminal:

Error: Cannot find module '/Users/nick/code/socket-demo/build-script.js'

socket.ini contains the text

build = "node build-script.js"

but the file created is build.js

Create Socket App as a Vite generator wrapper

Vite has its own app generators for this list of frontend frameworks out of the box. "Others" include even more + there are TS templates.

image

Vite is simple to config, uses esbuild by default under the hood and is compatible with rollup plugins. It's also the base for SvelteKit (which is more opinionated, less configurable and have server support which we don't need, I use Vite in Svelte template).

Rollup and Vite together have more downloads then esbuild. Part of esbuild downloads are Vite downloads. Probably, some other downloads are other tools that use esbuild.

image

Vite has much more stars on GitHub than esbuild and it more contributors

image

I have a half-working Create Socket App tool experiment as a wrapper over Vite, will have a full-working prototype soon with dev server support and hopefully with Hot Module Replacement as well!

Getting an error when I run `npx create-socket-app -h`

this is the error I'm getting :

C:\Users\lamia\test>npx create-socket-app -h
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: ENOENT: no such file or directory, scandir 'C:\C:\Users\lamia\AppData\Local\npm-cache\_npx\d5a408ba81afe2c4\node_modules\create-socket-app\templates'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'scandir',
  path: 'C:\\C:\\Users\\lamia\\AppData\\Local\\npm-cache\\_npx\\d5a408ba81afe2c4\\node_modules\\create-socket-app\\templates'
}

Node.js v18.13.0

Scaffold basic menu items in all templates

Copy-paste, quitting etc are all essential menu items that we should scaffold out in the most best-practice possible way in every CSA template.

We may need to add something like an app-start script, or an event that lets you initialize first time app things to achieve this cleanly. We can get a solution in now though, and refactor later when a feature like is available.

linux/os x deps check

As per discord user:

usr/local/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-linux-x64/bin/ssc: error while loading shared libraries: libwebkit2gtk-4.1.so.0: cannot open shared object file: No such file or directory

These should be checked on package install as per socketsupply/socket@a451e16

Additionally, CI for this project should start from a fresh system with as few build tools and deps as possible.

install ssc via npm

if ssc is not installed we should install it from here with maybe something like this when the user runs the command npx crete-socket-app.

Unable to copy files: Error: EEXIST: file already exists

Getting this issue when trying to do npx create-socket-app react-ts

Copying project boilerplate...
Unable to copy files: Error: EEXIST: file already exists, mkdir '..my/path/to/my/project/src'

so at the moment i am unable to use create-socket-app.

I'm running macOS Ventura 13.5 (22G74) and i tried both through iterm2 and via the built-in terminal

Vanilla boilerplate app crashes on MacOS 13.2.1

I was following along with the demo youtube (https://www.youtube.com/watch?v=PhTjKtrpCYk) and when I do scc build -r to build and run the app, it shows up on the screen for a split second, and then I get a error message from MacOS saying the app crashed, with the following reason: "This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothAlwaysUsageDescription key with a string value explaining to the user how the app uses this data."
I saw that in the Info.plist this string value already existed, but it was still crashing. Eventually I found this related issue in a different github repository, and because of this I figured out that the NSBluetoothAlwaysUsageDescription problem wasn't the sockets app I was building, it was my terminal app I was running it from (iterm2). So in MacOS settings -> privacy and security -> Bluetooth, I added the iterm app, then closed and re-opened it. Then running scc build -r worked fine and the boilerplate app opened as expected.
I think it might be good to have this mentioned somewhere in the documentation so that it doesn't trip other people up like it did me.

issue with `tonic` template

When I run npm create socket-app tonic ,I'm getting a 401 error :

lamia@lamia-pc:~/Desktop/my-app$ npm create socket-app tonic
Initializing npm package...OK
Installing developer dependencies...OK
Installing dependencies...
Unable to run npm install: Error: Command failed: npm install @socketsupply/tonic --save
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@socketsupply%2ftonic - unauthenticated: User cannot be authenticated with the token provided.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lamia/.npm/_logs/2023-02-20T20_20_58_482Z-debug-0.log

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! code 1
npm ERR! path /home/lamia/Desktop/my-app
npm ERR! command failed
npm ERR! command sh -c -- create-socket-app tonic

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lamia/.npm/_logs/2023-02-20T20_20_55_693Z-debug-0.log

But the same token is working for all the other templates.

Not working on Windows (white space problem?)

Hello,
I'm unable to make the sample app work on my Windows 10 machine. From the command line output ('C:\Users\Windows' is not recognized as an internal or external command, operable program or batch file.) it seems to be related to a white space in the path (Full output is found below).

`C:\Code\socketsupply-test> yarn create socket-app react
yarn create v1.22.19
warning package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-socket-app
'C:\Users\Windows' is not recognized as an internal or external command,
operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\Windows 10\AppData\Local\Yarn\bin\create-socket-app
Arguments: react
Directory: C:\Code\socketsupply-test
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
`
 

MacOS Monterey has libuv error

When I run ssc build -r I see lots of

node/v16.13.0/lib/node_modules/@socketsupply/socket/node_modules/@socketsupply/socket-darwin-arm64/lib/arm64-desktop/libuv.a(libuv_la-tcp.o)) was built for newer macOS version (13.0) than being linked (12.0)

I can just upgrade MacOS I suppose - but wanted to throw this out there in case you felt like offering a version linked to an older version of libuv.

The build also fails with some missing symbols.

Getting an error when I run `npm create socket-app ` on linux

So first ,I was getting a different error (401 error) , I updated the token on the .npmrc , and now I'm getting a different error:

lamia@lamia-pc:~/Desktop/my-app$ npm create socket-app react
Initializing npm package...OK
Installing developer dependencies...OK
Installing '@socketsupply/socket' locally (ssc not in PATH)
Installing dependencies...OK
Adding package scripts...OK
Creating socket files...
Unable to create socket files: Error: Command failed: npm run init-project
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@socketsupply/socket-linux-x64' imported from /home/lamia/Desktop/my-app/node_modules/@socketsupply/socket/bin/ssc.js
    at new NodeError (node:internal/errors:387:5)
    at packageResolve (node:internal/modules/esm/resolve:852:9)
    at moduleResolve (node:internal/modules/esm/resolve:901:20)
    at defaultResolve (node:internal/modules/esm/resolve:1115:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ESMLoader.import (node:internal/modules/esm/loader:525:22)
    at importModuleDynamically (node:internal/modules/esm/translators:110:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) {
  code: 'ERR_MODULE_NOT_FOUND'
}

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
OK
Updating project configuration...
Unable to read socket.ini: Error: ENOENT: no such file or directory, open 'socket.ini'
npm ERR! code 1
npm ERR! path /home/lamia/Desktop/my-app
npm ERR! command failed
npm ERR! command sh -c -- create-socket-app react

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lamia/.npm/_logs/2023-02-16T15_31_45_729Z-debug-0.log

I'm getting an error when I run `yarn create socket-app [react | svelte | tonic | vanilla | vue]`

I get this error message when I run any of the templates :

yarn create socket-app vanilla
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 0s 132ms

Initializing npm package...OK
Installing developer dependencies...
Unable to run npm install: Error: Command failed: npm install -D esbuild
npm ERR! code 1
npm ERR! path /home/lamia/Desktop/my-app/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! node:internal/errors:857
npm ERR!   const err = new Error(message);
npm ERR!               ^
npm ERR! 
npm ERR! Error: Command failed: /usr/bin/node /home/lamia/Desktop/my-app/node_modules/esbuild/bin/esbuild --version
npm ERR! node:internal/errors:478
npm ERR!     ErrorCaptureStackTrace(err);
npm ERR!     ^
npm ERR! 
npm ERR! TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /home/lamia/Desktop/my-app/node_modules/esbuild/bin/esbuild
npm ERR!     at new NodeError (node:internal/errors:387:5)
npm ERR!     at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:75:11)
npm ERR!     at defaultGetFormat (node:internal/modules/esm/get_format:117:38)
npm ERR!     at defaultLoad (node:internal/modules/esm/load:81:20)
npm ERR!     at nextLoad (node:internal/modules/esm/loader:163:28)
npm ERR!     at load$1 (file:///tmp/xfs-0d43b79d/dlx-7554/.pnp.loader.mjs:1455:12)
npm ERR!     at nextLoad (node:internal/modules/esm/loader:163:28)
npm ERR!     at ESMLoader.load (node:internal/modules/esm/loader:605:26)
npm ERR!     at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
npm ERR!     at new ModuleJob (node:internal/modules/esm/module_job:63:26) {
npm ERR!   code: 'ERR_UNKNOWN_FILE_EXTENSION'
npm ERR! }
npm ERR! 
npm ERR!     at checkExecSyncError (node:child_process:861:11)
npm ERR!     at Object.execFileSync (node:child_process:896:15)
npm ERR!     at validateBinaryVersion (/home/lamia/Desktop/my-app/node_modules/esbuild/install.js:97:28)
npm ERR!     at /home/lamia/Desktop/my-app/node_modules/esbuild/install.js:282:5 {
npm ERR!   status: 1,
npm ERR!   signal: null,
npm ERR!   output: [
npm ERR!     null,
npm ERR!     Buffer(0) [Uint8Array] [],
npm ERR!     Buffer(906) [Uint8Array] [
npm ERR!       110, 111, 100, 101,  58, 105, 110, 116, 101, 114, 110,  97,
npm ERR!       108,  47, 101, 114, 114, 111, 114, 115,  58,  52,  55,  56,
npm ERR!        10,  32,  32,  32,  32,  69, 114, 114, 111, 114,  67,  97,
npm ERR!       112, 116, 117, 114, 101,  83, 116,  97,  99, 107,  84, 114,
npm ERR!        97,  99, 101,  40, 101, 114, 114,  41,  59,  10,  32,  32,
npm ERR!        32,  32,  94,  10,  10,  84, 121, 112, 101,  69, 114, 114,
npm ERR!       111, 114,  32,  91,  69,  82,  82,  95,  85,  78,  75,  78,
npm ERR!        79,  87,  78,  95,  70,  73,  76,  69,  95,  69,  88,  84,
npm ERR!        69,  78,  83,  73,
npm ERR!       ... 806 more items
npm ERR!     ]
npm ERR!   ],
npm ERR!   pid: 7645,
npm ERR!   stdout: Buffer(0) [Uint8Array] [],
npm ERR!   stderr: Buffer(906) [Uint8Array] [
npm ERR!     110, 111, 100, 101,  58, 105, 110, 116, 101, 114, 110,  97,
npm ERR!     108,  47, 101, 114, 114, 111, 114, 115,  58,  52,  55,  56,
npm ERR!      10,  32,  32,  32,  32,  69, 114, 114, 111, 114,  67,  97,
npm ERR!     112, 116, 117, 114, 101,  83, 116,  97,  99, 107,  84, 114,
npm ERR!      97,  99, 101,  40, 101, 114, 114,  41,  59,  10,  32,  32,
npm ERR!      32,  32,  94,  10,  10,  84, 121, 112, 101,  69, 114, 114,
npm ERR!     111, 114,  32,  91,  69,  82,  82,  95,  85,  78,  75,  78,
npm ERR!      79,  87,  78,  95,  70,  73,  76,  69,  95,  69,  88,  84,
npm ERR!      69,  78,  83,  73,
npm ERR!     ... 806 more items
npm ERR!   ]
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lamia/.npm/_logs/2023-02-20T21_16_24_147Z-debug-0.log

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    ```

Add socket rollup plugin

Rollup plugin can make it easier to make existing vite/rollup build target Socket Runtime. The plugin can be used in the CSA also.

`yarn create socket-app [react | svelte | tonic | vanilla | vue]` is giving me an error with `v 3.4.1`

I have yarn v 3.4.1 on my Linux machine and running this command doesn't work for any of the templates.
On my mac, I have yarn v 1 and everything is working as expected.

~/Desktop/my-app$ yarn create socket-app tonic
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 519ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 0s 566ms

Initializing npm package...OK
Installing developer dependencies...
Unable to run npm install: Error: Command failed: npm install -D esbuild
npm ERR! code 1
npm ERR! path /home/lamia/Desktop/my-app/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! node:internal/errors:857
npm ERR!   const err = new Error(message);
npm ERR!               ^
npm ERR! 
npm ERR! Error: Command failed: /usr/bin/node /home/lamia/Desktop/my-app/node_modules/esbuild/bin/esbuild --version
npm ERR! node:internal/errors:478
npm ERR!     ErrorCaptureStackTrace(err);
npm ERR!     ^
npm ERR! 
npm ERR! TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /home/lamia/Desktop/my-app/node_modules/esbuild/bin/esbuild
npm ERR!     at new NodeError (node:internal/errors:387:5)
npm ERR!     at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:75:11)
npm ERR!     at defaultGetFormat (node:internal/modules/esm/get_format:117:38)
npm ERR!     at defaultLoad (node:internal/modules/esm/load:81:20)
npm ERR!     at nextLoad (node:internal/modules/esm/loader:163:28)
npm ERR!     at load$1 (file:///tmp/xfs-a8b1e462/dlx-4764/.pnp.loader.mjs:1455:12)
npm ERR!     at nextLoad (node:internal/modules/esm/loader:163:28)
npm ERR!     at ESMLoader.load (node:internal/modules/esm/loader:605:26)
npm ERR!     at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
npm ERR!     at new ModuleJob (node:internal/modules/esm/module_job:63:26) {
npm ERR!   code: 'ERR_UNKNOWN_FILE_EXTENSION'
npm ERR! }
npm ERR! 
npm ERR!     at checkExecSyncError (node:child_process:861:11)
npm ERR!     at Object.execFileSync (node:child_process:896:15)
npm ERR!     at validateBinaryVersion (/home/lamia/Desktop/my-app/node_modules/esbuild/install.js:97:28)
npm ERR!     at /home/lamia/Desktop/my-app/node_modules/esbuild/install.js:282:5 {
npm ERR!   status: 1,
npm ERR!   signal: null,
npm ERR!   output: [
npm ERR!     null,
npm ERR!     Buffer(0) [Uint8Array] [],
npm ERR!     Buffer(906) [Uint8Array] [
npm ERR!       110, 111, 100, 101,  58, 105, 110, 116, 101, 114, 110,  97,
npm ERR!       108,  47, 101, 114, 114, 111, 114, 115,  58,  52,  55,  56,
npm ERR!        10,  32,  32,  32,  32,  69, 114, 114, 111, 114,  67,  97,
npm ERR!       112, 116, 117, 114, 101,  83, 116,  97,  99, 107,  84, 114,
npm ERR!        97,  99, 101,  40, 101, 114, 114,  41,  59,  10,  32,  32,
npm ERR!        32,  32,  94,  10,  10,  84, 121, 112, 101,  69, 114, 114,
npm ERR!       111, 114,  32,  91,  69,  82,  82,  95,  85,  78,  75,  78,
npm ERR!        79,  87,  78,  95,  70,  73,  76,  69,  95,  69,  88,  84,
npm ERR!        69,  78,  83,  73,
npm ERR!       ... 806 more items
npm ERR!     ]
npm ERR!   ],
npm ERR!   pid: 4847,
npm ERR!   stdout: Buffer(0) [Uint8Array] [],
npm ERR!   stderr: Buffer(906) [Uint8Array] [
npm ERR!     110, 111, 100, 101,  58, 105, 110, 116, 101, 114, 110,  97,
npm ERR!     108,  47, 101, 114, 114, 111, 114, 115,  58,  52,  55,  56,
npm ERR!      10,  32,  32,  32,  32,  69, 114, 114, 111, 114,  67,  97,
npm ERR!     112, 116, 117, 114, 101,  83, 116,  97,  99, 107,  84, 114,
npm ERR!      97,  99, 101,  40, 101, 114, 114,  41,  59,  10,  32,  32,
npm ERR!      32,  32,  94,  10,  10,  84, 121, 112, 101,  69, 114, 114,
npm ERR!     111, 114,  32,  91,  69,  82,  82,  95,  85,  78,  75,  78,
npm ERR!      79,  87,  78,  95,  70,  73,  76,  69,  95,  69,  88,  84,
npm ERR!      69,  78,  83,  73,
npm ERR!     ... 806 more items
npm ERR!   ]
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lamia/.npm/_logs/2023-02-21T14_04_37_723Z-debug-0.log

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
    ```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.