Skip to content

Commit bdee1ef

Browse files
committed
Remove Babel runtime package coupling
1 parent b0c5b0e commit bdee1ef

6 files changed

Lines changed: 7 additions & 12 deletions

File tree

packages/babel-plugin-rn-stylename-inline/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const { GLOBAL_NAME, LOCAL_NAME } =
2-
require('@cssxjs/runtime/constants')
31
const template = require('@babel/template').default
42
const parser = require('@babel/parser')
53
const t = require('@babel/types')
64
const COMPILERS = require('@cssxjs/loaders/compilers')
75
const DEFAULT_MAGIC_IMPORTS = ['cssxjs', 'startupjs']
86
const DEFAULT_PLATFORM = 'web'
7+
const GLOBAL_NAME = '__CSS_GLOBAL__'
8+
const LOCAL_NAME = '__CSS_LOCAL__'
99

1010
const buildConst = template(`
1111
const %%variable%% = %%value%%

packages/babel-plugin-rn-stylename-inline/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"@babel/parser": "^7.0.0",
2727
"@babel/template": "^7.4.0",
2828
"@babel/types": "^7.0.0",
29-
"@cssxjs/loaders": "^0.3.0",
30-
"@cssxjs/runtime": "^0.3.0"
29+
"@cssxjs/loaders": "^0.3.0"
3130
},
3231
"devDependencies": {
3332
"@babel/plugin-syntax-jsx": "^7.0.0",

packages/babel-plugin-rn-stylename-to-style/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const fs = require('fs')
33
const t = require('@babel/types')
44
const template = require('@babel/template').default
55
const parser = require('@babel/parser')
6-
const { GLOBAL_NAME, LOCAL_NAME } = require('@cssxjs/runtime/constants')
76
const { addNamed } = require('@babel/helper-module-imports')
87

98
const COMPILERS = require('@cssxjs/loaders/compilers')
@@ -15,6 +14,8 @@ const STYLE_REGEX = /(?:^s|S)tyle$/
1514
const ROOT_STYLE_PROP_NAME = 'style'
1615
const RUNTIME_IMPORT_NAME = 'runtime'
1716
const RUNTIME_FRIENDLY_NAME = 'cssx'
17+
const GLOBAL_NAME = '__CSS_GLOBAL__'
18+
const LOCAL_NAME = '__CSS_LOCAL__'
1819
const OPTIONS_CACHE = ['teamplay']
1920
const OPTIONS_REACT_TYPES = ['react-native', 'web']
2021
const DEFAULT_MAGIC_IMPORTS = ['cssxjs', 'startupjs']

packages/babel-plugin-rn-stylename-to-style/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"@babel/helper-module-imports": "^7.0.0",
2727
"@babel/parser": "^7.0.0",
2828
"@babel/template": "^7.4.0",
29-
"@babel/types": "^7.0.0",
30-
"@cssxjs/runtime": "^0.3.0"
29+
"@babel/types": "^7.0.0"
3130
},
3231
"devDependencies": {
3332
"@babel/plugin-syntax-jsx": "^7.0.0",

packages/cssxjs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"@cssxjs/bundler": "^0.3.0",
4242
"@cssxjs/css-to-rn": "^0.3.0",
4343
"@cssxjs/loaders": "^0.3.0",
44-
"@cssxjs/runtime": "^0.3.0",
4544
"@react-pug/babel-plugin-react-pug": "^0.1.18",
4645
"@react-pug/check-types": "^0.1.18",
4746
"babel-preset-cssxjs": "^0.3.0"

yarn.lock

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ __metadata:
727727
"@babel/template": "npm:^7.4.0"
728728
"@babel/types": "npm:^7.0.0"
729729
"@cssxjs/loaders": "npm:^0.3.0"
730-
"@cssxjs/runtime": "npm:^0.3.0"
731730
babel-plugin-tester: "npm:^9.1.0"
732731
jest: "npm:^30.0.4"
733732
languageName: unknown
@@ -742,7 +741,6 @@ __metadata:
742741
"@babel/plugin-syntax-jsx": "npm:^7.0.0"
743742
"@babel/template": "npm:^7.4.0"
744743
"@babel/types": "npm:^7.0.0"
745-
"@cssxjs/runtime": "npm:^0.3.0"
746744
"@react-pug/babel-plugin-react-pug": "npm:^0.1.18"
747745
babel-plugin-tester: "npm:^9.1.0"
748746
jest: "npm:^30.0.4"
@@ -798,7 +796,7 @@ __metadata:
798796
languageName: unknown
799797
linkType: soft
800798

801-
"@cssxjs/runtime@npm:^0.3.0, @cssxjs/runtime@workspace:packages/runtime":
799+
"@cssxjs/runtime@workspace:packages/runtime":
802800
version: 0.0.0-use.local
803801
resolution: "@cssxjs/runtime@workspace:packages/runtime"
804802
dependencies:
@@ -5334,7 +5332,6 @@ __metadata:
53345332
"@cssxjs/bundler": "npm:^0.3.0"
53355333
"@cssxjs/css-to-rn": "npm:^0.3.0"
53365334
"@cssxjs/loaders": "npm:^0.3.0"
5337-
"@cssxjs/runtime": "npm:^0.3.0"
53385335
"@react-pug/babel-plugin-react-pug": "npm:^0.1.18"
53395336
"@react-pug/check-types": "npm:^0.1.18"
53405337
babel-preset-cssxjs: "npm:^0.3.0"

0 commit comments

Comments
 (0)