Skip to content
Merged
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
7 changes: 6 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '10'
- run: npm install
- run: yarn install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn run specs_without_eslint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment thread
dep marked this conversation as resolved.
OPENSSL_CONF: /dev/null
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
@invoca:registry=https://npm.pkg.github.com
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Written as a plugin-based framework, where the DataTables integration is a plugi
## Install

```
npm install backdraft-app
npm install @invoca/backdraft-app
```

## Usage
Expand All @@ -15,7 +15,7 @@ First, define a new Backdraft app:
// app.js
import MainRouter from "./main_router";

import App from "backdraft-app/src/app";
import App from "@invoca/backdraft-app/src/app";

class TableExample extends App {
activate($el) {
Expand All @@ -40,7 +40,7 @@ Define the various components of your app:
// main_router.js
import IndexView from "./views/index_view";

import Router from "backdraft-app/src/router";
import Router from "@invoca/backdraft-app/src/router";

export default class MainRouter extends Router {
get routes() {
Expand All @@ -56,15 +56,15 @@ export default class MainRouter extends Router {
};

// models/book.js
import Model from "backdraft-app/src/model";
import Model from "@invoca/backdraft-app/src/model";

export default class Book extends Model {
};

// collections/books.js
import Book from "../models/book";

import Collection from "backdraft-app/src/collection";
import Collection from "@invoca/backdraft-app/src/collection";

export default class Books extends Collection {
get model() {
Expand All @@ -75,20 +75,20 @@ export default class Books extends Collection {
// views/book_table_view.js
import BookRowView from "./book_row_view";

import LocalDataTable from "backdraft-app/src/data_table/local_data_table";
import LocalDataTable from "@invoca/backdraft-app/src/data_table/local_data_table";

export default class BookTableView extends LocalDataTable {
get rowClass() {
return BookRowView;
}

get paginate() {
return false;
}
};

// views/book_row_view.js
import Row from "backdraft-app/src/data_table/row";
import Row from "@invoca/backdraft-app/src/data_table/row";

export default class BookRowView extends Row {
get columns() {
Expand All @@ -108,21 +108,21 @@ Now create the view that pulls all the pieces together:
import BookTableView from "./book_table_view";
import Books from "../collections/books";

import View from "backdraft-app/src/view";
import View from "@invoca/backdraft-app/src/view";

export default class IndexView extends View {
render() {
const collection = new Books();
const data = [];

// fake data
for (let iter = 0; iter < 10; ++iter) {
data.push({ name : `Book ${iter + 1}` });
}

collection.add(data);
const table = new BookTableView({ collection });

this.$el.html(table.render().$el);
return this;
}
Expand All @@ -149,7 +149,7 @@ Finally, in an HTML page that loads the above scripts, activate the app at load
## Legacy Usage

The legacy usage uses the `Backdraft` object to define the components of the application.

First, define a new Backdraft app and what plugins it will use:

```javascript
Expand Down Expand Up @@ -293,14 +293,14 @@ Run the yarn `dev` script from the main directory to have the source and test fi
Run the `specs` script to run all the tests and exit

yarn run specs

Use the following two ENV variables to target specific tests:

- `SPEC_FILTER` - target specific tests via [karma-jasmine's --grep feature](https://github.com/karma-runner/karma-jasmine/blob/4f70e5e77831998dc252b2f7ad1353398144588b/README.md#configuration).

- `SPEC_FILE_FILTER` - target specific tests by file path. This value must be a regex. For example:

`SPEC_FILE_FILTER="/data_table.*_spec.js/" yarn run specs`
`SPEC_FILE_FILTER="/data_table.*_spec.js/" yarn run specs`

See all available commands with:

Expand All @@ -317,7 +317,23 @@ Thank you to all [the contributors](https://github.com/invoca/backdraft/contribu

### Publishing - admins

To publish a new version to NPM (https://www.npmjs.com/package/backdraft-app), do the following
`@invoca/backdraft-app` is published to the Invoca GitHub Packages npm registry:

https://github.com/Invoca/backdraft/pkgs/npm/backdraft-app

To publish a new version to the Invoca GitHub Packages npm registry, do the following:

#### One-time setup

Add a GitHub personal access token with `write:packages` scope to your shell environment (e.g. `~/.zshrc` or `~/.bashrc`):

```sh
export GITHUB_TOKEN=<your-github-token>
```

Create a token at https://github.com/settings/tokens.

#### Publishing

1. Ensure the following are complete:
* Tested
Expand All @@ -328,7 +344,7 @@ To publish a new version to NPM (https://www.npmjs.com/package/backdraft-app), d
* creates commit with version change
* tags the commit with the version
* pushes the commit and tag to Github
* builds and publishes the node module
* publishes the package to GitHub packages
Comment thread
dep marked this conversation as resolved.

3. If on a branch, ensure this version gets **merged to master**

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "backdraft-app",
"name": "@invoca/backdraft-app",
"version": "1.3.8",
"description": "Plugin-based UI application framework built on top of and extending Backbone to create single page apps",
"files": [
Expand All @@ -13,7 +13,7 @@
"specs_without_eslint": "karma start --single-run",
"dev": "yarn run eslint; karma start",
"examples": "grunt examples",
"postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
"postversion": "git push --tags && npm publish && git push && echo \"Successfully released version $npm_package_version!\""
},
"author": "Invoca",
"license": "MIT",
Expand Down
Loading