@loupfeed/rollup-plugin 0.1.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/LICENSE.md ADDED
@@ -0,0 +1,114 @@
1
+ # Functional Source License, Version 1.1, Apache 2.0 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-ALv2
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 loupfeed
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to use,
27
+ copy, modify, create derivative works, publicly perform, publicly display and
28
+ redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or service
34
+ that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software that
39
+ exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee using
52
+ the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to the
59
+ infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software, you
68
+ must include a copy of or a link to these Terms and Conditions and not remove any
69
+ copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, INCLUDING
74
+ BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
75
+ PURPOSE, NON-INFRINGEMENT AND TITLE.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN
79
+ IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of the
84
+ Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following will
93
+ apply:
94
+
95
+ We hereby grant you a license to the Software under the Apache License, Version
96
+ 2.0, a copy of which is available at https://www.apache.org/licenses/LICENSE-2.0.
97
+
98
+ ---
99
+
100
+ ## In plain language (non-binding summary)
101
+
102
+ This is a **Fair Source** license. You can:
103
+
104
+ - **Self-host and run loupfeed** for your own purposes — including inside a
105
+ company, on your own servers or cloud account, for your own products.
106
+ - Read, modify, fork, and redistribute the source.
107
+
108
+ The one thing you may **not** do is offer loupfeed (or something substantially
109
+ similar built from it) **as a competing commercial product or hosted service**.
110
+
111
+ Two years after each release is published, that version automatically becomes
112
+ available to you under the **Apache License 2.0** (fully open source).
113
+
114
+ This summary is for convenience only; the Terms and Conditions above govern.
package/dist/index.cjs ADDED
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ loupfeedRollup: () => loupfeedRollup
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var import_build = require("@loupfeed/build");
27
+ function loupfeedRollup(options = {}) {
28
+ const projectRoot = options.projectRoot ?? process.cwd();
29
+ const release = options.release ?? (0, import_build.buildIdentity)({ cwd: projectRoot }).release;
30
+ const tagger = (0, import_build.createTagger)({ projectRoot, include: options.include });
31
+ return {
32
+ name: "loupfeed",
33
+ transform(code, id) {
34
+ const result = tagger.transform(code, id);
35
+ return result ? { code: result.code, map: result.map } : null;
36
+ },
37
+ async buildEnd() {
38
+ const ids = tagger.manifest();
39
+ if (Object.keys(ids).length === 0) return;
40
+ if (options.writeManifest !== false) {
41
+ (0, import_build.writeManifestFile)({ ids, release, outDir: options.manifestDir ?? projectRoot });
42
+ }
43
+ if (options.dsn && options.authToken) {
44
+ await (0, import_build.uploadManifest)({ dsn: options.dsn, release, ids, authToken: options.authToken });
45
+ }
46
+ }
47
+ };
48
+ }
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ loupfeedRollup
52
+ });
53
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @loupfeed/rollup-plugin — shares the JSX transform with @loupfeed/vite-plugin\n * via @loupfeed/build. `transform` tags each file; `buildEnd` writes/uploads the\n * server-side manifest. No source paths reach the bundle.\n */\n\nimport type { Plugin } from 'rollup';\nimport {\n buildIdentity,\n createTagger,\n uploadManifest,\n writeManifestFile,\n type Tagger,\n} from '@loupfeed/build';\n\nexport interface LoupfeedRollupOptions {\n dsn?: string;\n authToken?: string;\n release?: string;\n include?: RegExp;\n projectRoot?: string;\n writeManifest?: boolean;\n manifestDir?: string;\n}\n\nexport function loupfeedRollup(options: LoupfeedRollupOptions = {}): Plugin {\n const projectRoot = options.projectRoot ?? process.cwd();\n const release = options.release ?? buildIdentity({ cwd: projectRoot }).release;\n const tagger: Tagger = createTagger({ projectRoot, include: options.include });\n\n return {\n name: 'loupfeed',\n transform(code, id) {\n const result = tagger.transform(code, id);\n return result ? { code: result.code, map: result.map } : null;\n },\n async buildEnd() {\n const ids = tagger.manifest();\n if (Object.keys(ids).length === 0) return;\n if (options.writeManifest !== false) {\n writeManifestFile({ ids, release, outDir: options.manifestDir ?? projectRoot });\n }\n if (options.dsn && options.authToken) {\n await uploadManifest({ dsn: options.dsn, release, ids, authToken: options.authToken });\n }\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,mBAMO;AAYA,SAAS,eAAe,UAAiC,CAAC,GAAW;AAC1E,QAAM,cAAc,QAAQ,eAAe,QAAQ,IAAI;AACvD,QAAM,UAAU,QAAQ,eAAW,4BAAc,EAAE,KAAK,YAAY,CAAC,EAAE;AACvE,QAAM,aAAiB,2BAAa,EAAE,aAAa,SAAS,QAAQ,QAAQ,CAAC;AAE7E,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,MAAM,IAAI;AAClB,YAAM,SAAS,OAAO,UAAU,MAAM,EAAE;AACxC,aAAO,SAAS,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,IAC3D;AAAA,IACA,MAAM,WAAW;AACf,YAAM,MAAM,OAAO,SAAS;AAC5B,UAAI,OAAO,KAAK,GAAG,EAAE,WAAW,EAAG;AACnC,UAAI,QAAQ,kBAAkB,OAAO;AACnC,4CAAkB,EAAE,KAAK,SAAS,QAAQ,QAAQ,eAAe,YAAY,CAAC;AAAA,MAChF;AACA,UAAI,QAAQ,OAAO,QAAQ,WAAW;AACpC,kBAAM,6BAAe,EAAE,KAAK,QAAQ,KAAK,SAAS,KAAK,WAAW,QAAQ,UAAU,CAAC;AAAA,MACvF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,20 @@
1
+ import { Plugin } from 'rollup';
2
+
3
+ /**
4
+ * @loupfeed/rollup-plugin — shares the JSX transform with @loupfeed/vite-plugin
5
+ * via @loupfeed/build. `transform` tags each file; `buildEnd` writes/uploads the
6
+ * server-side manifest. No source paths reach the bundle.
7
+ */
8
+
9
+ interface LoupfeedRollupOptions {
10
+ dsn?: string;
11
+ authToken?: string;
12
+ release?: string;
13
+ include?: RegExp;
14
+ projectRoot?: string;
15
+ writeManifest?: boolean;
16
+ manifestDir?: string;
17
+ }
18
+ declare function loupfeedRollup(options?: LoupfeedRollupOptions): Plugin;
19
+
20
+ export { type LoupfeedRollupOptions, loupfeedRollup };
@@ -0,0 +1,20 @@
1
+ import { Plugin } from 'rollup';
2
+
3
+ /**
4
+ * @loupfeed/rollup-plugin — shares the JSX transform with @loupfeed/vite-plugin
5
+ * via @loupfeed/build. `transform` tags each file; `buildEnd` writes/uploads the
6
+ * server-side manifest. No source paths reach the bundle.
7
+ */
8
+
9
+ interface LoupfeedRollupOptions {
10
+ dsn?: string;
11
+ authToken?: string;
12
+ release?: string;
13
+ include?: RegExp;
14
+ projectRoot?: string;
15
+ writeManifest?: boolean;
16
+ manifestDir?: string;
17
+ }
18
+ declare function loupfeedRollup(options?: LoupfeedRollupOptions): Plugin;
19
+
20
+ export { type LoupfeedRollupOptions, loupfeedRollup };
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ // src/index.ts
2
+ import {
3
+ buildIdentity,
4
+ createTagger,
5
+ uploadManifest,
6
+ writeManifestFile
7
+ } from "@loupfeed/build";
8
+ function loupfeedRollup(options = {}) {
9
+ const projectRoot = options.projectRoot ?? process.cwd();
10
+ const release = options.release ?? buildIdentity({ cwd: projectRoot }).release;
11
+ const tagger = createTagger({ projectRoot, include: options.include });
12
+ return {
13
+ name: "loupfeed",
14
+ transform(code, id) {
15
+ const result = tagger.transform(code, id);
16
+ return result ? { code: result.code, map: result.map } : null;
17
+ },
18
+ async buildEnd() {
19
+ const ids = tagger.manifest();
20
+ if (Object.keys(ids).length === 0) return;
21
+ if (options.writeManifest !== false) {
22
+ writeManifestFile({ ids, release, outDir: options.manifestDir ?? projectRoot });
23
+ }
24
+ if (options.dsn && options.authToken) {
25
+ await uploadManifest({ dsn: options.dsn, release, ids, authToken: options.authToken });
26
+ }
27
+ }
28
+ };
29
+ }
30
+ export {
31
+ loupfeedRollup
32
+ };
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @loupfeed/rollup-plugin — shares the JSX transform with @loupfeed/vite-plugin\n * via @loupfeed/build. `transform` tags each file; `buildEnd` writes/uploads the\n * server-side manifest. No source paths reach the bundle.\n */\n\nimport type { Plugin } from 'rollup';\nimport {\n buildIdentity,\n createTagger,\n uploadManifest,\n writeManifestFile,\n type Tagger,\n} from '@loupfeed/build';\n\nexport interface LoupfeedRollupOptions {\n dsn?: string;\n authToken?: string;\n release?: string;\n include?: RegExp;\n projectRoot?: string;\n writeManifest?: boolean;\n manifestDir?: string;\n}\n\nexport function loupfeedRollup(options: LoupfeedRollupOptions = {}): Plugin {\n const projectRoot = options.projectRoot ?? process.cwd();\n const release = options.release ?? buildIdentity({ cwd: projectRoot }).release;\n const tagger: Tagger = createTagger({ projectRoot, include: options.include });\n\n return {\n name: 'loupfeed',\n transform(code, id) {\n const result = tagger.transform(code, id);\n return result ? { code: result.code, map: result.map } : null;\n },\n async buildEnd() {\n const ids = tagger.manifest();\n if (Object.keys(ids).length === 0) return;\n if (options.writeManifest !== false) {\n writeManifestFile({ ids, release, outDir: options.manifestDir ?? projectRoot });\n }\n if (options.dsn && options.authToken) {\n await uploadManifest({ dsn: options.dsn, release, ids, authToken: options.authToken });\n }\n },\n };\n}\n"],"mappings":";AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAYA,SAAS,eAAe,UAAiC,CAAC,GAAW;AAC1E,QAAM,cAAc,QAAQ,eAAe,QAAQ,IAAI;AACvD,QAAM,UAAU,QAAQ,WAAW,cAAc,EAAE,KAAK,YAAY,CAAC,EAAE;AACvE,QAAM,SAAiB,aAAa,EAAE,aAAa,SAAS,QAAQ,QAAQ,CAAC;AAE7E,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,MAAM,IAAI;AAClB,YAAM,SAAS,OAAO,UAAU,MAAM,EAAE;AACxC,aAAO,SAAS,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,IAC3D;AAAA,IACA,MAAM,WAAW;AACf,YAAM,MAAM,OAAO,SAAS;AAC5B,UAAI,OAAO,KAAK,GAAG,EAAE,WAAW,EAAG;AACnC,UAAI,QAAQ,kBAAkB,OAAO;AACnC,0BAAkB,EAAE,KAAK,SAAS,QAAQ,QAAQ,eAAe,YAAY,CAAC;AAAA,MAChF;AACA,UAAI,QAAQ,OAAO,QAAQ,WAAW;AACpC,cAAM,eAAe,EAAE,KAAK,QAAQ,KAAK,SAAS,KAAK,WAAW,QAAQ,UAAU,CAAC;AAAA,MACvF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@loupfeed/rollup-plugin",
3
+ "version": "0.1.0",
4
+ "description": "loupfeed Rollup plugin — opaque data-fb id injection (shared transform) + server-side manifest at buildEnd.",
5
+ "license": "FSL-1.1-ALv2",
6
+ "homepage": "https://loupfeed.com",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs"
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "README.md"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "dependencies": {
28
+ "@loupfeed/build": "0.1.0"
29
+ },
30
+ "peerDependencies": {
31
+ "rollup": "^3.0.0 || ^4.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^22.10.2",
35
+ "rollup": "^4.28.1",
36
+ "tsup": "^8.3.5",
37
+ "typescript": "~5.7.2"
38
+ },
39
+ "scripts": {
40
+ "build": "tsup",
41
+ "dev": "tsup --watch",
42
+ "typecheck": "tsc --noEmit",
43
+ "clean": "rm -rf dist .turbo"
44
+ }
45
+ }