Skip to content

Commit e519317

Browse files
Lint
1 parent ab4dfb9 commit e519317

File tree

3 files changed

+230
-5
lines changed

3 files changed

+230
-5
lines changed

packages/firestore/exp/src/api/components.ts

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import { SyncEngine } from '../../../src/core/sync_engine';
3030
import { RemoteStore } from '../../../src/remote/remote_store';
3131
import { Persistence } from '../../../src/local/persistence';
3232
import { EventManager } from '../../../src/core/event_manager';
33-
import { debugAssert } from '../../../src/util/assert';
3433
export const LOG_TAG = 'ComponentProvider';
3534

3635
// The components module manages the lifetime of dependencies of the Firestore

packages/firestore/scripts/build-bundle.js

+185-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use strict";
1+
'use strict';
22
/**
33
* @license
44
* Copyright 2020 Google LLC
@@ -14,4 +14,187 @@
1414
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
17-
*/var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P((function(resolve){resolve(value)}))}return new(P||(P=Promise))((function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())}))};var __generator=this&&this.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}};exports.__esModule=true;var yargs=require("yargs");var rollup_1=require("rollup");var typescriptPlugin=require("rollup-plugin-typescript2");var alias=require("@rollup/plugin-alias");var json=require("rollup-plugin-json");var util=require("../rollup.shared");var argv=yargs.options({input:{type:"string",demandOption:true,desc:"The location of the index.ts file"},output:{type:"string",demandOption:true,desc:"The location for the transpiled JavaScript bundle"}}).argv;function buildBundle(input,output){return __awaiter(this,void 0,void 0,(function(){var bundle;return __generator(this,(function(_a){switch(_a.label){case 0:return[4,rollup_1.rollup({input:input,plugins:[alias(util.generateAliasConfig("node")),typescriptPlugin({tsconfigOverride:{compilerOptions:{target:"es2017"}},transformers:[util.removeAssertTransformer]}),json({preferConst:true})],external:util.resolveNodeExterns})];case 1:bundle=_a.sent();return[4,bundle.write({file:output,format:"es"})];case 2:_a.sent();return[2]}}))}))}buildBundle(argv.input,argv.output);
17+
*/ var __awaiter =
18+
(this && this.__awaiter) ||
19+
function (thisArg, _arguments, P, generator) {
20+
function adopt(value) {
21+
return value instanceof P
22+
? value
23+
: new P(function (resolve) {
24+
resolve(value);
25+
});
26+
}
27+
return new (P || (P = Promise))(function (resolve, reject) {
28+
function fulfilled(value) {
29+
try {
30+
step(generator.next(value));
31+
} catch (e) {
32+
reject(e);
33+
}
34+
}
35+
function rejected(value) {
36+
try {
37+
step(generator['throw'](value));
38+
} catch (e) {
39+
reject(e);
40+
}
41+
}
42+
function step(result) {
43+
result.done
44+
? resolve(result.value)
45+
: adopt(result.value).then(fulfilled, rejected);
46+
}
47+
step((generator = generator.apply(thisArg, _arguments || [])).next());
48+
});
49+
};
50+
var __generator =
51+
(this && this.__generator) ||
52+
function (thisArg, body) {
53+
var _ = {
54+
label: 0,
55+
sent: function () {
56+
if (t[0] & 1) throw t[1];
57+
return t[1];
58+
},
59+
trys: [],
60+
ops: []
61+
},
62+
f,
63+
y,
64+
t,
65+
g;
66+
return (
67+
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
68+
typeof Symbol === 'function' &&
69+
(g[Symbol.iterator] = function () {
70+
return this;
71+
}),
72+
g
73+
);
74+
function verb(n) {
75+
return function (v) {
76+
return step([n, v]);
77+
};
78+
}
79+
function step(op) {
80+
if (f) throw new TypeError('Generator is already executing.');
81+
while (_)
82+
try {
83+
if (
84+
((f = 1),
85+
y &&
86+
(t =
87+
op[0] & 2
88+
? y['return']
89+
: op[0]
90+
? y['throw'] || ((t = y['return']) && t.call(y), 0)
91+
: y.next) &&
92+
!(t = t.call(y, op[1])).done)
93+
)
94+
return t;
95+
if (((y = 0), t)) op = [op[0] & 2, t.value];
96+
switch (op[0]) {
97+
case 0:
98+
case 1:
99+
t = op;
100+
break;
101+
case 4:
102+
_.label++;
103+
return { value: op[1], done: false };
104+
case 5:
105+
_.label++;
106+
y = op[1];
107+
op = [0];
108+
continue;
109+
case 7:
110+
op = _.ops.pop();
111+
_.trys.pop();
112+
continue;
113+
default:
114+
if (
115+
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
116+
(op[0] === 6 || op[0] === 2)
117+
) {
118+
_ = 0;
119+
continue;
120+
}
121+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
122+
_.label = op[1];
123+
break;
124+
}
125+
if (op[0] === 6 && _.label < t[1]) {
126+
_.label = t[1];
127+
t = op;
128+
break;
129+
}
130+
if (t && _.label < t[2]) {
131+
_.label = t[2];
132+
_.ops.push(op);
133+
break;
134+
}
135+
if (t[2]) _.ops.pop();
136+
_.trys.pop();
137+
continue;
138+
}
139+
op = body.call(thisArg, _);
140+
} catch (e) {
141+
op = [6, e];
142+
y = 0;
143+
} finally {
144+
f = t = 0;
145+
}
146+
if (op[0] & 5) throw op[1];
147+
return { value: op[0] ? op[1] : void 0, done: true };
148+
}
149+
};
150+
exports.__esModule = true;
151+
var yargs = require('yargs');
152+
var rollup_1 = require('rollup');
153+
var typescriptPlugin = require('rollup-plugin-typescript2');
154+
var alias = require('@rollup/plugin-alias');
155+
var json = require('rollup-plugin-json');
156+
var util = require('../rollup.shared');
157+
var argv = yargs.options({
158+
input: {
159+
type: 'string',
160+
demandOption: true,
161+
desc: 'The location of the index.ts file'
162+
},
163+
output: {
164+
type: 'string',
165+
demandOption: true,
166+
desc: 'The location for the transpiled JavaScript bundle'
167+
}
168+
}).argv;
169+
function buildBundle(input, output) {
170+
return __awaiter(this, void 0, void 0, function () {
171+
var bundle;
172+
return __generator(this, function (_a) {
173+
switch (_a.label) {
174+
case 0:
175+
return [
176+
4,
177+
rollup_1.rollup({
178+
input: input,
179+
plugins: [
180+
alias(util.generateAliasConfig('node')),
181+
typescriptPlugin({
182+
tsconfigOverride: { compilerOptions: { target: 'es2017' } },
183+
transformers: [util.removeAssertTransformer]
184+
}),
185+
json({ preferConst: true })
186+
],
187+
external: util.resolveNodeExterns
188+
})
189+
];
190+
case 1:
191+
bundle = _a.sent();
192+
return [4, bundle.write({ file: output, format: 'es' })];
193+
case 2:
194+
_a.sent();
195+
return [2];
196+
}
197+
});
198+
});
199+
}
200+
buildBundle(argv.input, argv.output);

packages/firestore/scripts/run-tests.js

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use strict";
1+
'use strict';
22
/**
33
* @license
44
* Copyright 2020 Google LLC
@@ -14,4 +14,47 @@
1414
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
17-
*/exports.__esModule=true;var yargs=require("yargs");var path_1=require("path");var child_process_promise_1=require("child-process-promise");var argv=yargs.options({main:{type:"string",demandOption:true},emulator:{type:"boolean"},persistence:{type:"boolean"}}).argv;var nyc=path_1.resolve(__dirname,"../../../node_modules/.bin/nyc");var mocha=path_1.resolve(__dirname,"../../../node_modules/.bin/mocha");process.env.TS_NODE_CACHE="NO";process.env.TS_NODE_COMPILER_OPTIONS='{"module":"commonjs"}';var args=[mocha,"--require","ts-node/register","--require",argv.main,"--config","../../config/mocharc.node.js"];if(argv.emulator){process.env.FIRESTORE_EMULATOR_PORT="8080";process.env.FIRESTORE_EMULATOR_PROJECT_ID="test-emulator"}if(argv.persistence){process.env.USE_MOCK_PERSISTENCE="YES";args.push("--require","test/util/node_persistence.ts")}args=args.concat(argv._);var childProcess=child_process_promise_1.spawn(nyc,args,{stdio:"inherit",cwd:process.cwd()}).childProcess;process.once("exit",(function(){return childProcess.kill()}));process.once("SIGINT",(function(){return childProcess.kill("SIGINT")}));process.once("SIGTERM",(function(){return childProcess.kill("SIGTERM")}));
17+
*/ exports.__esModule = true;
18+
var yargs = require('yargs');
19+
var path_1 = require('path');
20+
var child_process_promise_1 = require('child-process-promise');
21+
var argv = yargs.options({
22+
main: { type: 'string', demandOption: true },
23+
emulator: { type: 'boolean' },
24+
persistence: { type: 'boolean' }
25+
}).argv;
26+
var nyc = path_1.resolve(__dirname, '../../../node_modules/.bin/nyc');
27+
var mocha = path_1.resolve(__dirname, '../../../node_modules/.bin/mocha');
28+
process.env.TS_NODE_CACHE = 'NO';
29+
process.env.TS_NODE_COMPILER_OPTIONS = '{"module":"commonjs"}';
30+
var args = [
31+
mocha,
32+
'--require',
33+
'ts-node/register',
34+
'--require',
35+
argv.main,
36+
'--config',
37+
'../../config/mocharc.node.js'
38+
];
39+
if (argv.emulator) {
40+
process.env.FIRESTORE_EMULATOR_PORT = '8080';
41+
process.env.FIRESTORE_EMULATOR_PROJECT_ID = 'test-emulator';
42+
}
43+
if (argv.persistence) {
44+
process.env.USE_MOCK_PERSISTENCE = 'YES';
45+
args.push('--require', 'test/util/node_persistence.ts');
46+
}
47+
args = args.concat(argv._);
48+
var childProcess = child_process_promise_1.spawn(nyc, args, {
49+
stdio: 'inherit',
50+
cwd: process.cwd()
51+
}).childProcess;
52+
process.once('exit', function () {
53+
return childProcess.kill();
54+
});
55+
process.once('SIGINT', function () {
56+
return childProcess.kill('SIGINT');
57+
});
58+
process.once('SIGTERM', function () {
59+
return childProcess.kill('SIGTERM');
60+
});

0 commit comments

Comments
 (0)