diff --git a/.gitignore b/.gitignore index bcb4cfd..0594256 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ var coverage +*~lock~ # Dependencies node_modules/ @@ -22,6 +23,7 @@ npm-debug.log* # NPM package files *.tgz + # OS .DS_Store Thumbs.db diff --git a/README.md b/README.md index c94f587..8aa0abc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# Leafstone +# leafstone + +

+ leafstone icon +

[![Test](https://github.com/matthen/leafstone/workflows/Test/badge.svg)](https://github.com/matthen/leafstone/workflows/Test) [![Lint](https://github.com/matthen/leafstone/workflows/Lint/badge.svg)](https://github.com/matthen/leafstone/workflows/Lint) diff --git a/assets/logo.afdesign b/assets/logo.afdesign new file mode 100644 index 0000000..e8a5398 Binary files /dev/null and b/assets/logo.afdesign differ diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100644 index 0000000..5a6e12e --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/server.js b/lib/server.js index 60523a4..bfd565f 100644 --- a/lib/server.js +++ b/lib/server.js @@ -41,6 +41,20 @@ async function startServer(componentFile, port = 3000, options = {}) { // Copy assets to temp directory await copyAssets(assets, tempDir); + // Copy favicon to public directory in temp project + const faviconSrc = path.join(__dirname, '..', 'assets', 'logo.svg'); + const faviconDest = path.join(tempDir, 'public', 'favicon.svg'); + const publicDir = path.join(tempDir, 'public'); + + if (!fs.existsSync(publicDir)) { + fs.mkdirSync(publicDir, { recursive: true, mode: 0o755 }); + } + + if (fs.existsSync(faviconSrc)) { + fs.copyFileSync(faviconSrc, faviconDest); + fs.chmodSync(faviconDest, 0o644); + } + const viteConfig = { root: tempDir, plugins: [react()], diff --git a/package.json b/package.json index 0e8963a..03f3934 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "files": [ "bin/", "lib/", - "templates/" + "templates/", + "assets/" ], "scripts": { "test": "jest", diff --git a/templates/index.html b/templates/index.html index 7fa80b7..e2475d3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -9,10 +9,7 @@ content="Interactive demo of {{componentName}} React component built with Leafstone" /> - +