1
0
mirror of synced 2025-12-25 02:17:36 -05:00

make lib/rest/index.js callable (#23214)

* Experiment with making the tarball smaller

Part of #1248

* try this

* stop debugging

* delete translations too

* delete heavy search indexes too

* push and popd

* try this hack

* delete but leave directory

* debug more

* faster delete of translations

* less loud

* async await

* async await

* no tree

* simplify

* experimenting more

* unfinished

* only the large files

* change order

* brotli with level 6

* cope better with decorated rest json files

* tidying

* keep images

* cleaning

* cleaning up

* refactored function

* try this

* better comment

* remove console logging

* more important changes

* make lib/rest/index.js callable

Part of #1177

* memoize

* remove console logging
This commit is contained in:
Peter Bengtsson
2021-12-07 08:21:23 -05:00
committed by GitHub
parent 9bfb1eba97
commit 9a7a8a761e
4 changed files with 82 additions and 64 deletions

View File

@@ -4,7 +4,7 @@ import fs from 'fs/promises'
import { difference, isPlainObject } from 'lodash-es'
import { getJSON } from '../helpers/supertest.js'
import enterpriseServerReleases from '../../lib/enterprise-server-releases.js'
import rest from '../../lib/rest/index.js'
import getRest from '../../lib/rest/index.js'
import { jest } from '@jest/globals'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -20,7 +20,7 @@ describe('REST references docs', () => {
jest.setTimeout(3 * 60 * 1000)
test('markdown file exists for every operationId prefix in the api.github.com schema', async () => {
const { categories } = rest
const { categories } = await getRest()
const referenceDir = path.join(__dirname, '../../content/rest/reference')
const filenames = (await fs.readdir(referenceDir))
.filter(
@@ -61,7 +61,7 @@ describe('REST references docs', () => {
})
test('no wrongly detected AppleScript syntax highlighting in schema data', async () => {
const { operations } = rest
const { operations } = await getRest()
expect(JSON.stringify(operations).includes('hljs language-applescript')).toBe(false)
})
})