@startupjs/bundler 0.59.0-canary.10 → 0.59.0-canary.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,9 +109,9 @@ module.exports = function eliminatorLoader (source) {
109
109
  functionName: 'aggregation',
110
110
  magicImports: ['startupjs'],
111
111
  requirements: {
112
+ argumentsAmount: 1,
112
113
  directNamedExportedAsConst: true
113
114
  },
114
- throwIfRequirementsNotMet: true, // TODO: remove this when the next transformation is implemented
115
115
  replaceWith: {
116
116
  newFunctionNameFromSameImport: '__aggregationHeader',
117
117
  newCallArgumentsTemplate: `[
@@ -121,6 +121,37 @@ module.exports = function eliminatorLoader (source) {
121
121
  }
122
122
  ]`
123
123
  }
124
+ }, {
125
+ // export default inside of aggregation() within a separate model/*.$$myAggregation.js files
126
+ // are replaced with aggregationHeader() calls.
127
+ // Filepath is stripped of the extensions and split into sections (by dots and slashes)
128
+ // 'name' is the last section.
129
+ // 'collection' is the section before it.
130
+ //
131
+ // Example:
132
+ //
133
+ // // in model/games/$$active.js
134
+ // export default aggregation(({ gameId }) => ({ gameId }))
135
+ //
136
+ // will be replaced with:
137
+ //
138
+ // __aggregationHeader({ collection: 'games', name: '$$active' })
139
+ //
140
+ functionName: 'aggregation',
141
+ magicImports: ['startupjs'],
142
+ requirements: {
143
+ argumentsAmount: 1,
144
+ directDefaultExported: true
145
+ },
146
+ replaceWith: {
147
+ newFunctionNameFromSameImport: '__aggregationHeader',
148
+ newCallArgumentsTemplate: `[
149
+ {
150
+ collection: %%folderAndFilenameWithoutExtension%%.split(/[\\\\/\\.]/).at(-2),
151
+ name: %%folderAndFilenameWithoutExtension%%.split(/[\\\\/\\.]/).at(-1)
152
+ }
153
+ ]`
154
+ }
124
155
  }, {
125
156
  // TODO: this has to be implemented! It's not actually working yet.
126
157
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs/bundler",
3
- "version": "0.59.0-canary.10",
3
+ "version": "0.59.0-canary.12",
4
4
  "description": "Opinionated scripts and configs to develop a react-native-web project",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -21,10 +21,10 @@
21
21
  "@mdx-js/loader": "^2.3.0",
22
22
  "@mdx-js/mdx": "^2.3.0",
23
23
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
24
- "@startupjs/babel-plugin-eliminator": "^0.59.0-canary.0",
24
+ "@startupjs/babel-plugin-eliminator": "^0.59.0-canary.12",
25
25
  "@startupjs/babel-plugin-react-css-modules": "^6.5.4-1",
26
26
  "@startupjs/babel-plugin-react-pug-classnames": "^0.59.0-canary.0",
27
- "@startupjs/babel-plugin-startupjs-plugins": "^0.59.0-canary.0",
27
+ "@startupjs/babel-plugin-startupjs-plugins": "^0.59.0-canary.12",
28
28
  "@startupjs/babel-plugin-transform-react-pug": "^7.0.1-0",
29
29
  "@startupjs/css-to-react-native-transform": "^1.9.0-2",
30
30
  "@startupjs/server": "^0.59.0-canary.10",
@@ -35,7 +35,7 @@
35
35
  "assets-webpack-plugin": "^7.1.1",
36
36
  "autoprefixer": "^10.4.0",
37
37
  "babel-loader": "^8.2.3",
38
- "babel-preset-startupjs": "^0.59.0-canary.10",
38
+ "babel-preset-startupjs": "^0.59.0-canary.12",
39
39
  "connect": "^3.7.0",
40
40
  "css-loader": "^6.5.0",
41
41
  "css-minimizer-webpack-plugin": "^5.0.0",
@@ -59,5 +59,5 @@
59
59
  "peerDependencies": {
60
60
  "react-native-svg": "*"
61
61
  },
62
- "gitHead": "993af934183af979810d84bd96fe8abe1c0a2584"
62
+ "gitHead": "9d66de696832b5ff5f2297bbbc811a0e18b3b6cf"
63
63
  }