Skip to content

Commit efd2bc4

Browse files
committed
Merge branch 'next' into feat/outline-jump-nav
2 parents c1ff424 + 10bc1c2 commit efd2bc4

File tree

223 files changed

+8658
-6685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+8658
-6685
lines changed

.changeset/green-crabs-destroy.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 77 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# This is a basic workflow to help you get started with Actions
2-
1+
# Build Workflows for Outline.js
32
name: Outline Core Build
4-
5-
# Controls when the workflow will run
3+
# Controls when the action will run. Triggers the workflow on push or pull request
64
on:
75
# Which branches to test on push/merge.
86
push:
@@ -38,17 +36,21 @@ jobs:
3836
runs-on: ubuntu-latest
3937
strategy:
4038
matrix:
39+
# The node versions to test against.
4140
node: [ 16, 18 ]
4241
# The steps for the setup job.
4342
steps:
4443
# @see https://github.com/marketplace/actions/checkout
4544
- name: Checkout Codebase
4645
uses: actions/checkout@v3
4746

47+
# @see https://github.com/marketplace/actions/setup-node-js-environment
4848
- uses: actions/setup-node@v3
4949
with:
50+
# The node version to use.
5051
node-version: ${{ matrix.node }}
5152
cache: 'yarn'
53+
# The registry to use by default for package publishing.
5254
registry-url: 'https://npm.pkg.github.com'
5355
# Defaults to the user or organization that owns the workflow file
5456
scope: '@phase2'
@@ -74,15 +76,9 @@ jobs:
7476
env:
7577
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_PACKAGES }}
7678

77-
- name: Build Outline
78-
run: yarn build --force
79-
80-
- name: Build Storybook
81-
run: yarn storybook:build
82-
8379
# Job to run build, and basic assurances the codebase is ready for additional processing.
84-
build:
85-
name: Build Codebase
80+
build_outline:
81+
name: Build Outline Codebase
8682
runs-on: ubuntu-latest
8783
needs: ['setup']
8884
strategy:
@@ -121,6 +117,54 @@ jobs:
121117
- name: Build Storybook
122118
run: yarn storybook:build
123119

120+
# Test initialization of a new project
121+
build_project:
122+
name: Initialize and Test Build of Project Codebase
123+
runs-on: ubuntu-latest
124+
needs: ['build_outline']
125+
strategy:
126+
matrix:
127+
node: [ 16, 18 ]
128+
# The steps for the setup job.
129+
steps:
130+
# @see https://github.com/marketplace/actions/checkout
131+
- name: Checkout Codebase
132+
uses: actions/checkout@v3
133+
134+
- uses: actions/setup-node@v3
135+
with:
136+
node-version: ${{ matrix.node }}
137+
cache: 'yarn'
138+
139+
# @see https://github.com/marketplace/actions/cache
140+
# node_modules caching is validated by always running yarn install.
141+
# Turborepo cache lives inside node_modules/.cache/turbo
142+
- uses: actions/cache@v3
143+
id: yarn-cache
144+
with:
145+
path: |
146+
node_modules
147+
storybook-static
148+
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
149+
restore-keys: |
150+
${{ runner.os }}-node-${{ matrix.node }}-yarn-
151+
152+
- name: Install
153+
run: yarn install --prefer-offline
154+
155+
- name: Build from cache
156+
run: yarn build
157+
158+
- name: Generate a project
159+
run: |
160+
PROJDIR=$(mktemp -d)
161+
cd $PROJDIR
162+
npx ${{ github.workspace }}/packages/outline-cli init -a -l -s prj
163+
cd prj
164+
yarn install --prefer-offline
165+
yarn build
166+
yarn storybook:build
167+
124168
# Job to run package publishing process.
125169
test:
126170
name: Test Codebase
@@ -173,13 +217,13 @@ jobs:
173217
name: "Publish: GitHub Pages"
174218
if: github.ref == 'refs/heads/next'
175219
runs-on: ubuntu-latest
176-
needs: ['setup', 'build', 'test']
220+
needs: ['setup', 'build_outline', 'test']
177221

178222
# The steps for the setup job.
179223
steps:
180224
# @see https://github.com/marketplace/actions/checkout
181225
- name: Checkout codebase
182-
uses: actions/checkout@v2
226+
uses: actions/checkout@v3
183227

184228
- uses: actions/setup-node@v3
185229
with:
@@ -195,9 +239,9 @@ jobs:
195239
path: |
196240
node_modules
197241
storybook-static
198-
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}
242+
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
199243
restore-keys: |
200-
${{ runner.os }}-node-16-yarn-
244+
${{ runner.os }}-node-${{ matrix.node }}-yarn-
201245
202246
- name: Install
203247
run: yarn install --prefer-offline
@@ -215,18 +259,20 @@ jobs:
215259

216260
- name: Deploy to GitHub Pages
217261
if: success()
218-
uses: crazy-max/ghaction-github-pages@v2
262+
uses: crazy-max/ghaction-github-pages@v3
219263
with:
220264
target_branch: gh-pages
221265
build_dir: storybook-static
222266
commit_message: 'chore(deploy): Storybook'
223-
keep_history: true
267+
keep_history: false
268+
jekyll: false
269+
fqdn: outline.phase2tech.com
224270
env:
225271
GITHUB_TOKEN: ${{ secrets.NPM_GITHUB_PACKAGES }}
226272

227273
# @see https://github.com/marketplace/actions/upload-a-build-artifact
228274
- name: Upload Storybook artifact
229-
uses: actions/upload-artifact@v2
275+
uses: actions/upload-artifact@v3
230276
with:
231277
name: storybook-latest
232278
path: storybook-static/
@@ -238,7 +284,7 @@ jobs:
238284
name: "Publish: GitHub Packages"
239285
runs-on: ubuntu-latest
240286
if: github.ref == 'refs/heads/release'
241-
needs: ['setup', 'build', 'test']
287+
needs: ['setup', 'build_outline', 'test']
242288

243289
# The steps for the build job.
244290
steps:
@@ -263,9 +309,9 @@ jobs:
263309
path: |
264310
node_modules
265311
storybook-static
266-
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}
312+
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
267313
restore-keys: |
268-
${{ runner.os }}-node-16-yarn-
314+
${{ runner.os }}-node-${{ matrix.node }}-yarn-
269315
270316
- name: Install
271317
run: yarn install --prefer-offline
@@ -283,14 +329,14 @@ jobs:
283329
if: steps.changesets.outputs.hasChangesets == 'false'
284330
# You can do something when a publish should happen.
285331
run: yarn changeset publish
286-
332+
287333
# Job to run package publishing process.
288334
# This should ONLY be ran on on branches where
289335
deploy-npm-packages:
290336
name: "Publish: NPM Packages"
291337
runs-on: ubuntu-latest
292-
if: github.ref == 'refs/heads/next'
293-
needs: ['setup', 'build', 'test']
338+
if: github.ref == 'refs/heads/release'
339+
needs: ['setup', 'build_outline', 'test']
294340

295341
# The steps for the build job.
296342
steps:
@@ -315,9 +361,9 @@ jobs:
315361
path: |
316362
node_modules
317363
storybook-static
318-
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}
364+
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
319365
restore-keys: |
320-
${{ runner.os }}-node-16-yarn-
366+
${{ runner.os }}-node-${{ matrix.node }}-yarn-
321367
322368
- name: Install
323369
run: yarn install --prefer-offline
@@ -339,12 +385,12 @@ jobs:
339385
chromatic-deployment:
340386
name: "Publish: Chromatic"
341387
runs-on: ubuntu-latest
342-
needs: ['setup', 'build', 'test']
388+
needs: ['setup', 'build_outline', 'test']
343389

344390
steps:
345391
# @see https://github.com/marketplace/actions/checkout
346392
- name: Checkout codebase
347-
uses: actions/checkout@v2
393+
uses: actions/checkout@v3
348394
with:
349395
fetch-depth: 0 # 👈 Required to retrieve git history
350396

@@ -362,9 +408,9 @@ jobs:
362408
path: |
363409
node_modules
364410
storybook-static
365-
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}
411+
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
366412
restore-keys: |
367-
${{ runner.os }}-node-16-yarn-
413+
${{ runner.os }}-node-${{ matrix.node }}-yarn-
368414
369415
- name: Install
370416
run: yarn install --prefer-offline

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}

.huskyrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "lint-staged",
4+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
5+
}
6+
}

.prettierignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ resolved-tailwind-config.ts
1111
packages/outline-storybook/config/storybook.main.css
1212
src/components.d.ts
1313
*.md
14+
*.mdx
1415
.history/
1516
package-lock.json
1617
docs/
1718
.gitlab-ci.yml
1819
.gitlab-ci/*
1920
*.lit.ts
20-
*.stories.mdx
21-
*.stories.ts
22-
*.stories.js
2321
.github/
2422
.octane-ci/
2523
.bin/
@@ -29,3 +27,4 @@ project/
2927
outline.theme.css
3028
**/vars-*.css
3129
*.d.ts
30+
*.global.scoped.css

.prettierrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"singleQuote": true,
99
"tabWidth": 2,
1010
"trailingComma": "es5",
11-
"useTabs": false
11+
"useTabs": false,
12+
"embeddedLanguageFormatting": "off"
1213
}

.storybook/main.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
module.exports = {
2-
stories: ['../packages/outline-storybook/stories/**/*.stories.@(js|ts)'],
2+
stories: [
3+
// Intentionally ordering welcome page first.
4+
'../packages/outline-docs/src/guides/welcome.mdx',
5+
// Component development guides.
6+
'../packages/outline-docs/src/guides/development/component-development/**/*.mdx',
7+
// Component usage guides.
8+
'../packages/outline-docs/src/guides/consumers/**/*.mdx',
9+
// QA/UAT usage guides.
10+
'../packages/outline-docs/src/guides/qa-uat/**/*.mdx',
11+
// Tooling usage guides.
12+
'../packages/outline-docs/src/guides/tooling/**/*.mdx',
13+
// Documentation stories.
14+
'../packages/outline-docs/src/guides/**/*.stories.@(js|ts|mdx)',
15+
// Component stories.
16+
'../packages/outline-storybook/stories/**/*.stories.@(js|ts|mdx)',
17+
],
318
typescript: {
419
check: false,
520
checkOptions: {},
621
},
7-
822
addons: [
923
{
1024
name: '@storybook/addon-essentials',
1125
},
1226
],
13-
1427
features: {
1528
storyStoreV7: true,
1629
postcss: false,
@@ -22,7 +35,7 @@ module.exports = {
2235
options: {},
2336
},
2437
docs: {
25-
docsPage: 'automatic',
26-
defaultName: 'Full Documentation', // set to change the name of generated docs entries
38+
autodocs: true,
39+
defaultName: 'Documentation', // set to change the name of generated docs entries
2740
},
2841
};

.storybook/manager.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

.storybook/preview.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import './storybook-styles.css';
2-
// Registers and enables scss language support
32

43
export const parameters = {
54
actions: {
@@ -11,7 +10,6 @@ export const parameters = {
1110
options: {
1211
storySort: {
1312
order: [
14-
'Outline',
1513
'Getting Started',
1614
'Documentation',
1715
'Design Tokens',

.storybook/storybook-styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ body {
5353
.sbdocs .sbdocs-content {
5454
max-width: 1600px;
5555
}
56+
57+
.docblock-source {
58+
margin: 0 !important;
59+
}

0 commit comments

Comments
 (0)