Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
non-production: move backdraft-app to github packages#136
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
452d84c
non-production: move backdraft-app to github packages
dep 2608338
non-production: add env var
dep af18ba2
chore: update readme
dep 79d6636
chore: bump jquery version
dep 1fa49e4
chore: bump jquery version
dep 079a580
chore: bump jquery version
dep ba2931f
chore: bump jquery version
dep 0936d63
chore: bump jquery version
dep ed8ec8b
Apply suggestions from code review
dep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| @@ -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) { | ||
| @@ -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() { | ||
| @@ -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() { | ||
| @@ -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() { | ||
| @@ -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; | ||
| } | ||
| @@ -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 | ||
| @@ -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: | ||
| @@ -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 | ||
| @@ -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 | ||
dep marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 3. If on a branch, ensure this version gets **merged to master** | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.