Skip to content
This repository was archived by the owner on Nov 14, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/components/src/Loc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeLocalizedElement } from './make-localized-element';
import { STANDARD_ELEMENT_TYPES } from '../../../shared/constants';
import { STANDARD_ELEMENT_TYPES } from './constants';

export const Loc = {
A: makeLocalizedElement('a'),
Expand Down
23 changes: 1 addition & 22 deletions shared/constants.js → packages/components/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
const AST_NODE_TYPES = {
JSXElement: 'JSXElement',
JSXText: 'JSXText',
JSXExpressionContainer: 'JSXExpressionContainer',
JSXEmptyExpression: 'JSXEmptyExpression',
StringLiteral: 'StringLiteral'
};

const FLUENT_ATTRS = {
attrs: 'attrs',
l10nId: 'l10nId',
l10nVars: 'l10nVars',
l10nJSX: 'l10nJSX'
};

const STANDARD_ELEMENT_TYPES = {
export const STANDARD_ELEMENT_TYPES = {
A: {},
Abbr: {},
Address: {},
Expand Down Expand Up @@ -89,9 +74,3 @@ const STANDARD_ELEMENT_TYPES = {
Var: {},
Video: {}
};

module.exports = {
STANDARD_ELEMENT_TYPES,
FLUENT_ATTRS,
AST_NODE_TYPES
}
1 change: 1 addition & 0 deletions packages/components/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './Loc';
export * from './make-localized-element';
export * from './pseudolocalize';
export * from './constants';
1 change: 1 addition & 0 deletions packages/extraction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"dependencies": {
"@babel/parser": "^7.1.0",
"babylon-walk": "^1.0.2",
"fluent-react-components": "*",
"fluent-syntax": "^0.8.1",
"glob": "^7.1.3",
"jsx-ast-utils": "^2.0.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/extraction/src/ast-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { STANDARD_ELEMENT_TYPES } from 'fluent-react-components';
import { getProp, elementType as _elementType, hasProp } from 'jsx-ast-utils';
import { AST_NODE_TYPES, FLUENT_ATTRS, STANDARD_ELEMENT_TYPES } from '../../../shared/constants';
import { AST_NODE_TYPES, FLUENT_ATTRS } from './constants';
import { defaultShorthandName } from './defaults';
import { formatRule, pullLocalizedDOMAttributes, formatMessage } from './format-helper';

Expand Down
14 changes: 14 additions & 0 deletions packages/extraction/src/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const AST_NODE_TYPES = {
JSXElement: 'JSXElement',
JSXText: 'JSXText',
JSXExpressionContainer: 'JSXExpressionContainer',
JSXEmptyExpression: 'JSXEmptyExpression',
StringLiteral: 'StringLiteral'
};

export const FLUENT_ATTRS = {
attrs: 'attrs',
l10nId: 'l10nId',
l10nVars: 'l10nVars',
l10nJSX: 'l10nJSX'
};