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

style: format using prettier #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 29 additions & 33 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.0/containers/hugo
{
"name": "Hugo (Community)",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update VARIANT to pick hugo variant.
// Example variants: hugo, hugo_extended
// Rebuild the container if it already exists to update.
"VARIANT": "hugo_extended",
// Update VERSION to pick a specific hugo version.
// Example versions: latest, 0.73.0, 0,71.1
// Rebuild the container if it already exists to update.
"VERSION": "latest",
// Update NODE_VERSION to pick the Node.js version: 12, 14
"NODE_VERSION": "14",
}
},
"name": "Hugo (Community)",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update VARIANT to pick hugo variant.
// Example variants: hugo, hugo_extended
// Rebuild the container if it already exists to update.
"VARIANT": "hugo_extended",
// Update VERSION to pick a specific hugo version.
// Example versions: latest, 0.73.0, 0,71.1
// Rebuild the container if it already exists to update.
"VERSION": "latest",
// Update NODE_VERSION to pick the Node.js version: 12, 14
"NODE_VERSION": "14"
}
},

// Set *default* container specific settings.json values on container create.
"settings": {
"html.format.templating": true,
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"davidanson.vscode-markdownlint"
],
// Set *default* container specific settings.json values on container create.
"settings": {
"html.format.templating": true
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
1313
],
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["davidanson.vscode-markdownlint"],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [1313],

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}
62 changes: 31 additions & 31 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: github-pages

on:
workflow_dispatch: {}
schedule:
# Run Mondays at 3:00 am (15 minutes after Update data)
# Ideally, this shouldn't need a schedule at all, but
# workflows (like Update data) can't trigger other workflows.
- cron: "00 3 * * 1"
push:
branches:
- main
workflow_dispatch: {}
schedule:
# Run Mondays at 3:00 am (15 minutes after Update data)
# Ideally, this shouldn't need a schedule at all, but
# workflows (like Update data) can't trigger other workflows.
- cron: "00 3 * * 1"
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0

- name: setup hugo
uses: peaceiris/actions-hugo@2e89aa66d0093e4cd14751b3028fc1a179452c2e # v2.4.13
with:
hugo-version: '0.78.0'
extended: true
- name: setup hugo
uses: peaceiris/actions-hugo@2e89aa66d0093e4cd14751b3028fc1a179452c2e # v2.4.13
with:
hugo-version: "0.78.0"
extended: true

- name: build
run: hugo
- name: build
run: hugo

- name: deploy
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: twitter-service
user_email: <[email protected]>
publish_dir: ./public
cname: opensource.twitter.dev
- name: deploy
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: twitter-service
user_email: <[email protected]>
publish_dir: ./public
cname: opensource.twitter.dev
14 changes: 7 additions & 7 deletions .github/workflows/repolinter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: repolinter
on: [push, pull_request]

jobs:
repolinter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: todogroup/repolinter-action@v1
with:
config_file: .github/repolinter.yaml
repolinter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: todogroup/repolinter-action@v1
with:
config_file: .github/repolinter.yaml
67 changes: 33 additions & 34 deletions .github/workflows/update-data.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
name: Update data

on:
workflow_dispatch: {}
schedule:
# Run Mondays at 2:45 am
- cron: "45 2 * * 1"
workflow_dispatch: {}
schedule:
# Run Mondays at 2:45 am
- cron: "45 2 * * 1"

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# update stats
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: pip install -r requirements.txt
# update stats
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: pip install -r requirements.txt
# Eventually call scripts/fetch_augur_metrics.py and
# scripts/fetch_year_in_review.py as well when possible
- run: python scripts/fetch_projects.py
env:
OAUTH_TOKEN: ${{ secrets.GH_API_TOKEN }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}

# Eventually call scripts/fetch_augur_metrics.py and
# scripts/fetch_year_in_review.py as well when possible
- run: python scripts/fetch_projects.py
env:
OAUTH_TOKEN: ${{ secrets.GH_API_TOKEN }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}

- run: |
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
git add -A
timestamp=$(date -u)
git commit -m "update data: ${timestamp}" || exit 0
git push
- run: |
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
git add -A
timestamp=$(date -u)
git commit -m "update data: ${timestamp}" || exit 0
git push
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "shell",
"command": "hugo serve",
"group": "build",
"isBackground": true,
"isBackground": true
}
]
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

This is the Twitter Open Source website at https://opensource.twitter.dev.

This site is built with [hugo], using a custom built-in theme. Follow the
standard instructions on the hugo website to [install] and [run] hugo. Just
This site is built with [hugo], using a custom built-in theme. Follow the
standard instructions on the hugo website to [install] and [run] hugo. Just
make sure to use hugo-extended, which has added support for Sass/SCSS
stylesheets.

Expand Down
9 changes: 4 additions & 5 deletions assets/css/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Stylesheets
===========
# Stylesheets

`_feather-*` files are part of the internal Feather framework used at Twitter.
They should not be edited directly, since they will be overwritten the next time
the components are upgraded. Instead, any overrides that are needed should be
the components are upgraded. Instead, any overrides that are needed should be
added to `_feather-custom.scss`.

Tweeps can get the latest feather resources at http://go/feathercode.
Specifically, we use:

- http://go/featherraw/feather-core/dist/css/feather-core.css
- http://go/featherraw/feather-component-button/dist/css/feather-component-button.css
- http://go/featherraw/feather-core/dist/css/feather-core.css
- http://go/featherraw/feather-component-button/dist/css/feather-component-button.css
Loading