-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone content-tag implemented via conditional exports in package.json #44
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3d4ee8d
Standalone content-tag implemented via conditional exports in
NullVoxPopuli 3c816f2
Add package lints, which told me to fix things
NullVoxPopuli e3a83b0
@arethetypeswrong/cli is reporting https://github.com/arethetypeswron…
NullVoxPopuli 101d72c
Remove vitest
NullVoxPopuli b6b06b4
reduce lockfile
NullVoxPopuli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
pkg/node/ | ||
index.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/target | ||
/node_modules | ||
/node_modules | ||
|
||
pkg/node/ | ||
pkg/standalone/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# we need npm packages for the post-wasm phase | ||
npm install | ||
|
||
rm -rf pkg/node | ||
rm -rf pkg/standalone | ||
|
||
# wasm-pack knows to use wasm-opt, when present | ||
# NOTE: wasm-pack does not support multi-target building | ||
# so we'll build twice, and then tweak package.json | ||
# "exports" to point at the correct build depending on node or browser | ||
wasm-pack build --target web --out-dir pkg/standalone --weak-refs --no-pack --release | ||
wasm-pack build --target nodejs --out-dir pkg/node --weak-refs --no-pack --release | ||
|
||
# Rename the node js file to cjs, because we emit type=module | ||
mv pkg/node/content_tag.js pkg/node/content_tag.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* wasm-pack doesn't give us correct enough types. | ||
*/ | ||
|
||
|
||
|
||
interface Parsed { | ||
type: 'expression' | 'class-member'; | ||
tagName: 'template'; | ||
contents: string; | ||
range: { | ||
start: number; | ||
end: number; | ||
}; | ||
contentRange: { | ||
start: number; | ||
end: number; | ||
}; | ||
startRange: { | ||
end: number; | ||
start: number; | ||
}; | ||
endRange: { | ||
start: number; | ||
end: number; | ||
}; | ||
} | ||
|
||
|
||
/** | ||
*/ | ||
export class Preprocessor { | ||
free(): void; | ||
/** | ||
*/ | ||
constructor(); | ||
/** | ||
* @param {string} src | ||
* @param {string | undefined} filename | ||
* @returns {string} | ||
*/ | ||
process(src: string, filename?: string): string; | ||
/** | ||
* @param {string} src | ||
* @param {string | undefined} filename | ||
* @returns {any} | ||
*/ | ||
parse(src: string, filename?: string): Parsed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<html> | ||
|
||
<!-- View this file with `npm run web` --> | ||
|
||
<head> | ||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" /> | ||
<script type="module"> | ||
import {Preprocessor} from 'content-tag'; | ||
|
||
const p = new Preprocessor(); | ||
const output = p.process('<template>Hi from createPreprocessor</template>'); | ||
|
||
document.querySelector('#output').innerHTML = output; | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<pre id="output"></pre> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have this consistent with release workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the release workflow already run
npm run build
, so this is covered