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

move to npm and setup CI #127

Merged
merged 4 commits into from
Nov 3, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Node.js CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
fail-fast: false

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm test
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

20 changes: 0 additions & 20 deletions EMBER_RELEASE.md

This file was deleted.

1 change: 0 additions & 1 deletion Procfile

This file was deleted.

27 changes: 12 additions & 15 deletions generate-local.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
import chalk from 'chalk'
import commandExists from 'command-exists'
import execa from 'execa'
import { copyFileSync, ensureDirSync, ensureFileSync, existsSync, mkdirpSync, removeSync } from 'fs-extra'
import { copyFileSync, ensureFileSync, existsSync, removeSync } from 'fs-extra'
import minimist from 'minimist'
import path from 'path'
import 'hard-rejection/register'

const docsPath = '../ember-api-docs-data';
const docsPath = '../ember-api-docs-data'

const argv = minimist(process.argv.slice(2))

const { project, version, install, build } = argv
const { project, version, install } = argv

const exit = function exit() {
console.log(...arguments)
process.exit(1)
}

const runCmd = async (cmd, path, args = []) => {
async function runCmd (cmd, path, args = []) {
console.log(chalk.underline(`Running '${chalk.green(cmd)}' in ${path}`))
const executedCmd = await execa(cmd, args, { cwd: path, shell: true, stdio: 'inherit' })

if (executedCmd.failed) {
console.error(executedCmd.stdout)
console.error(executedCmd.stderr)
process.exit(1)

}
console.log(executedCmd.stdout + '\n')
} catch (error) {
console.log(error)
if (executedCmd.failed) {
console.error(executedCmd.stdout)
console.error(executedCmd.stderr)
process.exit(1)
}

console.log(executedCmd.stdout + '\n')
}
;(async () => {

(async () => {
if (!project || !version) {
exit(
chalk.red('Both project and version args are required.\n'),
Expand Down Expand Up @@ -79,7 +76,7 @@ const runCmd = async (cmd, path, args = []) => {

let destination = `${docsPath}/s3-docs/v${version}/${project}-docs.json`
ensureFileSync(destination)
const projYuiDocFile = destination;
const projYuiDocFile = destination
removeSync(projYuiDocFile)
removeSync(`${docsPath}/json-docs/${project}/${version}`)

Expand Down
2 changes: 1 addition & 1 deletion lib/fix-borked-yuidoc-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { normalizeYuiDocClass } from './yuidoc-fixer/normalize-yui-doc-class'
* @param {*} file
*/

const docsPath = '../ember-api-docs-data';
const docsPath = '../ember-api-docs-data'

export default async function fixBorkedYuidocFiles(file) {
if (!file) {
Expand Down
2 changes: 1 addition & 1 deletion lib/read-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { dasherize } from 'inflected'
import { get as deepGet } from 'lodash'
import { getLatestPatchVersions } from './get-latest-patch-versions'

const docsPath = '../ember-api-docs-data';
const docsPath = '../ember-api-docs-data'

export default function readDocs(
projects,
Expand Down
6 changes: 3 additions & 3 deletions lib/rev-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import ora from 'ora'
import { basename as getFileName } from 'path'
import { isArray } from 'lodash/lang'
import { singularize } from 'inflected'
import path from 'path';
import path from 'path'
const glob = require('glob')

const docsPath = '../ember-api-docs-data';
const docsPath = '../ember-api-docs-data'

function revProjVersionFiles(project, ver) {
let opProgress = ora(`Revving ${project}:${ver} files`).start()
const projDocsDir = path.resolve(`${docsPath}/json-docs/${project}`)
const revIndexFolder = path.resolve(`${docsPath}/rev-index`);
const revIndexFolder = path.resolve(`${docsPath}/rev-index`)

fs.mkdirpSync(revIndexFolder)
const destination = `${revIndexFolder}/${project}-${ver}.json`
Expand Down
2 changes: 1 addition & 1 deletion lib/save-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import mkdirp from 'mkdirp'
import { pluralize } from 'inflected'
import chalk from 'chalk'

const docsPath = '../ember-api-docs-data';
const docsPath = '../ember-api-docs-data'

// updateOrCreate
export default async function saveDoc(document, projectName, version = '') {
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import saveDoc from './lib/save-document'
import revProjVersionFiles from './lib/rev-docs'
import fixBorkedYuidocFiles from './lib/fix-borked-yuidoc-files'

const docsPath = '../ember-api-docs-data';
const docsPath = '../ember-api-docs-data'

async function transformObject(doc, projectName, docVersion) {
try {
Expand Down
Loading