Open wottpal opened 6 days ago
hi @wottpal thanks for the kind words! I'm glad you use and like Extension.js
.DS.Store
files are in the .gitignore
file so it should be skipped by default. How can I reproduce the issues you're facing in both dev/build steps?
I've attached a simple reproduction flow. As macOS likes creating .DS_Store
files quite regularly when browsing through Finder, it's safe to assume there will be a _locales/.DS_Store
at some point (regardless of whether it's gitignored).
~/Developer/playground ยป bunx extension@latest create dsstore-reproduction zoma@dennis-mbp-2
๐ฃ - Starting a new browser extension named dsstore-reproduction...
๐ค - Ensuring dsstore-reproduction folder exists...
๐ค - Checking if destination path is writeable...
๐ - Scanning for potential conflicting files...
๐งฐ - Installing dsstore-reproduction...
๐ - Writing package.json metadata...
๐ - Installing dependencies... (takes a moment)
๐ - Writing README.md metadata...
๐ - Writing manifest.json metadata...
๐ฒ - Initializing git repository for dsstore-reproduction...
๐ - Writing .gitignore lines...
๐งฉ - Success! Extension dsstore-reproduction created.
Now cd dsstore-reproduction and npm run dev to open a new browser instance
with your extension installed, loaded, and enabled for development.
You are ready. Time to hack on your extension!
--------------------------------------------------------------------------------------------------------------------------
~/Developer/playground ยป cd dsstore-reproduction zoma@dennis-mbp-2
--------------------------------------------------------------------------------------------------------------------------
~/Developer/playground/dsstore-reproduction (main*) ยป mkdir _locales zoma@dennis-mbp-2
--------------------------------------------------------------------------------------------------------------------------
~/Developer/playground/dsstore-reproduction (main*) ยป touch _locales/.DS_Store zoma@dennis-mbp-2
--------------------------------------------------------------------------------------------------------------------------
~/Developer/playground/dsstore-reproduction (main*) ยป bun run dev zoma@dennis-mbp-2
$ extension dev
node:fs:1507
const result = binding.readdir(
^
Error: ENOTDIR: not a directory, scandir '/Users/zoma/Developer/playground/dsstore-reproduction/_locales/.DS_Store'
at Object.readdirSync (node:fs:1507:26)
at Li (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/extension-develop/dist/module.js:110:23193)
at de (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/extension-develop/dist/module.js:110:24541)
at ds.apply (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/extension-develop/dist/module.js:110:61768)
at createCompiler (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/webpack/lib/webpack.js:81:12)
at create (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/webpack/lib/webpack.js:154:16)
at webpack (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/webpack/lib/webpack.js:182:32)
at f (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/webpack/lib/index.js:75:16)
at gp (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/extension-develop/dist/module.js:161:4600)
at Timeout._onTimeout (/Users/zoma/Developer/playground/dsstore-reproduction/node_modules/extension-develop/dist/module.js:170:1475) {
errno: -20,
code: 'ENOTDIR',
syscall: 'scandir',
path: '/Users/zoma/Developer/playground/dsstore-reproduction/_locales/.DS_Store'
}
Node.js v20.17.0
error: script "dev" exited with code 1
My recommondation would be skipping .DS_Store
files in general, also when (recursively) copying stuff over to /dist
during dev
& build
.
hey @wottpal can't repro unfortunately. I see you are using bun, does it happen with npm/pnpm as well?
Hmm, I can reproduce the exact same error with npm
(and npx
respectively) with the commands above.
Hey there, first thanks for building this great tool! It has really working super flawlessly for me (and I'm using v2 alphas for a while).
There is one annoying thing though, that comes up quite often as macOS likes creating these stupid
.DS_Store
over and over again which causes some issues:_locales/.DS_Store
is no directory.DS_Store
files. Workaround:find . -name '.DS_Store' -type f -delete
.I think it would be a great addition, to delete this file (recursively) during development & build.