Skip to content

Commit

Permalink
NPM package (cu-mkp#24)
Browse files Browse the repository at this point in the history
* add scoped name and workflow

* update packaging

* switch away from abandoned font-awesome package

* fix icon paths

* refactor some stuff

* add storybook

* bump version number to 0.0.2

* move stories folder due to build issues

* add some items from gitignore to npmignore

* refactor into monorepo with two packages

* refactor into monorepo with two packages part 2

* fix UMD builds and set up for component publication

* update action for component publication
  • Loading branch information
camdendotlol authored May 8, 2023
1 parent 5341785 commit 249204b
Show file tree
Hide file tree
Showing 430 changed files with 40,002 additions and 164 deletions.
Binary file modified .DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions .github/workflows/publish_to_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@performant-software'
- run: cd editioncrafter
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
dist/
.parcel-cache/
coverage/
node_modules/
package-lock.json
*.log
*.tgz
__tests__/integration/editioncrafter/bnf-ms-fr-640/
__tests__/integration/editioncrafter/css/
__tests__/integration/editioncrafter/css/
.cache/
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
__mocks__
__tests__
.github
.storybook
docs
.gitignore
.newtab.png
**/stories
dist/
coverage/
node_modules/
*.log
*.tgz
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# editioncrafter
UNDER DEVELOPMENT: Software for the development of EditionCrafter, digital critical edition publication tool

## Structure of this repository

There are two apps in this repo. `editioncrafter` is a React component, while `editioncrafter-umd` wraps the React component into a UMD module for use on non-React pages.

## Storybook

For local development, you can use the Storybook component.

Setup for Storybook was kind of rushed and the process could still be made simpler.

1. Run `npm run build:css`. This will generate EditionCrafter's CSS and place it in the Storybook assets folder. At the moment, the CSS does not support live-refresh, even though the JS does.
2. Clone the [`edition-crafter-cli`](https://github.com/cu-mkp/editioncrafter-cli) repository if you haven't already, do the usual `npm install`, and run `npm start` to launch a server with a test document.
3. Back here in `editioncrafter`, run `npm run storybook` to launch Storybook. You'll see a component called EditionCrafter in the sidebar, and it should be all set to try.

By default, Storybook doesn't display the hash routing params used by `react-router`. You can use the "Open canvas in new tab" button on the top right to open the component in its own tab:

![screenshot of new tab button](newtab.png)
1 change: 0 additions & 1 deletion __mocks__/css.js

This file was deleted.

30 changes: 0 additions & 30 deletions __tests__/integration/editioncrafter/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion docs/text-partial-resource.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# TODO: Description of Text Partial Resources used by EditionCrafter
# TODO: Description of Text Partial Resources used by EditionCrafter
Loading

0 comments on commit 249204b

Please sign in to comment.