@defra/flood-webchat 0.0.1-alpha.1 → 0.0.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,25 +1,9 @@
1
1
  # flood-webchat
2
2
 
3
- ## Development
4
- A demo server with hot module reloading can be started at http://localhost:9000 by running:
3
+ ## Useful Links
4
+ - [Development Guide](./docs/development-guide.md)
5
+ - [How to Publish](./docs/how-to-publish.md)
5
6
 
6
- ```shell
7
- npm run dev
8
- ```
7
+ ## Usage
8
+ TBC
9
9
 
10
- ## How to Publish
11
-
12
- ### A Pre-Release
13
-
14
- Via the GitHub GUI, create a release off your branch with a name matching a semver version pattern for the appropriate
15
- version with an added pre-release identifier, and check the pre-release identifier.
16
- For example if the latest published version was `v1.2.3` and you wish to publish a pre-release from your "cool-update"
17
- branch, name the release: `v1.2.4-cool-update.1`
18
-
19
- ### A Release
20
-
21
- Via the GitHub GUI, create a release off the main branch with a name matching a semver version pattern with the
22
- appropriate version bump. For example if the latest published version was `v1.2.3` and you wish to release:
23
- - a patch update, the new release should be called `v1.2.4`
24
- - a minor update, the new release should be called `v1.3.0`
25
- - a major update, the new release should be called `v2.0.0`
Binary file
@@ -0,0 +1,5 @@
1
+ # Development Guide
2
+
3
+ 1) Clone the repo
4
+ 2) Run `npm install` to install the dependencies.
5
+ 3) Run `npm run dev` to run a demo server with hot module reloading on http://localhost:9000.
@@ -0,0 +1,41 @@
1
+ # How to Publish
2
+
3
+ This repo implements automated publishing via GitHub actions triggered by creating a release in GitHub.
4
+ Releases should respect [the semantic versioning specification v2.0.0](https://semver.org/spec/v2.0.0.html).
5
+
6
+ ## A Pre-Release
7
+ 1) Go to the [GitHub repo homepage](https://github.com/DEFRA/flood-webchat) for this project.
8
+ 2) Click "Create a new release"
9
+
10
+ ![](./assets/create-a-new-release.png)
11
+
12
+ 3) Select your Target branch, by default it will be the "main" branch.
13
+ 4) Click "Choose a Tag", enter a version tag with the appropriate semantic version bump and suffixed with a pre-release identifier and click "Create new tag". _(for example if the latest published version was `v1.2.3` and you wish to publish a pre-release from your "cool-update"
14
+ branch, name the release: `v1.2.4-cool-update.1`)_
15
+
16
+ ![](./assets/example-pre-release.png)
17
+
18
+ 5) Use your version name as a title, and add appropriate release notes in the description field.
19
+ 6) Tick the "Set as a pre-release" checkbox.
20
+ 7) Click "Publish release"
21
+ 8) A GitHub Action should then be triggered automatically, publishing your pre-release to npm.
22
+ 9) You can install your pre-release into a consuming project by running `npm i @defra/flood-webchat@<version-number>`, e.g. `npm i @defra/flood-webchat@1.2.4-cool-update.1`.
23
+
24
+ _NOTE: pre-release identifiers must match the pattern `^-[0-9A-Za-z-].*$`_
25
+
26
+ ## A Release
27
+ 1) Go to the [GitHub repo homepage](https://github.com/DEFRA/flood-webchat) for this project.
28
+ 2) Click "Create a new release"
29
+
30
+ ![](./assets/create-a-new-release.png)
31
+
32
+ 3) Ensure that your Target branch is the "main" branch (this is the default).
33
+ 4) Click "Choose a Tag", enter a version tag with the appropriate semantic version bump.
34
+
35
+ ![](./assets/example-release.png)
36
+
37
+ 5) Use your version name as a title, and add appropriate release notes in the description field.
38
+ 6) Ensure that the "Set as a pre-release" checkbox is **NOT** checked.
39
+ 7) Click "Publish release"
40
+ 8) A GitHub Action should then be triggered automatically, publishing your release to npm.
41
+ 9) You can install your release into a consuming project by running `npm i @defra/flood-webchat@<version-number>`, e.g. `npm i @defra/flood-webchat@1.2.4`.
package/main.scss CHANGED
@@ -0,0 +1,3 @@
1
+ .defra-webchat-example {
2
+ color: blue;
3
+ }
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@defra/flood-webchat",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "",
5
- "main": "src/main.mjs",
6
- "browser": "src/browser.mjs",
5
+ "type": "module",
6
+ "main": "src/server/index.js",
7
+ "browser": "src/client/index.js",
7
8
  "scripts": {
8
9
  "test": "npm run lint && npm run unit-test",
9
10
  "dev": "(cd demo && webpack server)",
10
11
  "unit-test": "jest",
11
- "lint": "standard",
12
+ "lint": "npm run lint:js && npm run lint:scss",
13
+ "lint:js": "standard",
14
+ "lint:scss": "stylelint \"**/*.scss\"",
12
15
  "prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') { throw e } }\""
13
16
  },
14
17
  "standard": {
@@ -38,6 +41,8 @@
38
41
  "sass": "^1.66.1",
39
42
  "sass-loader": "^13.3.2",
40
43
  "standard": "^17.1.0",
44
+ "stylelint": "^15.10.3",
45
+ "stylelint-config-standard-scss": "^10.0.0",
41
46
  "webpack": "^5.88.2",
42
47
  "webpack-cli": "^5.1.4",
43
48
  "webpack-dev-server": "^4.15.1"
@@ -0,0 +1,3 @@
1
+ export function foo (value) {
2
+ return value === 'bar'
3
+ }
package/src/main.mjs DELETED
File without changes
File without changes