diff --git a/scripts/documentation/in-progress.ts b/scripts/documentation/in-progress.ts deleted file mode 100644 index 01ccf60995..0000000000 --- a/scripts/documentation/in-progress.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { - htmlSelectorFormat, - pathFormat, -} from '@angular-devkit/schematics/src/formats'; -import { readJsonSync } from 'fs-extra'; -import { parseJsonSchemaToOptions } from './json-parser'; -import { createSchemaFlattener } from './schema-flattener'; - -const flattener = createSchemaFlattener([pathFormat, htmlSelectorFormat]); - -const builder = { - name: 'run-commands', - collectionName: '@nrwl/workspace', - implementation: './src/executors/run-commands/run-commands.impl', - schema: './src/executors/run-commands/schema.json', - description: 'Run any custom commands with Nx', - rawSchema: readJsonSync( - '/Users/ben/Documents/projects/nx/packages/workspace/src/executors/run-commands/schema.json' - ), - examplesFileFullPath: - '/Users/ben/Documents/projects/nx/packages/workspace/docs/run-commands-examples.md', -}; - -parseJsonSchemaToOptions(flattener, builder.rawSchema) - .then((options) => ({ - ...builder, - options, - })) - .then((data) => - console.log( - '==========================================================================================\n', - data - ) - ); diff --git a/scripts/documentation/nx-dev-docs-latest-sync.ts b/scripts/documentation/nx-dev-docs-latest-sync.ts deleted file mode 100644 index d0a2064534..0000000000 --- a/scripts/documentation/nx-dev-docs-latest-sync.ts +++ /dev/null @@ -1,72 +0,0 @@ -import * as chalk from 'chalk'; -import { execSync } from 'child_process'; -import { watch } from 'chokidar'; -import { BehaviorSubject } from 'rxjs'; -import { debounceTime, filter, switchMapTo, tap } from 'rxjs/operators'; -import * as yargs from 'yargs'; - -/** - * Available colours - */ -const { bgGreen, white } = chalk; - -const argv = yargs - .command('Usage: $0', 'Sync the public folder with the /docs folder one time') - .example( - '$0 --watch', - 'Sync the public folder with the /docs folder whenever changes are done' - ) - .option('watch', { - alias: 'w', - demandOption: false, - type: 'boolean', - description: 'Enable the watch mode', - }).argv; - -function sync(): void { - execSync( - 'rsync -avrR --delete ./docs/./ ./nx-dev/nx-dev/public/documentation' - ); -} - -function main(isWatched: boolean) { - if (isWatched) { - const isReady$ = new BehaviorSubject(false); - const syncR$ = new BehaviorSubject(null); - - /** - * If we do not debounce, the sync will happen for every file detect by the watcher - */ - isReady$ - .pipe( - filter((isReady) => isReady), - tap(() => - console.log( - bgGreen( - white( - ' => DOCS SYNC ENABLED & READY: You can modify `/docs`, changes will be synced ' - ) - ) - ) - ), - switchMapTo(syncR$), - debounceTime(1000) - ) - .subscribe(() => sync()); - - return watch('./docs', { - ignored: /(^|[\/\\])\../, // ignore dotfiles - persistent: true, - awaitWriteFinish: true, - }) - .on('ready', () => isReady$.next(true)) - .on('add', (path) => syncR$.next(path)) - .on('addDir', (path) => syncR$.next(path)) - .on('change', (path) => syncR$.next(path)) - .on('unlink', (path) => syncR$.next(path)); - } - - return sync(); -} - -main(argv.watch as boolean);