Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript definitions #135

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ module.exports = {
es6: true,
node: true
},
extends: "eslint:recommended",
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
parserOptions: {
ecmaVersion: 2016
},
ignorePatterns: [
"src/crx3.pb.js"
],
rules: {
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"]
semi: ["error", "always"],
"@typescript-eslint/no-var-requires": "off"
}
};
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: Node.js Unit Tests

on:
push:
branches:
- master
pull_request:

jobs:
build-front:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow-failure || false }}

strategy:
matrix:
Expand All @@ -30,6 +31,7 @@ jobs:

- name: Install and run tests
run: npm install-ci-test
continue-on-error: ${{ matrix.allow-failure || false }}

- name: Run CLI commands
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
coverage
.nyc_output
tmp
dist

build.crx
update.xml
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test
.travis.yml
dist
.travis.yml
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,23 @@ crx.load( path.resolve(__dirname, './myExtension') )
```

### ChromeExtension = require("crx")
### crx = new ChromeExtension(attrs)
### crx = new ChromeExtension(attrs?)

This module exports the `ChromeExtension` constructor directly, which can take an optional attribute object, which is used to extend the instance.

`attrs` is an optional object with advanced configuration elements:

```js
crx = new ChromeExtension({
// By default, we exclude bundling crx extensions within extensions
// You can change that, and ignore other files as well
ignore: ['*.crx']
// By default, it produces extensions compatible with CRX version 3 (since Chromium 64)
// CRX version 2 is for Chromium versions prior to 64
version: 3
})
```

### crx.load(path|files)

Prepares the temporary workspace for the Chrome Extension located at `path` — which is expected to directly contain `manifest.json`.
Expand Down
Loading