Skip to content

Commit

Permalink
get project name from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
notsidney committed Sep 2, 2021
1 parent 969a42a commit 5ca534b
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 28 deletions.
9 changes: 9 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const CracoAlias = require("craco-alias");
const CracoSwcPlugin = require("craco-swc");

module.exports = {
plugins: [
{
plugin: CracoAlias,
options: {
source: "tsconfig",
baseUrl: "./src",
tsConfigPath: "./tsconfig.extend.json",
},
},
{
plugin: CracoSwcPlugin,
options: {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "rowy",
"name": "Rowy",
"version": "2.0.0",
"homepage": "https://rowy.io/",
"repository": {
Expand Down Expand Up @@ -106,6 +106,7 @@
"@types/react-dom": "^17.0.8",
"@types/react-router-dom": "^5.1.7",
"@types/use-persisted-state": "^0.3.0",
"craco-alias": "^3.0.1",
"firebase-tools": "^8.12.1",
"husky": "^4.2.5",
"monaco-editor": "^0.21.2",
Expand Down
5 changes: 2 additions & 3 deletions src/components/BuilderInstaller.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import useDoc from "hooks/useDoc";
import Modal from "components/Modal";
import { Box, Button, CircularProgress, Typography } from "@material-ui/core";
import { Box, CircularProgress, Typography } from "@material-ui/core";
import { IFormDialogProps } from "./Table/ColumnMenu/NewColumn";
import OpenInNewIcon from "@material-ui/icons/OpenInNew";
import CheckCircleIcon from "@material-ui/icons/CheckCircle";

export interface IProjectSettings
Expand All @@ -29,7 +28,7 @@ export default function BuilderInstaller({ handleClose }: IProjectSettings) {
children={
<Box display="flex" flexDirection="column">
<Typography variant="body2">
You will be redirected to Google Cloud Shell to deploy Rowy Function
You will be redirected to Google Cloud Shell to deploy Function
Builder to Cloud Run.
</Typography>
<br />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navigation/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import ArrowRightIcon from "@material-ui/icons/ArrowRight";
import UpdateChecker, { useLatestUpdateState } from "./UpdateChecker";
import { useAppContext } from "contexts/AppContext";
import routes from "constants/routes";
import { projectId } from "../../firebase";
import meta from "../../../package.json";
import { projectId } from "@src/firebase";
import meta from "@root/package.json";

const useStyles = makeStyles((theme) =>
createStyles({
Expand Down
9 changes: 6 additions & 3 deletions src/components/Navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import NavDrawer from "./NavDrawer";
import { useRowyContext } from "contexts/RowyContext";
import UserMenu from "./UserMenu";

import { name } from "@root/package.json";
import { projectId } from "@src/firebase";

export const APP_BAR_HEIGHT = 56;

const useStyles = makeStyles((theme) =>
Expand Down Expand Up @@ -56,12 +59,12 @@ export default function Navigation({
const currentTable = tableCollection?.split("/")[0];

useEffect(() => {
const name =
const tableName =
_find(tables, ["collection", currentTable])?.name || currentTable;
document.title = `${name} | Rowy`;
document.title = `${tableName} | ${projectId} | ${name}`;

return () => {
document.title = "Rowy";
document.title = `${projectId} | ${name}`;
};
}, [currentTable]);

Expand Down
3 changes: 2 additions & 1 deletion src/components/ProjectSettings/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { authOptions } from "firebase/firebaseui";
import { Link } from "@material-ui/core";
import OpenInNewIcon from "@material-ui/icons/OpenInNew";
import WIKI_LINKS from "constants/wikiLinks";
import { name } from "@root/package.json";

export const projectSettingsForm = [
{
Expand Down Expand Up @@ -54,7 +55,7 @@ export const projectSettingsForm = [
format: "url",
assistiveText: (
<>
A Cloud Run instance is required to build and deploy Rowy Cloud
A Cloud Run instance is required to build and deploy {name} Cloud
Functions.
<Link href={WIKI_LINKS.functions} target="_blank" rel="noopener">
Learn more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import CodeEditor from "components/Table/editors/CodeEditor";
import FormAutosave from "./FormAutosave";
import { FieldType } from "constants/fields";
import WIKI_LINKS from "constants/wikiLinks";
import { name } from "@root/package.json";

const useStyles = makeStyles((theme) =>
createStyles({
Expand Down Expand Up @@ -104,8 +105,8 @@ export default function DefaultValueInput({
</MenuItem>
<MenuItem value="dynamic">
<ListItemText
primary="Dynamic (Requires Rowy Cloud Functions)"
secondary="Write code to set the default value using this table’s Rowy Cloud Function. Setup is required."
primary={`Dynamic (Requires ${name} Cloud Functions)`}
secondary={`Write code to set the default value using this table’s ${name} Cloud Function. Setup is required.`}
className={classes.typeSelectItem}
/>
</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/ColumnMenu/FieldSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function FieldSettings(props: IMenuModalProps) {
const buildUrl = settingsDoc.get("buildUrl");
if (!buildUrl) {
snack.open({
message: `Rowy functions builder is not yet setup`,
message: `Functions Builder is not yet setup`,
variant: "error",
action: (
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const additionalVariables = [
{
key: "fieldTypes",
description:
"fieldTypes is a map of all fields and its corresponding Rowy column type",
"fieldTypes is a map of all fields and its corresponding field type",
},
{
key: "extensionConfig",
Expand Down
3 changes: 2 additions & 1 deletion src/components/TableSettings/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Link, Typography } from "@material-ui/core";
import OpenInNewIcon from "@material-ui/icons/OpenInNew";
import { projectId } from "../../firebase";
import WIKI_LINKS from "constants/wikiLinks";
import { name } from "@root/package.json";

export const tableSettings = (
mode: TableSettingsDialogModes | null,
Expand Down Expand Up @@ -143,7 +144,7 @@ export const tableSettings = (
displayCondition: "return values.tableType === 'collectionGroup'",
assistiveText: (
<>
Rowy Cloud Functions that rely on{" "}
{name} Cloud Functions that rely on{" "}
<Link
href="https://firebase.google.com/docs/functions/firestore-events#function_triggers"
target="_blank"
Expand Down
3 changes: 2 additions & 1 deletion src/components/TableSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { tableSettings } from "./form";
import { useRowyContext } from "contexts/RowyContext";
import useRouter from "../../hooks/useRouter";
import { db } from "../../firebase";
import { name } from "@root/package.json";

export enum TableSettingsDialogModes {
create,
Expand Down Expand Up @@ -243,7 +244,7 @@ export default function TableSettingsDialog({
body: (
<>
<DialogContentText>
This will only delete the Rowy configuration data.
This will only delete the {name} configuration data.
</DialogContentText>
<DialogContentText>
You will not lose any data in your Firestore collection
Expand Down
2 changes: 1 addition & 1 deletion src/components/Wizards/ImportCsvWizard/Step1Columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default function Step1Columns({
)}
<Grid item xs={12} sm={6}>
<Typography variant="overline" gutterBottom component="h2">
Rowy Columns
Table Columns
</Typography>
</Grid>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Wizards/ImportCsvWizard/Step2NewColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function Step2NewColumns({
<Grid container spacing={2} className={classes.typeSelectRow}>
<Grid item xs={12} sm={6}>
<Typography variant="overline" gutterBottom component="h2">
New Rowy Columns
New Table Columns
</Typography>
<Divider />

Expand Down
2 changes: 1 addition & 1 deletion src/components/Wizards/ImportWizard/Step1Columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default function Step1Columns({ config, setConfig }: IStepProps) {
</Grid>
<Grid item xs={12} sm={6}>
<Typography variant="overline" gutterBottom component="h2">
Sort Rowy Columns
Sort Table Columns
</Typography>
<Divider />

Expand Down
2 changes: 1 addition & 1 deletion src/components/Wizards/ImportWizard/Step3Types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Step3Types({ config, updateConfig, isXs }: IStepProps) {
<Grid container spacing={2} className={classes.typeSelectRow}>
<Grid item xs={12} sm={6}>
<Typography variant="overline" gutterBottom component="h2">
Rowy Columns
Table Columns
</Typography>
<Divider />

Expand Down
2 changes: 1 addition & 1 deletion src/components/Wizards/ImportWizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function ImportWizard() {
{
title: "Rename Columns",
description:
"Rename your Rowy columns with user-friendly names. These changes will not update the field names in your database.",
"Rename your table columns with user-friendly names. These changes will not update the field names in your database.",
content: (
<Step2Rename
config={config}
Expand Down
2 changes: 1 addition & 1 deletion src/components/fields/Email/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const config: IFieldConfig = {
initialValue: "",
initializable: true,
icon: <EmailIcon />,
description: "Email address. Rowy does not validate emails.",
description: "Email address.",
TableCell: withBasicCell(BasicCell),
TableEditor: TextEditor,
SideDrawerField,
Expand Down
3 changes: 1 addition & 2 deletions src/components/fields/Phone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export const config: IFieldConfig = {
initialValue: "",
initializable: true,
icon: <PhoneIcon />,
description:
"Phone numbers stored as text. Rowy does not validate phone numbers.",
description: "Phone numbers stored as text.",
TableCell: withBasicCell(BasicCell),
TableEditor: TextEditor,
SideDrawerField,
Expand Down
2 changes: 1 addition & 1 deletion src/components/fields/Url/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const config: IFieldConfig = {
initialValue: "",
initializable: true,
icon: <UrlIcon />,
description: "Web address. Rowy does not validate URLs.",
description: "Web address.",
TableCell: withBasicCell(BasicCell),
TableEditor: TextEditor,
SideDrawerField,
Expand Down
2 changes: 1 addition & 1 deletion src/constants/fields.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Define field type strings used in Rowy column config
// Define field type strings used in column config
export enum FieldType {
// TEXT
shortText = "SIMPLE_TEXT",
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.extend.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"paths": {
"@root/*": ["../*"],
"@src/*": ["./*"]
}
}
}
14 changes: 12 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"extends": "./tsconfig.extend.json",
"compilerOptions": {
"target": "es6",
"lib": ["es5", "es6", "dom", "dom.iterable", "esnext"],
"lib": [
"es5",
"es6",
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -18,5 +25,8 @@
"baseUrl": "src",
"noFallthroughCasesInSwitch": true
},
"include": ["src", "types"]
"include": [
"src",
"types"
]
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5660,6 +5660,11 @@ cosmiconfig@^7.0.0:
path-type "^4.0.0"
yaml "^1.10.0"

craco-alias@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/craco-alias/-/craco-alias-3.0.1.tgz#45e5cb338b222a7f62d17e398b54aff7cf1572af"
integrity sha512-N+Qaf/Gr/f3o5ZH2TQjMu5NhR9PnT1ZYsfejpNvZPpB0ujdrhsSr4Ct6GVjnV5ostCVquhTKJpIVBKyL9qDQYA==

craco-swc@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/craco-swc/-/craco-swc-0.1.3.tgz#520e199bcb48fd29a047eae9b7d2f27154b3bdba"
Expand Down

0 comments on commit 5ca534b

Please sign in to comment.