Skip to content

Commit

Permalink
Merge branch 'v3' of https://github.com/notsidney/xtable into data-la…
Browse files Browse the repository at this point in the history
…yer-rewrite
  • Loading branch information
notsidney committed May 4, 2022
1 parent 633bb6b commit 9d79d22
Show file tree
Hide file tree
Showing 490 changed files with 10,174 additions and 42,904 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
.yarn
emulators/
46 changes: 35 additions & 11 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { whenDev } = require("@craco/craco");
const CracoAlias = require("craco-alias");
const CracoSwcPlugin = require("craco-swc");

Expand All @@ -11,20 +12,43 @@ module.exports = {
tsConfigPath: "./tsconfig.extend.json",
},
},
{
plugin: CracoSwcPlugin,
options: {
swcLoaderOptions: {
jsc: {
target: "es2019",
transform: {
react: {
runtime: "automatic",
// Use Babel on dev since Jotai doesn’t have swc plugins yet
// See https://github.com/pmndrs/jotai/discussions/1057
// Use swc on production and test since Babel seems to break Jest
...whenDev(
() => [],
[
{
plugin: CracoSwcPlugin,
options: {
swcLoaderOptions: {
jsc: {
target: "es2021",
transform: {
react: {
runtime: "automatic",
},
},
},
},
},
},
},
},
]
),
],
babel: {
plugins: [
"jotai/babel/plugin-debug-label",
"./node_modules/jotai/babel/plugin-react-refresh",
],
},
jest: {
configure: (jestConfig) => {
jestConfig.setupFilesAfterEnv = ["./src/test/setupTests.ts"];
jestConfig.forceExit = true; // jest hangs if we don't have this

jestConfig.moduleNameMapper["^lodash-es$"] = "lodash";
return jestConfig;
},
},
};
1 change: 1 addition & 0 deletions emulators/auth_export/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"kind":"identitytoolkit#DownloadAccountResponse","users":[{"localId":"26CJMrwlouNRwkiLofNK07DNgKhw","createdAt":"1651022832613","lastLoginAt":"1651630548960","displayName":"Admin User","photoUrl":"","customAttributes":"{\"roles\": [\"ADMIN\"]}","providerUserInfo":[{"providerId":"google.com","rawId":"abc123","federatedId":"abc123","displayName":"Admin User","email":"[email protected]"}],"validSince":"1651630530","email":"[email protected]","emailVerified":true,"disabled":false,"lastRefreshAt":"2022-05-04T02:15:48.960Z"},{"localId":"3xTRVPnJGT2GE6lkiWKZp1jShuXj","createdAt":"1651023059442","lastLoginAt":"1651223181908","displayName":"Editor User","providerUserInfo":[{"providerId":"google.com","rawId":"1535779573397289142795231390488730790451","federatedId":"1535779573397289142795231390488730790451","displayName":"Editor User","email":"[email protected]"}],"validSince":"1651630530","email":"[email protected]","emailVerified":true,"disabled":false}]}
1 change: 1 addition & 0 deletions emulators/auth_export/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"signIn":{"allowDuplicateEmails":false},"usageMode":"DEFAULT"}
12 changes: 12 additions & 0 deletions emulators/firebase-export-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "10.6.0",
"firestore": {
"version": "1.14.1",
"path": "firestore_export",
"metadata_file": "firestore_export/firestore_export.overall_export_metadata"
},
"auth": {
"version": "10.6.0",
"path": "auth_export"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 21 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,26 @@
"destination": "/index.html"
}
]
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"storage": {
"rules": "storage.rules"
},
"emulators": {
"auth": {
"port": 9099
},
"firestore": {
"port": 9299
},
"storage": {
"port": 9199
},
"ui": {
"enabled": true
}
}
}
4 changes: 4 additions & 0 deletions firestore.indexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"indexes": [],
"fieldOverrides": []
}
36 changes: 36 additions & 0 deletions firestore.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Allow admins to read and write all documents
match /{document=**} {
allow read, write: if hasAnyRole(["ADMIN", "OWNER"]);
}

// Rowy: Allow signed in users to read Rowy configuration and admins to write
match /_rowy_/{docId} {
allow read: if request.auth.token.roles.size() > 0;
allow write: if hasAnyRole(["ADMIN", "OWNER"]);
match /{document=**} {
allow read: if request.auth.token.roles.size() > 0;
allow write: if hasAnyRole(["ADMIN", "OWNER"]);
}
}
// Rowy: Allow users to edit their settings
match /_rowy_/userManagement/users/{userId} {
allow get, update, delete: if isDocOwner(userId);
allow create: if request.auth != null;
}
// Rowy: Allow public to read public Rowy configuration
match /_rowy_/publicSettings {
allow get: if true;
}

// Rowy: Utility functions
function isDocOwner(docId) {
return request.auth != null && (request.auth.uid == resource.id || request.auth.uid == docId);
}
function hasAnyRole(roles) {
return request.auth != null && request.auth.token.roles.hasAny(roles);
}
}
}
Loading

0 comments on commit 9d79d22

Please sign in to comment.