Skip to content

Commit 3c18f58

Browse files
committed
Allow fbt-common-path to be JS modules again.
1 parent 194c94a commit 3c18f58

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nkzw/fbtee-internal",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"private": true,
55
"license": "MIT",
66
"type": "module",

packages/babel-fbtee/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nkzw/babel-fbtee",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "The JavaScript & React Internationalization Framework.",
55
"keywords": [
66
"fbt",

packages/babel-plugin-fbtee-auto-import/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nkzw/babel-plugin-fbtee-auto-import",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "The JavaScript & React Internationalization Framework.",
55
"keywords": [
66
"fbt",

packages/babel-plugin-fbtee-runtime/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nkzw/babel-plugin-fbtee-runtime",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "The JavaScript & React Internationalization Framework.",
55
"keywords": [
66
"fbt",

packages/babel-plugin-fbtee/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nkzw/babel-plugin-fbtee",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "The JavaScript & React Internationalization Framework.",
55
"keywords": [
66
"fbt",

packages/babel-plugin-fbtee/src/bin/collect.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const argv = y
121121
'[<source_file1>, ...]}. Otherwise stdin itself will be parsed',
122122
)
123123
.string(args.COMMON_STRINGS)
124-
.default(args.COMMON_STRINGS, null)
124+
.default(args.COMMON_STRINGS, '')
125125
.describe(
126126
args.COMMON_STRINGS,
127127
'Optional path to the common strings module. ' +
@@ -240,12 +240,17 @@ if (argv.help) {
240240
? (await import(transformPath)).default
241241
: null;
242242

243-
const commonPath = argv[args.COMMON_STRINGS];
244-
const fbtCommon = commonPath
243+
const commonFile = argv[args.COMMON_STRINGS];
244+
const fbtCommon = commonFile?.length
245245
? (
246-
await import(resolve(process.cwd(), commonPath), {
247-
with: { type: 'json' },
248-
})
246+
await import(
247+
resolve(process.cwd(), commonFile),
248+
commonFile.endsWith('.json')
249+
? {
250+
with: { type: 'json' },
251+
}
252+
: {}
253+
)
249254
).default
250255
: null;
251256

packages/fbtee/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fbtee",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "The JavaScript & React Internationalization Framework.",
55
"keywords": [
66
"fbt",

0 commit comments

Comments
 (0)