Skip to content

Commit

Permalink
boring setup
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Jan 22, 2024
1 parent d381d19 commit 79b9784
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ packages/*/demo
packages/*/spec
browser-extension-test-data
TODO.yml
_examples
__TEST__
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
[action-image]: https://github.com/cezaraugusto/extension-create/workflows/CI/badge.svg
[action-url]: https://github.com/cezaraugusto/extension-create/actions
[maintenance-image]: https://img.shields.io/badge/Maintained%3F-yes-green.svg
[maintenance-url]: https://GitHub.com/extension-create/extension-create/graphs/commit-activity
[npm-version-image]: https://badgen.net/npm/v/extension-create
[npm-version-url]: https://npmjs.com/package/extension-create
[npm-dependents-image]: https://badgen.net/npm/dependents/extension-create
[npm-dependents-url]: https://npmjs.com/package/extension-create
[npm-downloads-image]: https://badgen.net/npm/dm/extension-create
[npm-downloads-url]: https://npmjs.ccom/package/extension-create

> # THIS PROJECT IS UNDER ACTIVE DEVELOPMENT
# extension-create [![Maintenance][maintenance-image]][maintenance-url] [![workflow][action-image]][action-url] [![Npm package version][npm-version-image]][npm-version-url] [![Npm package dependents][npm-dependents-image]][npm-dependents-url] [![Npm package monthly downloads][npm-downloads-image]][npm-downloads-url]

<img alt="Logo" align="right" src="https://user-images.githubusercontent.com/4672033/102850460-4d22aa80-43f8-11eb-82db-9efce586f73e.png" width="25%" />
Expand All @@ -19,7 +9,7 @@ Create modern cross-browser extensions with no build configuration.

- [Creating an extension](#creating-an-extension) — How to create a new extension.
- [Getting started immediately](#getting-started-immediately) — Get work done in no time.
- [I have an extension](#i-have-an-extension) - Use only specific parts of `extension-create`
- [I have an extension](#i-have-an-extension) - Use only specific parts of `extension-create`.

`extension-create` helps you develop cross-browser extensions with built-in support for module imports/exports, auto-reload, and more. Interested to know how it's being developed? [Every week I send emails about its progress](https://cezaraugusto.substack.com/). For goals, see the [wiki](https://github.com/cezaraugusto/extension-create/wiki/This-initiative).

Expand All @@ -31,7 +21,7 @@ cd my-extension-hello
npm start
```

A new browser instance (for now, Chrome) will open up with your extension ready for development.
A new browser instance will open up with your extension ready for development.

You are done. Time to hack on your extension!

Expand All @@ -47,8 +37,6 @@ The [chrome-extensions-sample](https://github.com/GoogleChrome/chrome-extensions

If we go to the samples repository and look for an extension sample to work, let's say the [page-redder](https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/functional-samples/sample.page-redder) sample, all we need is to copy and paste it's URL as an argument for the start command:

> Optimized for **git version 2.30.0**. Older versions are supported, but download can take much longer.
```sh
npx extension-create dev https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/functional-samples/sample.page-redder
```
Expand All @@ -71,7 +59,7 @@ And see a Chrome Extension sample running automatically. On Edge!

## I have an extension

Use the command line interface `extension-create` provides and add it to your npm scripts. Here's how it should look in your `package.json`:
Just add `extension-create` to your npm scripts. Here's how it should look in your `package.json`:

```js
{
Expand All @@ -90,7 +78,7 @@ Use the command line interface `extension-create` provides and add it to your np
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Google Chrome ✅ | Microsoft Edge ✅ | Mozilla Firefox ⛔️ | Apple Safari ⛔️ | Opera browser ⛔️ | Chromium (forks) 🤔 |

> Mainstream Chromium-like browsers include Brave, and Vivaldi. These vendors are supported on production but there are currently no modules to handle development using these browsers. I do plan to support them in the near future.
> Chromium-like browsers include Brave, Vivaldi, and other popular browser choices. These vendors are supported on production but there are currently no modules to handle development using these browsers. I do plan to support them in the near future.
If you want to target a specific browser, just pass the `--browser` flag to the dev/start command (Chrome or Edge, soon others), like `npx extension-create dev --browser=edge`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ async function requestInitialLoadData() {
)
resolve(null)
} else {
console.log({response})
resolve(response)
}
}
Expand Down
1 change: 0 additions & 1 deletion programs/cli/spec/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default function cliSpec() {}

/**
* exist if node version is less than 16
* can start the cli
* can output the helper text
* can output the version
*/
Expand Down
8 changes: 5 additions & 3 deletions programs/develop/webpack/options/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ export function getBabelConfigFile(projectDir: string) {
const configFile = path.join(projectDir, file)

if (fs.existsSync(configFile)) {
console.log(
`🟡 - Using Babel config file: \`${path.basename(configFile)}\``
)
if (process.env.EXTENSION_ENV === 'development') {
console.log(
`🟡 - Using Babel config file: \`${path.basename(configFile)}\``
)
}
return configFile
}
}
Expand Down
8 changes: 1 addition & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"extends": "./packages/tsconfig/base.json",
"include": ["."],
"exclude": [
"dist",
"node_modules",
"browser-extension-test-data",
"__hmr-tests__",
"__utils__"
]
"exclude": ["dist", "node_modules", "browser-extension-test-data", "__TEST__"]
}

0 comments on commit 79b9784

Please sign in to comment.