Skip to content

Commit 7cd343f

Browse files
authored
sander/tsPlugins (#592)
* chore(monorepo): update angular version * feat(scully) sample TS plugins * test(lib): adding baseHref * fix(scully): dont update scully routes in Angular watch mode * fix(lib): move plugin source of fromData into corrrect file * feat(lib): tS plugins * fix(monorepo): import correct plugin path * fix(scully): fix guesParser error
1 parent 7d85938 commit 7cd343f

55 files changed

Lines changed: 547 additions & 108 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,4 @@ testem.log
4242
Thumbs.db
4343
tests/cypress/screenshots
4444
tests/cypress/videos
45-
scully.sampleBlog.config.js
46-
scully.scullyDocs.config.js
45+
scully.*.config.js
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
h1 {
2-
color: rgb(51, 6, 37);
3-
background-color: rgb(248, 211, 236);
2+
/* color: rgb(51, 6, 37); */
3+
/* background-color: rgb(248, 211, 236); */
4+
background-color: royalblue;
5+
color: white;
6+
width: 100%;
7+
text-align: center;
48
padding: 5px;
5-
border-radius: 5px;
6-
width: fit-content;
9+
border-radius: 8px;
10+
margin-top: 0.4rem;
11+
margin-bottom: 0.4rem;
12+
/* width: fit-content; */
713
}

apps/sample-blog/src/app/user/user.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export class UserComponent implements OnInit {
4444

4545
// This is an example of using TransferState
4646
user$ = isScullyGenerated()
47-
? this.transferState.getState<User>('user')
47+
? this.transferState
48+
.getState<User>('user')
49+
.pipe(tap(user => console.log('Incoming TSS user', user)))
4850
: this.apiUser$.pipe(
4951
tap(user => this.transferState.setState('user', user))
5052
);

demos/plugins/extra-plugin.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

demos/plugins/extra-plugin.ts

Whitespace-only changes.

docs/blog.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ published: false
117117
---
118118

119119
# Angular tutorial
120-
121120
```
122121

123122
At the top of the file there is a frontmatter, a set of instructions Scully is using. Those are:
@@ -142,10 +141,8 @@ title: 'Angular tutorial'
142141
description: 'blog description'
143142
published: false
144143
slugs:
145-
- ___UNPUBLISHED___kao8mvda_pmldPr7aN7owPpStZiuDXFZ1ILfpcv5Z
146-
147-
---
148-
# Angular tutorial
144+
- ___UNPUBLISHED___kao8mvda_pmldPr7aN7owPpStZiuDXFZ1ILfpcv5Z
145+
---# Angular tutorial
149146
```
150147

151148
The property `slugs` have been added to the frontmatter above. `slugs` contains an anonymous URL as long as the property `published` is set to `false`. This is a URL that you can share with others to for example get feedback on your blog post before it goes live.
@@ -163,13 +160,13 @@ npm run scully serve
163160
The command will give an output looking like so:
164161

165162
```output
166-
Angular distribution server started on "http://localhost:1864/"
163+
Angular distribution server started on "http://localhost:1864/"
167164
Scully static server started on "http://localhost:1668/"
168165
```
169166

170167
Open up a browser window and navigate to the URL `http://localhost:1668/`:
171168

172-
Your blog post can be found on the URL `http://localhost:1668/blog/<anonymous slug>`, which if you check the frontmatter above means the following URL `http://localhost:1668/blog/___UNPUBLISHED___kao8mvda_pmldPr7aN7owPpStZiuDXFZ1ILfpcv5Z`.
169+
Your blog post can be found on the URL `http://localhost:1668/blog/<anonymous slug>`, which if you check the frontmatter above means the following URL `http://localhost:1668/blog/___UNPUBLISHED___kao8mvda_pmldPr7aN7owPpStZiuDXFZ1ILfpcv5Z`.
173170

174171
You should now see the following output in the browser:
175172

@@ -189,6 +186,7 @@ title: 'Angular tutorial'
189186
description: 'blog description'
190187
published: true
191188
---
189+
192190
# Angular tutorial
193191
```
194192

@@ -227,6 +225,7 @@ description: 'blog description'
227225
published: true
228226
slug: angularjs-still-rocks
229227
---
228+
230229
# Angular tutorial
231230
```
232231

@@ -245,4 +244,3 @@ npm run scully serve
245244
```
246245

247246
The blog post can now be found at `http://localhost:1668/blog/angularjs-still-rocks`.
248-

libs/ng-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@scullyio/ng-lib",
3-
"version": "0.0.22",
3+
"version": "0.0.24",
44
"repository": {
55
"type": "GIT",
66
"url": "https://github.com/scullyio/scully/tree/master/projects/scullyio/ng-lib"

libs/ng-lib/src/lib/transfer-state/transfer-state.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ export class TransferStateService {
192192
* Wraps an observable into scully's transfer state. If data for the provided `name` is
193193
* available in the state, it gets returned. Otherwise, the `originalState` observable will
194194
* be returned.
195-
*
195+
*
196196
* On subsequent calls, the data in the state will always be returned. The `originalState` will
197197
* be returned only once.
198-
*
198+
*
199199
* This is a convenience method which does not require you to use `getState`/`setState` manually.
200200
*
201201
* @param name state key
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": "../../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# plugins-base-href-rewrite
2+
3+
This is the Scully base-Href rewriting render plugin. You can add this to the postRenderer, or to the defaultPostRenderer to change the base HREF to whaevet you need.
4+
You can set the the base-HREF using the `setPluginUption('baseHref', {href:})`

0 commit comments

Comments
 (0)