Skip to content

Commit

Permalink
Allow fbt-common-path to be JS modules again.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed Dec 12, 2024
1 parent 194c94a commit 3c18f58
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nkzw/fbtee-internal",
"version": "0.0.1",
"version": "0.0.2",
"private": true,
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-fbtee/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nkzw/babel-fbtee",
"version": "0.0.1",
"version": "0.0.2",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-fbtee-auto-import/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nkzw/babel-plugin-fbtee-auto-import",
"version": "0.0.1",
"version": "0.0.2",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-fbtee-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nkzw/babel-plugin-fbtee-runtime",
"version": "0.0.1",
"version": "0.0.2",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-fbtee/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nkzw/babel-plugin-fbtee",
"version": "0.0.1",
"version": "0.0.2",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
Expand Down
17 changes: 11 additions & 6 deletions packages/babel-plugin-fbtee/src/bin/collect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const argv = y
'[<source_file1>, ...]}. Otherwise stdin itself will be parsed',
)
.string(args.COMMON_STRINGS)
.default(args.COMMON_STRINGS, null)
.default(args.COMMON_STRINGS, '')
.describe(
args.COMMON_STRINGS,
'Optional path to the common strings module. ' +
Expand Down Expand Up @@ -240,12 +240,17 @@ if (argv.help) {
? (await import(transformPath)).default
: null;

const commonPath = argv[args.COMMON_STRINGS];
const fbtCommon = commonPath
const commonFile = argv[args.COMMON_STRINGS];
const fbtCommon = commonFile?.length
? (
await import(resolve(process.cwd(), commonPath), {
with: { type: 'json' },
})
await import(
resolve(process.cwd(), commonFile),
commonFile.endsWith('.json')
? {
with: { type: 'json' },
}
: {}
)
).default
: null;

Expand Down
2 changes: 1 addition & 1 deletion packages/fbtee/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fbtee",
"version": "0.0.1",
"version": "0.0.2",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
Expand Down

0 comments on commit 3c18f58

Please sign in to comment.