@newsletterstudio/umbraco 14.0.0-rc1 → 14.0.0
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/package.json +1 -1
- package/readme.md +7 -71
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,74 +1,10 @@
|
|
|
1
|
-
# Newsletter Studio
|
|
2
|
-
|
|
1
|
+
# Newsletter Studio / Umbraco
|
|
2
|
+
Use this package to extend [Newsletter Studio](https://www.newsletterstudio.org) for Umbraco. Please refer to our [documentation](https://www.newsletterstudio.org/documentation/) for details on how use the extension points in the package.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
Use
|
|
4
|
+
While not required, we recommend building extensions using the following technologies:
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
npm run build
|
|
11
|
-
```
|
|
6
|
+
* Lit
|
|
7
|
+
* TypeScript
|
|
8
|
+
* Vite
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
The NPM package is built using the npm cli, there is a script ready to execute the build.
|
|
15
|
-
|
|
16
|
-
### Build NPM Package
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm run build:npm
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
This script will run a Typescript-build, clean the output (in the dist-folder), cleanse the package.json file and use `npm pack` to create the package. After this we also need to publish the artifact to npmjs.org.
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
#TODO: How to publish NPM-package to npmjs.org
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Adding new exports / paths
|
|
29
|
-
In `tsconfig.json` there are a number of `paths` configured. These paths can be used internally to make our own code simpler **BUT** this also means that we probably need to export it in the published NPM-package.
|
|
30
|
-
|
|
31
|
-
When do we need to publish the path?
|
|
32
|
-
|
|
33
|
-
* IF the path is used in ANY OTHER component, class or type that is published - the new path also needs to be included in the published NPM-package.
|
|
34
|
-
|
|
35
|
-
To add a new path to the NPM package we need to:
|
|
36
|
-
|
|
37
|
-
* [ ] Add the path to the `tsconfig.json`
|
|
38
|
-
* [ ] Add the path to the `package.json`s `exports`-section (note that this is a relative path to the dist-folder created during build).
|
|
39
|
-
* [ ] Add the path to `vite.config.ts` to ensure that the outputed js-file always have the same name (no hash).
|
|
40
|
-
* [ ] Add the path as a a important map in `umbraco-package.json` (In `/NewsletterStudio/wwwroot/App_Plugins/newsletterstudio/`), have it point to the file outputted by vite.
|
|
41
|
-
|
|
42
|
-
### Local build/install of NPM package
|
|
43
|
-
When we want to try out a new version of the NPM-package we can create a new local build.
|
|
44
|
-
|
|
45
|
-
Run
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm run build:npm
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
This will output a `.tgz` file, move/copy this file into the project where we want to test it and install using any of the methods below.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
# Install local package
|
|
56
|
-
npm install "D:\Development\Newsletter Studio\Arkiv\Releases\newsletterstudio-umbraco-14.0.0.tgz"
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Or in package.json, just add the path to the file and run `npm install`
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
...
|
|
64
|
-
"dependencies": {
|
|
65
|
-
"@newsletterstudio/umbraco": "./../npm-package-src/newsletter-studio-umbraco-ui-0.0.0.tgz",
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Debugging
|
|
71
|
-
We have several debugging concepts in the package:
|
|
72
|
-
* `<umb-debug visible></umb-debug>` to show Umbraco contexts
|
|
73
|
-
* `<ns-json-debug .data=${}>` to render a object as json inside a pre-element.
|
|
74
|
-
* `<ns-validation-errors-debug></ns-validation-errors-debug>` to show validation errors from the closest context.
|
|
10
|
+
The [NewsletterStudioContrib](https://github.com/enkelmedia/NewsletterStudioContrib)-project on Github provides several examples and can be used as a starting point for the build setup.
|