Skip to content

Commit 170efe9

Browse files
committed
Replace fluent-gecko/ workspace with fluent-react/rollup.firefox.js
1 parent 43cebb8 commit 170efe9

File tree

9 files changed

+50
-140
lines changed

9 files changed

+50
-140
lines changed

fluent-gecko/README.md

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

fluent-gecko/package.json

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

fluent-gecko/rollup.config.mjs

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

fluent-gecko/src/fluent-react.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

fluent-gecko/src/fluent-syntax.js

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

fluent-react/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"./package.json": "./package.json"
99
},
1010
"files": [
11-
"./dist/",
12-
"./vendor/"
11+
"dist/",
12+
"!dist/fluent-react.cjs",
13+
"vendor/"
1314
],
1415
"homepage": "https://projectfluent.org",
1516
"author": "Mozilla <l10n-drivers@mozilla.org>",
@@ -47,7 +48,8 @@
4748
"reactjs"
4849
],
4950
"scripts": {
50-
"build": "tsc -p ./tsconfig.build.json"
51+
"build": "tsc -p ./tsconfig.build.json",
52+
"postbuild": "rollup --config rollup.firefox.js"
5153
},
5254
"engines": {
5355
"node": "^20.19 || ^22.12 || >=24"
@@ -61,6 +63,7 @@
6163
"react": ">=16.8.0"
6264
},
6365
"devDependencies": {
66+
"@rollup/plugin-node-resolve": "^16.0.3",
6467
"@types/react": "^18.0.28",
6568
"react": "^18.2.0",
6669
"react-dom": "^18.2.0",

fluent-react/rollup.firefox.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { nodeResolve } from "@rollup/plugin-node-resolve";
2+
import pkg from "./package.json" with { type: "json" };
3+
4+
/**
5+
* This produces a bundled version of `@fluent/react` suitable for inclusion in Firefox:
6+
*
7+
* https://searchfox.org/firefox-main/source/devtools/client/shared/vendor/fluent-react.js
8+
*/
9+
10+
const license = `\
11+
/* Copyright 2019 Mozilla Foundation and others
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License");
14+
* you may not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* http://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS,
21+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*/
25+
26+
`;
27+
28+
export default {
29+
input: "dist/index.js",
30+
output: {
31+
file: "dist/fluent-react.cjs",
32+
format: "cjs",
33+
generatedCode: { constBindings: true },
34+
banner: license,
35+
intro: `/** ${pkg.name}@${pkg.version} */`,
36+
},
37+
context: "this",
38+
external: ["react"],
39+
plugins: [nodeResolve()],
40+
};

package-lock.json

Lines changed: 4 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"./fluent-langneg",
1010
"./fluent-react",
1111
"./fluent-syntax",
12-
"./fluent-gecko",
1312
"./tools"
1413
],
1514
"scripts": {

0 commit comments

Comments
 (0)