Closed OSpoon closed 2 months ago
oh noes that's bad :_(
just released alpha@24, might giving it a go?
pnpm extension@latest create ../content-less-ext --template content-less
oh noes that's bad :_(
just released alpha@24, might giving it a go?
pnpm extension@latest create ../content-less-ext --template content-less
Path issues only occur in development mode, I need to use the local template.
cant repro as well π’
I did found an issue with the symlink if EXTENSION_ENV=development
is set. not sure if related
Need to handle the symlink issue first, then we can determine if the code runs correctly.
// programs/create/steps/import-external-template.ts
if (process.env.EXTENSION_ENV === 'development') {
console.log(messages.installingFromTemplate(projectName, template))
templatePath = path.join(projectPath, templateName)
await fs.cp(
path.join(__dirname, '..', '..', '..', 'examples', templateName),
templatePath,
{recursive: true}
)
}
Just ran into this as well, latest doesn't work for me either:
npx extension@latest create test-extension --template=react-typescript
Need to install the following packages:
extension@2.0.0-alpha.26
Ok to proceed? (y) y
π£ - Starting a new browser extension named cat-search...
π€ - Ensuring cat-search folder exists...
π€ - Checking if destination path is writeable...
π - Scanning for potential conflicting files...
π§° - Installing cat-search from template react-typescript...
Removing existing .go-git-it-temp-folder...
[= ] 2% 18.5sError pulling git repository: [Error: ENOENT: no such file or directory, rename 'examples/react-typescript' -> '/Users/dillonshook/react-typescript'] {
errno: -2,
code: 'ENOENT',
syscall: 'rename',
path: 'examples/react-typescript',
dest: '/Users/dillonshook/react-typescript'
}
After running cleanInstall
, I re-ran the previous create command, and found that there was no issue, which seems to be caused by caching.
thanks @OSpoon!
@dshook I made a few changes to the template names, please check https://extension.js.org/docs/getting-started/templates for the new template naming. I'm going to close this one for now, please re-open if there's an issue. Thanks!
@cezaraugusto Hey I just tried out the sample doc command today and got the same error as OP:
C:\Users\me\Documents\Repositories>npx extension@latest create my-extension --template=react-typescript
π£ - Starting a new browser extension named my-extension...
π€ - Ensuring my-extension folder exists...
π€ - Checking if destination path is writeable...
π - Scanning for potential conflicting files...
π§° - Installing my-extension from template react-typescript...
[== ] 3% 18.7sError pulling git repository: [Error: ENOENT: no such file or directory, rename 'C:\Users\me\Documents\Repositories\.go-git-it-temp-folder\examples\react-typescript' -> 'C:\Users\me\Documents\Repositories\react-typescript'] {
errno: -4058,
code: 'ENOENT',
syscall: 'rename',
path: 'C:\\Users\\me\\Documents\\Repositories\\.go-git-it-temp-folder\\examples\\react-typescript',
dest: 'C:\\Users\\me\\Documents\\Repositories\\react-typescript'
}
EDIT: Looking in the examples folder, I don't even see a folder called "react-typescript". Was it deleted?
EDIT2: Okay, after looking at the examples further, it seems the "react" example already has typescript configured. Thus it looks like the docs are simply out-of-date. You can just run npx extension@latest create my-extension --template=new-react
to have both react and typescript configured at once. (Change the template to content-react
if your extension will be editing existing webpages)
The path for the template cannot be found in development mode.