Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
132993a
setup the initial filter and starting page
abdallahshaban557 Aug 28, 2022
951e80a
finished updating a decent chunk of Analytics
abdallahshaban557 Aug 29, 2022
3f8fabe
Complete update endpoint and record
abdallahshaban557 Aug 29, 2022
fe0eee9
updated events + storage for RN
abdallahshaban557 Aug 30, 2022
8863030
updated wording to allow pre-commit
abdallahshaban557 Aug 30, 2022
80b4000
Updated wording to allow commit
abdallahshaban557 Aug 30, 2022
3769097
removed extra info in using existing resources
abdallahshaban557 Sep 4, 2022
35631a7
added to do comments
abdallahshaban557 Sep 4, 2022
610bbf2
Created project setup section for JS
abdallahshaban557 Sep 4, 2022
8e767a9
removed title of creating a vue app
abdallahshaban557 Sep 5, 2022
7541eeb
updated custom plugin
abdallahshaban557 Sep 5, 2022
7925126
added RN picker to more storage screens
abdallahshaban557 Sep 5, 2022
109478e
more folders updated with React Native picker
abdallahshaban557 Sep 5, 2022
04a727e
added cancel request RN picker
abdallahshaban557 Sep 5, 2022
de69a66
finished storage category RN picker
abdallahshaban557 Sep 5, 2022
efd2946
updated more pages in REST API for RN picker
abdallahshaban557 Sep 5, 2022
b22b1ee
added cancel RN picker
abdallahshaban557 Sep 5, 2022
f838c04
update Auth rulez with RN picker
abdallahshaban557 Sep 5, 2022
a2c4815
updated more RN pickers
abdallahshaban557 Sep 5, 2022
672f0c4
push notifications RN picker
abdallahshaban557 Sep 5, 2022
c106b8b
fixed in-app messaging for RN
abdallahshaban557 Sep 5, 2022
9653a94
updated main page for RN and JS
abdallahshaban557 Sep 5, 2022
b2bf064
updated pubsub to include RN
abdallahshaban557 Sep 5, 2022
76e5d63
added comment on SDKs for iOS/Android
abdallahshaban557 Sep 5, 2022
7c32350
fixed directory and example sub page for datastore
abdallahshaban557 Sep 9, 2022
96329dc
fixed up getting started for datastore for RN picker
abdallahshaban557 Sep 10, 2022
c28447c
RN picker for Datastore
abdallahshaban557 Sep 10, 2022
d67807c
added comments for followup
abdallahshaban557 Sep 10, 2022
e678f18
manipulating data RN picker
abdallahshaban557 Sep 11, 2022
44c32b1
comment
abdallahshaban557 Sep 11, 2022
0967e34
relational model RN picker
abdallahshaban557 Sep 11, 2022
d95064e
datastore for RN picker
abdallahshaban557 Sep 11, 2022
f32b49a
Interactions RN picker
abdallahshaban557 Sep 11, 2022
35296bc
predictions RN picker
abdallahshaban557 Sep 11, 2022
f7be15c
XR RN Picker
abdallahshaban557 Sep 11, 2022
664ab71
directory XR RN Picker
abdallahshaban557 Sep 11, 2022
2136c64
utilities RN picker
abdallahshaban557 Sep 11, 2022
e7e8d92
directory update
abdallahshaban557 Sep 11, 2022
118ea4b
updated incorrect import
abdallahshaban557 Sep 12, 2022
e93d01e
updated description
abdallahshaban557 Sep 12, 2022
ced3770
updated project setup
abdallahshaban557 Sep 12, 2022
37f1015
removed mention of legacy UI components in setup
abdallahshaban557 Sep 12, 2022
87deaf6
storage updates
abdallahshaban557 Sep 12, 2022
8a0a05d
XR for React Native
abdallahshaban557 Sep 12, 2022
d51bf30
removed RN from XR
abdallahshaban557 Sep 12, 2022
6586cee
Merge branch 'main' into react-native-picker
Sep 12, 2022
fcbdc97
Fixed module not found error
abdallahshaban557 Sep 13, 2022
67ac5a3
Update src/fragments/lib/storage/js/create-custom-plugin.mdx
Oct 4, 2022
314a037
Update src/fragments/lib/storage/js/create-custom-plugin.mdx
Oct 4, 2022
0e33f83
corrected type of code snippet
abdallahshaban557 Oct 4, 2022
92bf965
fixed code snippet type
abdallahshaban557 Oct 4, 2022
87f26d0
Update src/fragments/lib/analytics/js/autotrack/autotrack.mdx
Oct 5, 2022
81a0d01
Update src/fragments/lib/analytics/js/autotrack/autotrack.mdx
Oct 5, 2022
e20b7ed
Update src/fragments/lib/analytics/js/autotrack/autotrack.mdx
Oct 5, 2022
70d7a1c
Update src/fragments/lib/analytics/js/autotrack/autotrack.mdx
Oct 5, 2022
d337892
Update src/fragments/lib/analytics/js/autotrack/page-tracking.mdx
Oct 5, 2022
98516f3
remove unnecessary spaces
abdallahshaban557 Oct 5, 2022
7fe0d0b
Fixed Auth
abdallahshaban557 Oct 5, 2022
362b6d5
Update src/fragments/lib/analytics/js/create-custom-plugin.mdx
Oct 5, 2022
17e9d77
Update src/fragments/lib/datastore/react-native/getting-started/30_pl…
Oct 5, 2022
636b5fe
Updated endpoints
abdallahshaban557 Oct 5, 2022
933cf0c
Merge branch 'react-native-picker' of https://github.com/aws-amplify/…
abdallahshaban557 Oct 5, 2022
ce9331f
Update src/fragments/lib/graphqlapi/js/complex-objects.mdx
Oct 5, 2022
385261f
fixed endpoint spacing
abdallahshaban557 Oct 5, 2022
76d81f7
fixed unnecessary line breaks
abdallahshaban557 Oct 5, 2022
3f2f632
Update src/fragments/lib/pubsub/js/getting-started.mdx
Oct 5, 2022
b6c8699
Update src/fragments/lib/pubsub/js/getting-started.mdx
Oct 5, 2022
de4903a
Merge branch 'react-native-picker' of https://github.com/aws-amplify/…
abdallahshaban557 Oct 5, 2022
5e1018f
fixed unnecessary optional comment
abdallahshaban557 Oct 5, 2022
1c59f56
removed optional comments that were incorrect
abdallahshaban557 Oct 5, 2022
59a3f5f
removed Optional comments that were incorrect
abdallahshaban557 Oct 5, 2022
7a4aee5
added comment for fixing policy date
abdallahshaban557 Oct 5, 2022
61fb526
React native picker updates (#4651)
timngyn Oct 5, 2022
095c93b
updated comment positions
abdallahshaban557 Oct 5, 2022
014ff15
commit comment changes
abdallahshaban557 Oct 5, 2022
276c786
Merge branch 'react-native-picker' of https://github.com/aws-amplify/…
abdallahshaban557 Oct 5, 2022
b2e34c4
updated comment placement
abdallahshaban557 Oct 5, 2022
7163bce
removed authenticator from getting started for JS
abdallahshaban557 Oct 11, 2022
813995a
split apart the React native and browser upload examples
abdallahshaban557 Oct 11, 2022
0248b6e
updated
abdallahshaban557 Oct 12, 2022
4854ed1
Update src/fragments/lib/storage/js/react-native-uploads.mdx
Oct 12, 2022
395b224
Update src/fragments/lib/storage/js/upload.mdx
Oct 12, 2022
6910b70
Update src/fragments/lib/storage/js/browser-uploads.mdx
Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
249 changes: 126 additions & 123 deletions generatePathMap.cjs.js
Original file line number Diff line number Diff line change
@@ -1,153 +1,156 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs = require("fs");
const fs = require('fs');

function generatePathMap(
obj,
pathMap = {
"/": {
page: "/",
'/': {
page: '/'
},
"/404": {
page: "/404",
'/404': {
page: '/404'
},
"/start": {
page: "/start",
'/start': {
page: '/start'
},
"/start/q/integration/js": {
page: "/start/q/integration/[integration]",
'/start/q/integration/js': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/react": {
page: "/start/q/integration/[integration]",
'/start/q/integration/react': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/angular": {
page: "/start/q/integration/[integration]",
'/start/q/integration/angular': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/vue": {
page: "/start/q/integration/[integration]",
'/start/q/integration/vue': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/next": {
page: "/start/q/integration/[integration]",
'/start/q/integration/next': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/android": {
page: "/start/q/integration/[integration]",
'/start/q/integration/android': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/react-native": {
page: "/start/q/integration/[integration]",
'/start/q/integration/react-native': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/ionic": {
page: "/start/q/integration/[integration]",
'/start/q/integration/ionic': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/ios": {
page: "/start/q/integration/[integration]",
'/start/q/integration/ios': {
page: '/start/q/integration/[integration]'
},
"/start/q/integration/flutter": {
page: "/start/q/integration/[integration]",
'/start/q/integration/flutter': {
page: '/start/q/integration/[integration]'
},
"/lib/q/platform/flutter": {
page: "/lib/q/platform/[platform]",
'/lib/q/platform/flutter': {
page: '/lib/q/platform/[platform]'
},
"/lib/q/platform/android": {
page: "/lib/q/platform/[platform]",
'/lib/q/platform/android': {
page: '/lib/q/platform/[platform]'
},
"/lib/q/platform/ios": {
page: "/lib/q/platform/[platform]",
'/lib/q/platform/ios': {
page: '/lib/q/platform/[platform]'
},
"/lib/q/platform/js": {
page: "/lib/q/platform/[platform]",
'/lib/q/platform/js': {
page: '/lib/q/platform/[platform]'
},
"/ui/q/framework/react": {
page: "/ui/q/framework/[framework]",
'/lib/q/platform/react-native': {
page: '/lib/q/platform/[platform]'
},
"/ui/q/framework/react-native": {
page: "/ui/q/framework/[framework]",
'/ui/q/framework/react': {
page: '/ui/q/framework/[framework]'
},
"/ui/q/framework/angular": {
page: "/ui/q/framework/[framework]",
'/ui/q/framework/react-native': {
page: '/ui/q/framework/[framework]'
},
"/ui/q/framework/vue": {
page: "/ui/q/framework/[framework]",
'/ui/q/framework/angular': {
page: '/ui/q/framework/[framework]'
},
"/ui/q/framework/ionic": {
page: "/ui/q/framework/[framework]",
'/ui/q/framework/vue': {
page: '/ui/q/framework/[framework]'
},
"/ui/q/framework/flutter": {
page: "/ui/q/framework/[framework]",
'/ui/q/framework/ionic': {
page: '/ui/q/framework/[framework]'
},
"/ui/q/framework/next": {
page: "/ui/q/framework/[framework]",
'/ui/q/framework/flutter': {
page: '/ui/q/framework/[framework]'
},
"/ui-legacy/q/framework/react": {
page: "/ui-legacy/q/framework/[framework]",
'/ui/q/framework/next': {
page: '/ui/q/framework/[framework]'
},
"/ui-legacy/q/framework/react-native": {
page: "/ui-legacy/q/framework/[framework]",
'/ui-legacy/q/framework/react': {
page: '/ui-legacy/q/framework/[framework]'
},
"/ui-legacy/q/framework/angular": {
page: "/ui-legacy/q/framework/[framework]",
'/ui-legacy/q/framework/react-native': {
page: '/ui-legacy/q/framework/[framework]'
},
"/ui-legacy/q/framework/vue": {
page: "/ui-legacy/q/framework/[framework]",
'/ui-legacy/q/framework/angular': {
page: '/ui-legacy/q/framework/[framework]'
},
"/ui-legacy/q/framework/ionic": {
page: "/ui-legacy/q/framework/[framework]",
'/ui-legacy/q/framework/vue': {
page: '/ui-legacy/q/framework/[framework]'
},
"/ui-legacy/q/framework/next": {
page: "/ui-legacy/q/framework/[framework]",
'/ui-legacy/q/framework/ionic': {
page: '/ui-legacy/q/framework/[framework]'
},
"/sdk/q/platform/js": {
page: "/sdk/q/platform/[platform]",
'/ui-legacy/q/framework/next': {
page: '/ui-legacy/q/framework/[framework]'
},
"/sdk/q/platform/android": {
page: "/sdk/q/platform/[platform]",
'/sdk/q/platform/js': {
page: '/sdk/q/platform/[platform]'
},
"/sdk/q/platform/ios": {
page: "/sdk/q/platform/[platform]",
'/sdk/q/platform/android': {
page: '/sdk/q/platform/[platform]'
},
"/sdk/q/platform/flutter": {
page: "/sdk/q/platform/[platform]",
'/sdk/q/platform/ios': {
page: '/sdk/q/platform/[platform]'
},
"/console": {
page: "/console",
'/sdk/q/platform/flutter': {
page: '/sdk/q/platform/[platform]'
},
"/cli": {
page: "/cli",
'/console': {
page: '/console'
},
"/cli/function": {
page: "/cli/function",
'/cli': {
page: '/cli'
},
},
'/cli/function': {
page: '/cli/function'
}
}
) {
for (const [_, value] of Object.entries(obj)) {
const {items, filters, route, productRoot} = value;
const { items, filters, route, productRoot } = value;

if (productRoot) {
const {route} = productRoot;
const { route } = productRoot;

let filterKind = "";
if (route.startsWith("/cli") || route.startsWith("/console")) {
filterKind = "";
} else if (route.startsWith("/lib")) {
filterKind = "platform";
} else if (route.startsWith("/sdk")) {
filterKind = "platform";
} else if (route.startsWith("/ui")) {
filterKind = "framework";
} else if (route.startsWith("/guides")) {
filterKind = "platform";
} else if (route.startsWith("/start")) {
filterKind = "integration";
let filterKind = '';
if (route.startsWith('/cli') || route.startsWith('/console')) {
filterKind = '';
} else if (route.startsWith('/lib')) {
filterKind = 'platform';
} else if (route.startsWith('/sdk')) {
filterKind = 'platform';
} else if (route.startsWith('/ui')) {
filterKind = 'framework';
} else if (route.startsWith('/guides')) {
filterKind = 'platform';
} else if (route.startsWith('/start')) {
filterKind = 'integration';
}

if (filterKind !== "") {
const aOrAn = "aeiou".includes(filterKind[0]) ? "an" : "a";
if (filterKind !== '') {
const aOrAn = 'aeiou'.includes(filterKind[0]) ? 'an' : 'a';
pathMap[route] = {
page: "/ChooseFilterPage",
page: '/ChooseFilterPage',
query: {
address: route,
directoryPath: "/ChooseFilterPage",
directoryPath: '/ChooseFilterPage',
filterKind: filterKind,
message: `Choose ${aOrAn} ${filterKind}:`,
},
message: `Choose ${aOrAn} ${filterKind}:`
}
};
}
}
Expand All @@ -157,12 +160,12 @@ function generatePathMap(
}

if (!filters || !filters.length) {
let page = "";
let page = '';
const mdxSrc = `${route}.mdx`;
const tsxSrc = `${route}.tsx`;

const maybeMDXFile = "./src/pages" + mdxSrc;
const maybeTSXFile = "./src/pages" + tsxSrc;
const maybeMDXFile = './src/pages' + mdxSrc;
const maybeTSXFile = './src/pages' + tsxSrc;

if (fs.existsSync(maybeTSXFile)) {
page = tsxSrc;
Expand All @@ -172,18 +175,18 @@ function generatePathMap(

if (page.length) {
pathMap[route] = {
page: route,
page: route
};
}

continue;
}

let page = "";
let routeType = "";
["platform", "framework", "integration"].forEach((type) => {
let page = '';
let routeType = '';
['platform', 'framework', 'integration'].forEach((type) => {
const src = `${route}/q/${type}/[${type}].mdx`;
const maybeFile = "./src/pages" + src;
const maybeFile = './src/pages' + src;
if (fs.existsSync(maybeFile)) {
page = src;
routeType = type;
Expand All @@ -197,35 +200,35 @@ function generatePathMap(
// generate for _all_ filters -- unsupported filters will just generate ChooseFilterPages, which is what we want
// ideally misspellings would also map to a ChooseFilterPage, but this doesn't work with SSG
let allFilters = filters;
if (routeType !== "") {
if (routeType !== '') {
allFilters = [
"js",
"android",
"ios",
"flutter",
"react",
"react-native",
"angular",
"vue",
"ionic",
"next",
'js',
'android',
'ios',
'flutter',
'react',
'react-native',
'angular',
'vue',
'ionic',
'next'
];
}
allFilters.forEach((filter) => {
pathMap[route + "/q/" + routeType + "/" + filter] = {
page: `${route}/q/${routeType}/[${routeType}]`,
pathMap[route + '/q/' + routeType + '/' + filter] = {
page: `${route}/q/${routeType}/[${routeType}]`
};
});
const aOrAn = "aeiou".includes(routeType[0]) ? "an" : "a";
const aOrAn = 'aeiou'.includes(routeType[0]) ? 'an' : 'a';
pathMap[route] = {
page: "/ChooseFilterPage",
page: '/ChooseFilterPage',
query: {
address: route,
directoryPath: "/ChooseFilterPage",
directoryPath: '/ChooseFilterPage',
filterKind: routeType,
filters: filters,
message: `Choose ${aOrAn} ${routeType}:`,
},
message: `Choose ${aOrAn} ${routeType}:`
}
};
}
return pathMap;
Expand Down
Loading