@playpilot/tpi 3.7.2 → 3.8.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/README.md CHANGED
@@ -1,38 +1,32 @@
1
- # sv
2
-
3
- Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
4
-
5
- ## Creating a project
6
-
7
- If you're seeing this, you've probably already done this step. Congrats!
8
-
9
- ```bash
10
- # create a new project in the current directory
11
- npx sv create
12
-
13
- # create a new project in my-app
14
- npx sv create my-app
15
- ```
16
-
17
- ## Developing
18
-
19
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20
-
21
- ```bash
22
- npm run dev
23
-
24
- # or start the server and open the app in a new browser tab
25
- npm run dev -- --open
26
- ```
27
-
28
- ## Building
29
-
30
- To create a production version of your app:
31
-
32
- ```bash
33
- npm run build
34
- ```
35
-
36
- You can preview the production build with `npm run preview`.
37
-
38
- > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
1
+ # 💉 PlayPilot Link Injections
2
+
3
+ Link Injections (also called TPI (Text Playlink Injection) and ALI (Article Link Injection)) adds links to any page content. These links open a popover or modal with relevant information for any given movie or show. Alternatively, they link directly to the related PlayPilot page.
4
+
5
+ ## Development
6
+
7
+ Start development server using:
8
+ ```
9
+ npm run dev
10
+ ```
11
+
12
+ The dev environment will be available at:
13
+ ```
14
+ localhost:3000
15
+ ```
16
+ Only the root page has content. This page contains multiple examples different injection scenarios, some real, some made up. Some of these are intentionally tricky to parse, but have come up as real examples in the past.
17
+
18
+ ## Build
19
+
20
+ To build the final script simply run `npm run build`.
21
+
22
+ The final build differs largely from the development environment. The development environment uses SvelteKit, but the final build only uses Svelte which is build to a single file that includes all images, css, and of course the javascript itself. This file is output to `/dist/link-injections.js`. This file is included in the repo.
23
+
24
+ ## Publishing
25
+
26
+ The project is published on NPM as a package, but only the final dist file is relevant. This file is included in the repo so that it can be picked up by jsdelivr.net, which we use as a CDN for the script. The url that is presented to clients is a redirect from https://scripts.playpilot.com/link-injection.js to https://cdn.jsdelivr.net/npm/@playpilot/tpi@[version]/dist/link-injections.js. We use a direct version rather than `@latest` to have better control over caching, as `@latest` is cached both on jsdelivr and the end user's browser.
27
+
28
+ To publish the script follow these steps:
29
+ 1. Build the script and commit the new file as a separate commit
30
+ 2. Bump the package.json version and commit this change
31
+ 3. Publish the script using `npm publish --access public` (or `npm publish --access public --tag next for beta versions)
32
+ 4. Update redirect rules on Cloudflare to match the new version, which can be found under the "TPI: Latest script version (jsdelivr)" rule (or "TPI: Beta script version (jsdelivr)" for beta versions).