Skip to content

Commit e0989d2

Browse files
committed
chore: rename and cleanup simple examples
- use lib in examples via workspace protocol - add examples folder to pnpm workspaces - lib: add dist folder to package.json exports explicitly
1 parent b38b4e0 commit e0989d2

17 files changed

Lines changed: 119 additions & 347 deletions

examples/simple-examples/nhtsa-test-iife.html renamed to examples/simple-examples/browser-iife-example.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Testing IIFE bundle imports</title>
77

8+
<!--
9+
For this example we are using a local build of the IIFE bundle for dev testing purposes.
10+
In a real world example you would probably use a CDN link to get the IIFE bundle:
11+
12+
<script
13+
type="text/javascript"
14+
src="https://cdn.jsdelivr.net/npm/@shaggytools/nhtsa-api-wrapper"
15+
></script>
16+
-->
817
<script
918
type="text/javascript"
1019
src="../../packages/lib/dist/nhtsa-api-wrapper.iife.js"

examples/simple-examples/nhtsa-test-mjs.html renamed to examples/simple-examples/browser-mjs-example.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Testing module imports</title>
77

8+
<!--
9+
For this example we are using a local build of the ESM bundle for dev testing purposes.
10+
This example also uses lazy loading to import the package.
11+
12+
In a real world example you would probably use a CDN link to get the ESM (.mjs) build:
13+
14+
<script type="module">
15+
const { DecodeVin } = await import("https://cdn.jsdelivr.net/npm/@shaggytools/nhtsa-api-wrapper/+esm")
16+
</script>
17+
-->
18+
819
<script type="module">
920
console.log(`Successfully imported via ESModule import`);
1021

examples/simple-examples/nhtsa-test-umd.html renamed to examples/simple-examples/browser-umd-example.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Testing UMD bundle imports</title>
77

8+
<!--
9+
For this example we are using a local build of the UMD bundle for dev testing purposes.
10+
In a real world example you would probably use a CDN link to get the UMD bundle:
11+
12+
<script
13+
type="text/javascript"
14+
src="https://unpkg.com/nhtsa-api-wrapper/dist/nhtsa-api-wrapper.umd.cjs"
15+
></script>
16+
-->
817
<script
918
type="text/javascript"
1019
src="../../packages/lib/dist/nhtsa-api-wrapper.umd.cjs"

examples/simple-examples/getResponseVariables.mjs

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

examples/simple-examples/nhtsa-test-es.html

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

examples/simple-examples/nhtsa-test-umd-cjs.js

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

examples/simple-examples/nhtsa-test.cjs

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

examples/simple-examples/nhtsa-test.js

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

examples/simple-examples/nhtsa-test.mjs

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

0 commit comments

Comments
 (0)