Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
101arrowz committed Jun 28, 2020
1 parent f4fff6a commit 9f5d9a0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/parcel-config-pwa-manifest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.0.3
- Fix bug
## 0.0.2
- Update dependencies
- Add CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion packages/parcel-config-pwa-manifest/index.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"transformers": {
"*.{htm,html}": ["...", "parcel-transformer-pwa-manifest"],
"*.{htm,html}": ["@parcel/transformer-html", "parcel-transformer-pwa-manifest"],
"*.{xml,png,webp,tiff,jpg,webmanifest}": ["@parcel/transformer-raw"]
},
"namers": ["parcel-namer-pwa-manifest", "..."]
Expand Down
4 changes: 2 additions & 2 deletions packages/parcel-config-pwa-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parcel-config-pwa-manifest",
"version": "0.0.2",
"version": "0.0.3",
"description": "A Parcel 2 plugin that generates a Web App Manifest, creates all necessary icons, and more!",
"main": "index.json",
"author": "Arjun Barrett <arjunbarrett@gmail.com>",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"parcel-namer-pwa-manifest": "^0.0.1",
"parcel-transformer-pwa-manifest": "^0.0.2"
"parcel-transformer-pwa-manifest": "^0.0.3"
},
"peerDependencies": {
"parcel": "2.0.0-beta.1"
Expand Down
2 changes: 2 additions & 0 deletions packages/parcel-transformer-pwa-manifest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.0.3
- Fix bug
## 0.0.2
- Update dependencies
## 0.0.1
Expand Down
6 changes: 6 additions & 0 deletions packages/parcel-transformer-pwa-manifest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PWAManifestGenerator, {
} from '@pwa-manifest/core';
import { extname } from 'path';
import { match } from 'posthtml/lib/api';
import render from 'posthtml-render';
import { Transformer } from '@parcel/plugin';

const headSearch = /(?<=<head(.*?)>)|<\/head>/;
Expand Down Expand Up @@ -125,5 +126,10 @@ export default new Transformer<
return newAssets;
}
return [asset];
},
generate({ ast }) {
return {
content: render(ast)
};
}
});
2 changes: 1 addition & 1 deletion packages/parcel-transformer-pwa-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parcel-transformer-pwa-manifest",
"version": "0.0.2",
"version": "0.0.3",
"description": "A Parcel v2 transformer that generates a Web App Manifest, creates all necessary icons, and more!",
"main": "lib/index.js",
"author": "Arjun Barrett <arjunbarrett@gmail.com>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ type Resolve = (from: string, to: string) => Promise<string>;
declare module '@parcel/plugin' {
export class Transformer<T, S> {
constructor(data: {
loadConfig(dat: { config: Config<T>, options: Options, logger: PluginLogger }): Promise<void>;
preSerializeConfig?(dat: { config: Config<S>, options: Options, logger: PluginLogger }): Promise<void>;
postDeserializeConfig?(dat: { config: Config<T>, options: Options, logger: PluginLogger }): Promise<void>;
loadConfig(dat: { config: Config<T>, options: Options, logger: PluginLogger }): Async<void>;
preSerializeConfig?(dat: { config: Config<S>, options: Options, logger: PluginLogger }): Async<void>;
postDeserializeConfig?(dat: { config: Config<T>, options: Options, logger: PluginLogger }): Async<void>;
transform(dat: { asset: Asset, config: T | null, options: Options, logger: PluginLogger, resolve: Resolve }): Async<TransformerResultAsset[]>;
generate(dat: { ast: AST }): Async<{ content: string }>;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'posthtml-render' {
export default function render(ast: unknown): string;
}

0 comments on commit 9f5d9a0

Please sign in to comment.