Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependabot/npm and yarn/extensions/github1s/browserify sign 4.2.2 #537

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fa5122c
Use webpack to replace the shell script
xcv58 May 29, 2022
a0ac30d
Remove unnecessary scripts
xcv58 May 29, 2022
c281396
Fix the DEV_VSCODE logic
xcv58 May 29, 2022
d19bd6b
fix typo
xcv58 May 29, 2022
562b6fd
Update readme
xcv58 May 29, 2022
d30b014
Fix test
xcv58 May 29, 2022
a2525d2
Remove empty.js
xcv58 May 29, 2022
7979dd9
enable writeToDisk
xcv58 May 29, 2022
94683b0
Use HtmlWebpackPlugin to generate html files
xcv58 May 30, 2022
664bb9f
Add yarn workspaces support and add bare minimal Turborepo
xcv58 May 30, 2022
3f185da
Remove unnecessary yarn install command
xcv58 May 30, 2022
18d9249
Update turbo config
xcv58 May 31, 2022
0cfcab4
Merge master
xcv58 Jun 5, 2022
6d44a2b
clean up
xcv58 Jun 5, 2022
c351029
Merge remote-tracking branch 'origin/master' into yarn-workspace
xcv58 Jun 16, 2022
9310fac
Bump dependencies
xcv58 Jun 16, 2022
1cfdcf4
Bump eslint
xcv58 Jun 16, 2022
235b7f7
Merge master
xcv58 Jul 6, 2022
5a1da5c
Add new line
xcv58 Jul 6, 2022
5b4d65e
Revert extensions/nim-web/package.json change
xcv58 Jul 6, 2022
2d9e539
Revert to master
xcv58 Jul 6, 2022
dd1ebb2
Revert "Revert to master"
xcv58 Jul 7, 2022
d6a7db6
chore(deps-dev): bump webpack in /extensions/github1s (#491)
dependabot[bot] Mar 15, 2023
8955dc4
chore(deps-dev): bump webpack from 5.75.0 to 5.76.0 (#492)
dependabot[bot] Mar 16, 2023
f00d3a7
chore: bump vscode to 1.77.3 (#493)
conwnet Apr 14, 2023
b80443f
chore(deps): bump yaml from 2.1.1 to 2.2.2 (#499)
dependabot[bot] Jun 1, 2023
f670b9d
chore: bump vscode to 1.78.2 (#500)
conwnet Jun 4, 2023
0aef569
chore(deps): bump semver from 7.3.7 to 7.5.3 in /extensions/github1s …
dependabot[bot] Jul 9, 2023
07cba39
chore(deps): bump tough-cookie from 4.0.0 to 4.1.3 in /tests (#505)
dependabot[bot] Jul 9, 2023
cbcf062
chore: bump vscode to 1.80.0 (#504)
wolfsilver Jul 9, 2023
dec62ab
chore: bump vscode to 1.80.0 (#506)
conwnet Jul 9, 2023
ef4c2ed
chore(deps): bump semver from 5.7.1 to 5.7.2 in /tests (#508)
dependabot[bot] Jul 11, 2023
4678ce9
chore: bump vscode to 1.80.1 (#511)
wolfsilver Jul 19, 2023
fdb2f08
fix: border styles for input on authorization page (#514)
wolfsilver Jul 21, 2023
8a32252
chore(deps): bump word-wrap from 1.2.3 to 1.2.4 in /tests (#513)
dependabot[bot] Jul 23, 2023
ad2d1fd
chore(deps): bump semver from 5.7.1 to 5.7.2 (#510)
dependabot[bot] Jul 23, 2023
4645c9f
chore(deps): bump semver from 5.7.1 to 5.7.2 in /vscode-web (#509)
dependabot[bot] Jul 23, 2023
c31277f
chore(deps): bump word-wrap from 1.2.3 to 1.2.5 (#515)
dependabot[bot] Jul 23, 2023
2ed7884
chore: bump vscode to 1.81.1 (#519)
conwnet Aug 28, 2023
18271b0
chore: bump vscode to 1.82.2 (#527)
conwnet Sep 26, 2023
1d8e2e8
chore(deps): bump graphql from 16.4.0 to 16.8.1 in /extensions/github…
dependabot[bot] Sep 26, 2023
7a769bd
Update devcontainers version to Node 20 (#525)
weaversam8 Sep 26, 2023
61321fa
chore: bump vscode to 1.83.1 (#533)
conwnet Oct 22, 2023
8fbe287
chore(deps): bump @babel/traverse from 7.18.2 to 7.23.2 in /tests (#532)
dependabot[bot] Oct 23, 2023
9b26e29
feat: migrate the OSSInsight API to public endpoint (#524)
conwnet Oct 23, 2023
ecb9ce6
chore(deps): bump postcss from 8.4.21 to 8.4.31 (#531)
dependabot[bot] Oct 23, 2023
659de6e
chore(deps): bump browserify-sign in /extensions/github1s
dependabot[bot] Oct 27, 2023
84f2b11
Merge remote-tracking branch 'origin/yarn-workspace' into dependabot/…
BTCRob1993 Nov 12, 2023
637d294
Merge branch 'feature/gitlab' into dependabot/npm_and_yarn/extensions…
BTCRob1993 Nov 13, 2023
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
8 changes: 4 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# [Choice] Node.js version: 14, 12, 10
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
FROM mcr.microsoft.com/devcontainers/typescript-node:${VARIANT}

# same package list from github1s/scripts/preinstall.sh
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand All @@ -13,7 +13,7 @@ RUN mkdir -p /opt/dev \
&& cd /opt/dev \
&& git clone https://github.com/emscripten-core/emsdk.git \
&& cd /opt/dev/emsdk \
&& ./emsdk install 2.0.6 \
&& ./emsdk activate 2.0.6
&& ./emsdk install 3.1.21 \
&& ./emsdk activate 3.1.21

ENV PATH="/opt/dev/emsdk:/opt/dev/emsdk/node/12.9.1_64bit/bin:/opt/dev/emsdk/upstream/emscripten:${PATH}"
ENV PATH="/opt/dev/emsdk:/opt/dev/emsdk/node/14.18.2_64bit/bin:/opt/dev/emsdk/upstream/emscripten:${PATH}"
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 10, 12, 14
"args": {
"VARIANT": "12"
"VARIANT": "20-bullseye"
}
},

Expand All @@ -21,7 +21,7 @@
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5000],
"forwardPorts": [8080],

// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "yarn",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [16.x, 18.x]
node-version: [18.x]

runs-on: ${{ matrix.os }}

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-wtih-vscode-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [16.x]
node-version: [18.16.0]

runs-on: ${{ matrix.os }}

Expand All @@ -35,6 +35,7 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node-version }}

- run: sudo apt -y install libkrb5-dev
- run: yarn --frozen-lockfile
- run: yarn build:vscode
- run: yarn yalc && yarn build
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tasks:
echo "Please wait for 'yarn watch' to complete compilation, then run 'yarn serve'"
echo "==========================================================================="
ports:
- port: 5000
- port: 8080
onOpen: open-browser
github:
prebuilds:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ git clone git@github.com:conwnet/github1s.git
cd github1s
yarn
yarn watch
# The cli will automatically open http://localhost:5000 once the build is completed.
# You can visit http://localhost:5000/conwnet/github1s if it doesn't.
# The cli will automatically open http://localhost:8080 once the build is completed.
# You can visit http://localhost:8080/conwnet/github1s if it doesn't.
```

#### Local development with full VS Code build
Expand All @@ -84,8 +84,8 @@ After the initial successful build, you could use the watch mode:
cd github1s
yarn
yarn watch-with-vscode
# The cli will automatically open http://localhost:5000 once the build is completed.
# You can visit http://localhost:5000/conwnet/github1s if it doesn't.
# The cli will automatically open http://localhost:8080 once the build is completed.
# You can visit http://localhost:8080/conwnet/github1s if it doesn't.
```

### ... or ... VS Code + Docker Development
Expand All @@ -104,8 +104,8 @@ You can use the VS Code plugin [Remote-Containers](https://marketplace.visualstu
```bash
yarn
yarn watch
# The cli will automatically open http://localhost:5000 once the build is completed.
# You can visit http://localhost:5000/conwnet/github1s if it doesn't.
# The cli will automatically open http://localhost:8080 once the build is completed.
# You can visit http://localhost:8080/conwnet/github1s if it doesn't.
```

### Format all codes
Expand Down
2 changes: 1 addition & 1 deletion docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $ yarn
$ yarn watch # or yarn build, it may take minutes, wait please
```

Then, there will be a new directory named `dist` generated in the project root. The `yarn watch:dev-server` (part of `yarn watch` command) will automatically open http://localhost:5000 in the browser.
Then, there will be a new directory named `dist` generated in the project root. The `yarn watch:dev-server` (part of `yarn watch` command) will automatically open http://localhost:8080 in the browser.

If you get a 404 error for some static files, please wait a minute for the building to complete.

Expand Down
2 changes: 1 addition & 1 deletion extensions/github1s/assets/pages/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
outline: 1px solid transparent;
font-family: var(--vscode-font-family);
color: var(--vscode-input-foreground);
border: 1px solid var(--vscode-input-background);
border: 1px solid var(--vscode-input-border, var(--vscode-widget-border));
background-color: var(--vscode-input-background);
}

Expand Down
4 changes: 2 additions & 2 deletions extensions/github1s/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@
"@apollo/client": "^3.5.10",
"@octokit/core": "^3.6.0",
"dayjs": "^1.11.1",
"graphql": "^16.3.0",
"graphql": "^16.8.1",
"history": "^5.3.0",
"js-base64": "^3.7.2",
"json-stable-stringify": "^1.0.1",
Expand All @@ -622,7 +622,7 @@
"node-polyfill-webpack-plugin": "^1.1.4",
"ts-loader": "^9.2.8",
"typescript": "^4.6.3",
"webpack": "^5.72.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.9.2"
}
}
2 changes: 1 addition & 1 deletion extensions/github1s/src/adapters/ossinsight/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const RankingLanguages = [
'PHP',
'C++',
'C#',
'Typescript',
'TypeScript',
'Shell',
'C',
'Ruby',
Expand Down
18 changes: 0 additions & 18 deletions extensions/github1s/src/adapters/ossinsight/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@ export class OSSInsightDataSource extends DataSource {
type: FileType.Directory,
name: '',
children: [
{
type: FileType.Directory,
name: '.vscode',
children: [
{
type: FileType.File,
name: 'settings.json',
content: () =>
JSON.stringify({
'files.exclude': { '.vscode': true },
'markdown.preview.doubleClickToSwitchToEditor': false,
'workbench.editorAssociations': {
'*.md': 'vscode.markdown.preview.editor',
},
}),
},
],
},
{
type: FileType.Directory,
name: 'collections',
Expand Down
80 changes: 29 additions & 51 deletions extensions/github1s/src/adapters/ossinsight/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,104 +12,82 @@ const resolveDataFromResponse = (response: Response) => {
if (response.status < 200 || response.status >= 300) {
return [];
}
return response.json().then((body) => body?.data || []);
return response.json().then((body) => body?.data?.rows || []);
};

export type RepoItem = {
collection_names?: string;
contributor_logins?: string;
description?: string;
forks?: number;
forks: string;
language?: string;
repo_name: string;
stars?: number;
total_score?: number;
stars: string;
total_score: string;
};

export const getTrendingRepos = (period: RankingPeriod, language: string): Promise<RepoItem[]> => {
const encodedLanguage = encodeURIComponent(language) || 'All';
const periodValue =
period === RankingPeriod.Today ? 'past_24_hours' : RankingPeriod.ThisWeek ? 'past_week' : 'past_month';
const requestUrl = `${OSSInsightEndpoint}/q/trending-repos?language=${encodedLanguage}&period=${periodValue}`;
const requestUrl = `${OSSInsightEndpoint}/v1/trends/repos/?language=${encodedLanguage}&period=${periodValue}`;
return fetch(requestUrl).then(resolveDataFromResponse);
};

export type RecentHotCollectionItem = {
id: number;
last_2nd_month_rank: number;
last_month_rank: number;
id: string;
name: string;
rank: number;
rank_changes: number;
repo_id: number;
repos: string;
repo_id: string;
repo_name: string;
repos: number;
visits: number;
repo_rank_changes: string;
repo_past_period_rank: string;
repo_current_period_rank: string;
};

export const getRecentHotCollections = (): Promise<RecentHotCollectionItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/q/recent-hot-collections`;
const requestUrl = `${OSSInsightEndpoint}/v1/collections/hot/`;
return fetch(requestUrl).then(resolveDataFromResponse);
};

export type CollectionItem = {
id: number;
id: string;
name: string;
public: number;
};

export const getCollections = memorize((): Promise<CollectionItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/collections`;
const requestUrl = `${OSSInsightEndpoint}/v1/collections/`;
return fetch(requestUrl).then(resolveDataFromResponse);
});

export const getCollectionIdByName = async (collectionName: string): Promise<number | null> => {
export const getCollectionIdByName = async (collectionName: string): Promise<string | null> => {
const collections = await getCollections();
return collections.find((item) => item.name === collectionName)?.id || null;
};

export type Last28DaysRankItem = {
last_2nd_period_rank: number;
last_2nd_period_total: number;
last_period_rank: number;
last_period_total: number;
rank_pop: number;
repo_id: number;
repo_id: string;
repo_name: string;
total: number;
total_pop: number;
current_period_growth: string;
past_period_growth: string;
growth_pop: string;
rank_pop: string;
total: string;
current_period_rank: string;
past_period_rank: string;
};

export const getCollectionStarsLast28DaysRank = (collectionId: number): Promise<Last28DaysRankItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/q/collection-stars-last-28-days-rank?collectionId=${collectionId}`;
export const getCollectionStarsLast28DaysRank = (collectionId: string): Promise<Last28DaysRankItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/v1/collections/${collectionId}/ranking_by_stars/`;
return fetch(requestUrl).then(resolveDataFromResponse);
};

export const getCollectionPullRequestsLast28DaysRank = (collectionId: number): Promise<Last28DaysRankItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/q/collection-pull-requests-last-28-days-rank?collectionId=${collectionId}`;
export const getCollectionPullRequestsLast28DaysRank = (collectionId: string): Promise<Last28DaysRankItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/v1/collections/${collectionId}/ranking_by_issues/`;
return fetch(requestUrl).then(resolveDataFromResponse);
};

export const getCollectionIssuesLast28DaysRank = (collectionId: number): Promise<Last28DaysRankItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/q/collection-issues-last-28-days-rank?collectionId=${collectionId}`;
return fetch(requestUrl).then(resolveDataFromResponse);
};

export type CollectionStarsMonthRankItem = {
current_month: string;
current_month_rank: number;
current_month_total: number;
last_month: string;
last_month_rank: number;
last_month_total: number;
rank_mom: number;
repo_id: number;
repo_name: string;
total: number;
total_mom: number;
};

export const getCollectionStarsMonthRank = (collectionId: number) => {
const requestUrl = `https://api.ossinsight.io/q/collection-stars-last-28-days-rank?collectionId=${collectionId}`;
export const getCollectionIssuesLast28DaysRank = (collectionId: string): Promise<Last28DaysRankItem[]> => {
const requestUrl = `${OSSInsightEndpoint}/v1/collections/${collectionId}/ranking_by_prs/`;
return fetch(requestUrl).then(resolveDataFromResponse);
};
39 changes: 25 additions & 14 deletions extensions/github1s/src/adapters/ossinsight/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ const createRepoItemMarkdown = (repo: RepoItem, period: RankingPeriod) => {
`[![LastCommit](https://img.shields.io/github/last-commit/${repo.repo_name})](https://github.com/${repo.repo_name}/commits)`,
];

const increaseStarsText = (repo.stars || 0) >= 0 ? `+${repo.stars || 0}` : `-${repo.stars}`;
const increaseForksText = (repo.forks || 0) >= 0 ? `+${repo.forks || 0}` : `-${repo.forks}`;
const increaseStarsText = (+repo.stars || 0) >= 0 ? `+${repo.stars || 0}` : `-${repo.stars}`;
const increaseForksText = (+repo.forks || 0) >= 0 ? `+${repo.forks || 0}` : `-${repo.forks}`;
const contributorsMarkdown = contributorAvatars.length
? ' &nbsp;&nbsp; Built by &nbsp;' + contributorAvatars.join('&nbsp;&nbsp;')
: '';
const collectionMarkdown = repo.collection_names ? ` &nbsp;&nbsp; <i>${repo.collection_names}</i>` : '';
const fireThreshold = period === RankingPeriod.ThisWeek ? 5000 : period === RankingPeriod.ThisMonth ? 12000 : 1000;

return `
## ${(repo.total_score || 0) >= fireThreshold ? '🔥' : '🚀'} [${repo.repo_name}](${buildRepoLink(repo.repo_name)})
## ${(+repo.total_score || 0) >= fireThreshold ? '🔥' : '🚀'} [${repo.repo_name}](${buildRepoLink(repo.repo_name)})

${repo.description || ''}

Expand Down Expand Up @@ -126,12 +126,23 @@ const getPopCountText = (pop_count: number, percentage = false) => {
: '';
};

const getRankChangeText = (rank_change: number) => {
const absValue = Math.abs(rank_change);
return rank_change > 0
? ` <span style="color: #ff453a">(↓${absValue})</span>`
: rank_change < 0
? ` <span style="color: #30d158">(↑${absValue})</span>`
: '';
};

export const createCollectionsListPageMarkdown = async () => {
const collectionReposMap = new Map<string, [string, string][]>();
const [hotCollections, allCollections] = await Promise.all([getRecentHotCollections(), getCollections()]);
const sortedCollections = hotCollections.sort((itemA, itemB) => itemA.rank - itemB.rank);
const sortedCollections = hotCollections.sort(
(itemA, itemB) => +itemA.repo_current_period_rank - +itemB.repo_current_period_rank
);
const uniqueCollections = sortedCollections.filter((collection) => {
const relativeRankText = getPopCountText(collection.last_2nd_month_rank - collection.last_month_rank);
const relativeRankText = getRankChangeText(+collection.repo_rank_changes);
if (!collectionReposMap.has(collection.name)) {
collectionReposMap.set(collection.name, [[collection.repo_name, relativeRankText]]);
return true;
Expand Down Expand Up @@ -192,24 +203,24 @@ export const createCollectionPageMarkdown = async (collectionName: string) => {
]);

const starRankListMarkdown = starsData.map((item) => {
const rankMarkdown = ` ${item.last_period_rank}${getPopCountText(item.rank_pop)}`;
const rankMarkdown = ` ${item.current_period_rank}${getRankChangeText(+item.rank_pop)}`;
const repoMarkdown = ` [${item.repo_name}](${buildRepoLink(item.repo_name)})`;
const starsMarkdown = ` ${item.last_period_total}${getPopCountText(item.total_pop, true)}`;
return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.last_2nd_period_total} | ${item.total} |`;
const starsMarkdown = ` ${item.current_period_growth}${getPopCountText(+item.growth_pop, true)}`;
return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.past_period_growth} | ${item.total} |`;
});

const pullRankListMarkdown = pullsData.map((item) => {
const rankMarkdown = ` ${item.last_period_rank}${getPopCountText(item.rank_pop)}`;
const rankMarkdown = ` ${item.current_period_rank}${getRankChangeText(+item.rank_pop)}`;
const repoMarkdown = ` [${item.repo_name}](${buildRepoLink(item.repo_name)})`;
const starsMarkdown = ` ${item.last_period_total}${getPopCountText(item.total_pop, true)}`;
return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.last_2nd_period_total} | ${item.total} |`;
const starsMarkdown = ` ${item.current_period_growth}${getPopCountText(+item.growth_pop, true)}`;
return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.past_period_growth} | ${item.total} |`;
});

const issuesRankListMarkdown = issuesData.map((item) => {
const rankMarkdown = ` ${item.last_period_rank}${getPopCountText(item.rank_pop)}`;
const rankMarkdown = ` ${item.current_period_rank}${getRankChangeText(+item.rank_pop)}`;
const repoMarkdown = ` [${item.repo_name}](${buildRepoLink(item.repo_name)})`;
const starsMarkdown = ` ${item.last_period_total}${getPopCountText(item.total_pop, true)}`;
return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.last_2nd_period_total} | ${item.total} |`;
const starsMarkdown = ` ${item.current_period_growth}${getPopCountText(+item.growth_pop, true)}`;
return `|${rankMarkdown} |${repoMarkdown} |${starsMarkdown} | ${item.past_period_growth} | ${item.total} |`;
});

return `
Expand Down
Loading