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

Remove the website #4369

Merged
merged 11 commits into from
Mar 23, 2023
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
92 changes: 0 additions & 92 deletions .browsersync.js

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/website.yml

This file was deleted.

30 changes: 0 additions & 30 deletions bin/prepare-web-deploy

This file was deleted.

10 changes: 0 additions & 10 deletions netlify.toml

This file was deleted.

20 changes: 3 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"packages/uppy",
"private/*",
"test/endtoend",
"website",
"e2e"
],
"devDependencies": {
Expand Down Expand Up @@ -108,6 +107,8 @@
"vue-template-compiler": "workspace:*"
},
"scripts": {
"start:companion": "bash bin/companion.sh",
"start:companion:with-loadbalancer": "e2e/start-companion-with-load-balancer.mjs",
"build:bundle": "yarn node ./bin/build-bundle.mjs",
"build:clean": "rm -rf packages/*/lib packages/@uppy/*/lib packages/*/dist packages/@uppy/*/dist",
"build:companion": "yarn workspace @uppy/companion build",
Expand All @@ -129,9 +130,6 @@
"lint": "eslint . --cache",
"release": "PACKAGES=$(yarn workspaces list --json) yarn workspace @uppy-dev/release interactive",
"size": "echo 'JS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.js | gzip | wc -c && echo 'CSS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.css | gzip | wc -c",
"start:companion": "bash bin/companion.sh",
"start:companion:with-loadbalancer": "e2e/start-companion-with-load-balancer.mjs",
"start": "npm-run-all --parallel watch start:companion web:start",
"e2e": "yarn build && yarn e2e:skip-build",
"e2e:skip-build": "npm-run-all --parallel watch:js:lib e2e:client start:companion:with-loadbalancer e2e:cypress",
"e2e:ci": "start-server-and-test 'npm-run-all --parallel e2e:client start:companion:with-loadbalancer' '1234|3020' e2e:headless",
Expand All @@ -154,19 +152,7 @@
"watch:js:bundle": "onchange 'packages/{@uppy/,}*/src/**/*.js' --initial --verbose -- yarn run build:bundle",
"watch:js:lib": "onchange 'packages/{@uppy/,}*/src/**/*.js' --initial --verbose -- yarn run build:lib",
"watch:js": "npm-run-all --parallel watch:js:bundle watch:js:lib",
"watch": "npm-run-all --parallel watch:css watch:js",
"web:build-examples": "cd website && node build-examples.js",
"web:build": "npm-run-all web:inject-bundles-misc web:generate web:build-examples web:inject-frontpagecodesample",
"web:bundle-watch-inject": "onchange 'packages/uppy/dist/**/*.css' 'packages/uppy/dist/**/*.js' --initial --verbose -- yarn run web:inject-bundles-misc",
"web:clean": "cd website && touch db.json && yarn run hexo clean",
"web:prepare-deploy": "bash ./bin/prepare-web-deploy",
"web:generate": "cd website && touch db.json && yarn run hexo generate",
"web:inject-bundles-misc": "cd website && node inject.js",
"web:inject-frontpagecodesample": "yarn run web:generate && cp -f website/public/frontpage-code-sample.html website/themes/uppy/layout/partials/frontpage-code-sample.html && touch website/themes/uppy/layout/index.ejs",
"web:start-server": "cd website && touch db.json && node inject.js && node build-examples.js && yarn run hexo server",
"web:start": "yarn run web:start-server",
"web:watch-examples": "yarn run web:bundle-watch-inject && yarn run web:watch",
"web:watch": "npm-run-all build:lib --parallel watch:css web:watch-examples web:bundle-watch-inject web:start_server"
"watch": "npm-run-all --parallel watch:css watch:js"
},
"jest": {
"automock": false,
Expand Down
62 changes: 6 additions & 56 deletions private/locale-pack/index.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
/* eslint-disable no-console, prefer-arrow-callback */
import path from 'node:path'
import fs from 'node:fs'
import { open, readFile, writeFile } from 'node:fs/promises'
import { readFile, writeFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'

import dedent from 'dedent'
import { remark } from 'remark'
import { headingRange } from 'mdast-util-heading-range'
import remarkFrontmatter from 'remark-frontmatter'

import remarkConfig from '../remark-lint-uppy/index.js'

import { getLocales, sortObjectAlphabetically } from './helpers.mjs'

const { settings: remarkSettings } = remarkConfig

const root = fileURLToPath(new URL('../../', import.meta.url))

const localesPath = path.join(root, 'packages', '@uppy', 'locales')
Expand Down Expand Up @@ -69,47 +61,6 @@ function generateTypes (pluginName, locale) {
return writeFile(localePath, localeTypes)
}

async function generateLocaleDocs (pluginName) {
const fileName = `${pluginName}.md`
const docPath = path.join(root, 'website', 'src', 'docs', fileName)
const localePath = path.join(root, 'packages', '@uppy', pluginName, 'src', 'locale.js')
const rangeOptions = { test: 'locale: {}', ignoreFinalDefinitions: true }

let docFile

try {
docFile = await open(docPath, 'r+')
} catch (err) {
console.error(
`⚠️ Could not find markdown documentation file for "${pluginName}". Make sure the plugin name matches the markdown file name.`,
)
throw err
}

const file = await remark()
.data('settings', remarkSettings)
.use(remarkFrontmatter)
.use(() => (tree) => {
// Replace all nodes after the locale heading until the next heading (or eof)
headingRange(tree, rangeOptions, (start, _, end) => [
start,
{
type: 'code',
lang: 'js',
meta: null,
value: fs.readFileSync(localePath, 'utf-8').trimEnd(),
},
end,
])
})
.process(await docFile.readFile())

const { bytesWritten } = await docFile.write(String(file), 0, 'utf-8')
await docFile.truncate(bytesWritten)

await docFile.close()
}

const [[locales, combinedLocale], fileString] = await Promise.all([
getLocalesAndCombinedLocale(),
readFile(templatePath, 'utf-8'),
Expand All @@ -118,13 +69,12 @@ const formattedLocale = JSON.stringify(combinedLocale, null, ' ')

await Promise.all([
// Populate template
writeFile(englishLocalePath, fileString.replace('en_US.strings = {}', `en_US.strings = ${formattedLocale}`))
.then(() => console.log(`✅ Generated '${englishLocalePath}'`)),
writeFile(
englishLocalePath,
fileString.replace('en_US.strings = {}', `en_US.strings = ${formattedLocale}`),
).then(() => console.log(`✅ Generated '${englishLocalePath}'`)),
// Create locale files
...Object.entries(locales).flatMap(([pluginName, locale]) => [
generateLocaleDocs(pluginName)
.then(() => console.log(`✅ Generated locale docs for ${pluginName}`)),
generateTypes(pluginName, locale)
.then(() => console.log(`✅ Generated types for ${pluginName}`)),
generateTypes(pluginName, locale).then(() => console.log(`✅ Generated types for ${pluginName}`)),
]),
])
5 changes: 1 addition & 4 deletions private/locale-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"dependencies": {
"chalk": "^5.0.0",
"dedent": "^0.7.0",
"glob": "^8.0.0",
"mdast-util-heading-range": "^3.1.0",
"remark": "^14.0.1",
"remark-frontmatter": "^4.0.1"
"glob": "^8.0.0"
}
}
21 changes: 0 additions & 21 deletions website/VUEORG_LICENSE

This file was deleted.

Loading