Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed May 25, 2024
1 parent 6bb25b4 commit c640e13
Show file tree
Hide file tree
Showing 278 changed files with 5,825 additions and 4,213 deletions.
2 changes: 1 addition & 1 deletion packages/aws/cloudfront/src/api/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAmzRequestFn } from '@saus/aws-utils'
import { CloudFront } from './types'
import { CloudFront } from './types.js'

export const signedRequest = (region: string) =>
createAmzRequestFn<{
Expand Down
2 changes: 1 addition & 1 deletion packages/aws/cloudfront/src/createInvalidation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { xml } from '@saus/aws-utils'
import { joinUrl } from 'saus/utils/joinUrl'
import { signedRequest } from './api/request'
import { signedRequest } from './api/request.js'

export function createInvalidation(region: string) {
return signedRequest(region).action('CreateInvalidation', {
Expand Down
8 changes: 4 additions & 4 deletions packages/aws/s3-website/src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { OutputBundle } from 'saus'
import { addSecrets, getDeployContext, onDeploy } from 'saus/deploy'
import { normalizeHeaderKeys } from 'saus/http'
import { mergeArrays } from 'saus/utils/array'
import { WebsiteConfig } from './config'
import secrets from './secrets'
import { syncStaticFiles } from './sync'
import { varyByDevice } from './varyByDevice'
import { WebsiteConfig } from './config.js'
import secrets from './secrets.js'
import { syncStaticFiles } from './sync.js'
import { varyByDevice } from './varyByDevice.js'

addSecrets(deployWebsiteToS3, secrets)
addSecrets(deployWebsiteToS3, [useCloudFormation])
Expand Down
4 changes: 2 additions & 2 deletions packages/aws/s3-website/src/runtime/emptyPageStore.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createInvalidation } from '@saus/aws-cloudfront'
import { emptyBucket } from '@saus/aws-s3'
import secrets from '../secrets'
import { PurgeProps } from './types'
import secrets from '../secrets.js'
import { PurgeProps } from './types.js'

/**
* Delete all assets from the "PageStore" bucket.
Expand Down
4 changes: 2 additions & 2 deletions packages/aws/s3-website/src/runtime/purgePageStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PurgePlugin } from 'saus'
import { emptyPageStore } from './emptyPageStore'
import { PurgeProps } from './types'
import { emptyPageStore } from './emptyPageStore.js'
import { PurgeProps } from './types.js'

export function purgePageStore(props: PurgeProps): PurgePlugin {
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/aws/s3-website/src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { DeployContext } from 'saus/deploy'
import { wrapBody } from 'saus/http'
import { murmurHash } from 'saus/utils/murmur3'
import { plural } from 'saus/utils/plural'
import { WebsiteConfig } from './config'
import secrets from './secrets'
import { WebsiteConfig } from './config.js'
import secrets from './secrets.js'

type AssetList = string[]
type ContentHash = number
Expand Down
2 changes: 1 addition & 1 deletion packages/aws/s3-website/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CommonRequestHeaders } from 'saus/http'
import { UserDeviceType } from './varyByDevice'
import { UserDeviceType } from './varyByDevice.js'

export interface BrotliConfig {
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/aws/s3/src/api/headers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pick, pickAllExcept } from '../utils/pick'
import { commonParamKeys } from './params'
import { pick, pickAllExcept } from '../utils/pick.js'
import { commonParamKeys } from './params.js'

/**
* Convert pascal-cased API params into HTTP headers. \
Expand Down
2 changes: 1 addition & 1 deletion packages/aws/s3/src/api/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAmzRequestFn } from '@saus/aws-utils'
import { S3 } from './types'
import { S3 } from './types.js'

export const signedRequest = (region: string) =>
createAmzRequestFn<{
Expand Down
6 changes: 3 additions & 3 deletions packages/aws/s3/src/copyObject.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { parseXmlResponse } from '@saus/aws-utils'
import { controlExecution } from 'saus/utils/controlExecution'
import { paramsToHeaders } from './api/headers'
import { signedRequest } from './api/request'
import { writeThrottler } from './utils/throttle'
import { paramsToHeaders } from './api/headers.js'
import { signedRequest } from './api/request.js'
import { writeThrottler } from './utils/throttle.js'

export function copyObject(region: string) {
return controlExecution(
Expand Down
10 changes: 5 additions & 5 deletions packages/aws/s3/src/deleteObjects.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { parseXmlResponse, xml } from '@saus/aws-utils'
import * as crypto from 'crypto'
import { controlExecution } from 'saus/utils/controlExecution'
import { formatAmzHeaders } from './api/headers'
import { commonParamKeys } from './api/params'
import { signedRequest } from './api/request'
import { pickAllExcept } from './utils/pick'
import { writeThrottler } from './utils/throttle'
import { formatAmzHeaders } from './api/headers.js'
import { commonParamKeys } from './api/params.js'
import { signedRequest } from './api/request.js'
import { pickAllExcept } from './utils/pick.js'
import { writeThrottler } from './utils/throttle.js'

export function deleteObjects(region: string) {
return controlExecution(
Expand Down
4 changes: 2 additions & 2 deletions packages/aws/s3/src/emptyBucket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AmzRequestOptions } from '@saus/aws-utils'
import { deleteObjects } from './deleteObjects'
import { listObjects } from './listObjects'
import { deleteObjects } from './deleteObjects.js'
import { listObjects } from './listObjects.js'

export function emptyBucket(region: string) {
return async (bucket: string, opts?: AmzRequestOptions) => {
Expand Down
10 changes: 5 additions & 5 deletions packages/aws/s3/src/listObjects.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { parseXmlResponse } from '@saus/aws-utils'
import { formatAmzHeaders, formatHeaders } from './api/headers'
import { commonParamKeys } from './api/params'
import { signedRequest } from './api/request'
import { S3 } from './api/types'
import { pickAllExcept } from './utils/pick'
import { formatAmzHeaders, formatHeaders } from './api/headers.js'
import { commonParamKeys } from './api/params.js'
import { signedRequest } from './api/request.js'
import { S3 } from './api/types.js'
import { pickAllExcept } from './utils/pick.js'

export function listObjects(region: string) {
return signedRequest(region).action('ListObjects', {
Expand Down
4 changes: 2 additions & 2 deletions packages/aws/s3/src/moveObjects.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AmzCredentials } from '@saus/aws-utils'
import { copyObject } from './copyObject'
import { deleteObjects } from './deleteObjects'
import { copyObject } from './copyObject.js'
import { deleteObjects } from './deleteObjects.js'

interface Options {
keys: string[]
Expand Down
6 changes: 3 additions & 3 deletions packages/aws/s3/src/putObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { createHash } from 'crypto'
import * as mime from 'mrmime'
import { unwrapBody } from 'saus/http'
import { controlExecution } from 'saus/utils/controlExecution'
import { paramsToHeaders } from './api/headers'
import { signedRequest } from './api/request'
import { writeThrottler } from './utils/throttle'
import { paramsToHeaders } from './api/headers.js'
import { signedRequest } from './api/request.js'
import { writeThrottler } from './utils/throttle.js'

/**
* Upload an object to a S3 bucket.
Expand Down
4 changes: 2 additions & 2 deletions packages/aws/s3/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { deployedEnv } from 'saus'
import { AssetStore } from 'saus/core'
import { wrapBody } from 'saus/http'
import { defer, Deferred } from 'saus/utils/defer'
import { deleteObjects } from './deleteObjects'
import { putObject } from './putObject'
import { deleteObjects } from './deleteObjects.js'
import { putObject } from './putObject.js'

export function createStore(bucket: string, region: string): AssetStore {
const deleteQueue: string[] = []
Expand Down
6 changes: 3 additions & 3 deletions packages/aws/utils/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
normalizeObjectResponse,
parseXmlResponse,
} from './response'
import { CamelCasedPropertiesDeep } from './types'
import { camelize, pascalize } from './utils'
import { XmlParserOptions } from './xml/parse'
import { CamelCasedPropertiesDeep } from './types.js'
import { camelize, pascalize } from './utils.js'
import { XmlParserOptions } from './xml/parse.js'

interface ActionMap {
[name: string]: { params: object; result: any }
Expand Down
6 changes: 3 additions & 3 deletions packages/aws/utils/src/response.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Http } from 'saus/http'
import { rewriteObjectKeys } from 'saus/utils/keys'
import { camelize } from './utils'
import { xml } from './xml'
import { XmlParserOptions } from './xml/parse'
import { camelize } from './utils.js'
import { xml } from './xml.js'
import { XmlParserOptions } from './xml/parse.js'

const xmlOptionsMap = new WeakMap<Http.Response, XmlParserOptions>()
const xmlParsedMap = new WeakMap<XmlParserOptions, any>()
Expand Down
2 changes: 1 addition & 1 deletion packages/aws/utils/src/xml.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { escape } from 'saus/utils/escape'
import { isObject } from 'saus/utils/isObject'
import { parseXML } from './xml/parse'
import { parseXML } from './xml/parse.js'

export interface XmlDocument {
/** Add a self-closing tag. */
Expand Down
2 changes: 1 addition & 1 deletion packages/aws/utils/src/xml/parse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { unescape } from './unescape'
import { unescape } from './unescape.js'

export interface XmlParserOptions {
arrayTags?: string[]
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/dns/src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { createRequestFn, secrets } from '@saus/cloudflare-request'
import { defineDeployHook } from 'saus/deploy'
import { diffObjects } from 'saus/utils/diffObjects'
import { pick } from 'saus/utils/pick'
import { DnsRecord, DnsRecordList } from './types'
import { toTable } from './utils'
import { DnsRecord, DnsRecordList } from './types.js'
import { toTable } from './utils.js'

export interface DnsRecordsTarget {
zoneId: string
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/dns/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { secrets } from '@saus/cloudflare-request'
import { addDeployHook, addDeployTarget, addSecrets } from 'saus/deploy'
import { DnsRecordList } from './types'
import { DnsRecordList } from './types.js'

const hook = addDeployHook(() => import('./hook.js'))
const hook = addDeployHook(() => import('./hook.js.js'))
addSecrets(useCloudflareDNS, secrets)

export function useCloudflareDNS(zoneId: string, records: DnsRecordList) {
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/page-rules/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import { addDeployHook, addDeployTarget, addSecrets } from 'saus/deploy'
// import secrets from './secrets'
// import secrets from './secrets.js'

// const hook = addDeployHook(() => import('./hook'))
// const hook = addDeployHook(() => import('./hook.js'))
// addSecrets(useCloudflarePageRules, secrets)

// export function useCloudflarePageRules() {
Expand Down
8 changes: 4 additions & 4 deletions packages/cloudform/src/api/describeStack.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import createDebug from 'debug'
import { dset } from 'dset'
import secrets from '../secrets'
import { Stack } from '../types'
import { describeStackEvents } from './describeStackEvents'
import { signedRequest } from './request'
import secrets from '../secrets.js'
import { Stack } from '../types.js'
import { describeStackEvents } from './describeStackEvents.js'
import { signedRequest } from './request.js'

export interface DescribedStack {
id?: string
Expand Down
6 changes: 3 additions & 3 deletions packages/cloudform/src/api/describeStackEvents.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import secrets from '../secrets'
import { Stack } from '../types'
import { signedRequest } from './request'
import secrets from '../secrets.js'
import { Stack } from '../types.js'
import { signedRequest } from './request.js'

export async function describeStackEvents(stack: Stack) {
if (!stack.id) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudform/src/api/request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAmzRequestFn } from '@saus/aws-utils'
import { CloudFormation } from './types'
import { CloudFormation } from './types.js'

export const signedRequest = createAmzRequestFn<{
CreateStack: {
Expand Down
10 changes: 5 additions & 5 deletions packages/cloudform/src/hook.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineDeployHook } from 'saus/deploy'
import { describeStack } from './api/describeStack'
import { describeStackEvents } from './api/describeStackEvents'
import { signedRequest } from './api/request'
import secrets from './secrets'
import { Stack } from './types'
import { describeStack } from './api/describeStack.js'
import { describeStackEvents } from './api/describeStackEvents.js'
import { signedRequest } from './api/request.js'
import secrets from './secrets.js'
import { Stack } from './types.js'

export default defineDeployHook(ctx => ({
name: '@saus/cloudform',
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudform/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getDeployContext,
} from 'saus/deploy'
import { isObject } from 'saus/utils/isObject'
import secrets from './secrets'
import secrets from './secrets.js'
import {
AttributeRef,
ResourceBase,
Expand All @@ -15,7 +15,7 @@ import {
StackTemplate,
} from './types'

const hook = addDeployHook(() => import('./hook'))
const hook = addDeployHook(() => import('./hook.js'))
addSecrets(useCloudFormation, secrets)

export type StackOptions<Outputs extends object | void = any> = {
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudimage/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PartialDeep } from 'type-fest'
import { Payload } from './types/payload'
import { Payload } from './types/payload.js'

export const configToPayload = (config: Config): PartialDeep<Payload.Data> => ({
originPrefix: {
Expand Down
12 changes: 6 additions & 6 deletions packages/cloudimage/src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { defineDeployHook } from 'saus/deploy'
import { http } from 'saus/http'
import { rewriteKeys } from 'saus/utils/keys'
import { murmurHash } from 'saus/utils/murmur3'
import { Config, configToPayload } from './config'
import secrets from './secrets'
import { snakeCase } from './snakeCase'
import { LoginResponse } from './types/login'
import { Payload } from './types/payload'
import { SessionResponse } from './types/session'
import { Config, configToPayload } from './config.js'
import secrets from './secrets.js'
import { snakeCase } from './snakeCase.js'
import { LoginResponse } from './types/login.js'
import { Payload } from './types/payload.js'
import { SessionResponse } from './types/session.js'

export default defineDeployHook(ctx => {
let auth: Auth
Expand Down
6 changes: 3 additions & 3 deletions packages/cloudimage/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { addDeployHook, addDeployTarget, addSecrets } from 'saus/deploy'
import { Config } from './config'
import secrets from './secrets'
import { Config } from './config.js'
import secrets from './secrets.js'

const hook = addDeployHook(() => import('./hook.js'))
const hook = addDeployHook(() => import('./hook.js.js'))
addSecrets(useCloudimage, secrets)

export function useCloudimage(config: Config) {
Expand Down
4 changes: 2 additions & 2 deletions packages/git-push/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import path from 'path'
import { onDeploy } from 'saus/deploy'
import { bindExec } from 'saus/node/bindExec'
import { relativeToCwd } from 'saus/node/relativeToCwd'
import { GitRepository, InitConfig } from './config'
import { stashedRoots } from './stash'
import { GitRepository, InitConfig } from './config.js'
import { stashedRoots } from './stash.js'

/**
* Call this before producing any build artifacts
Expand Down
4 changes: 2 additions & 2 deletions packages/git-push/src/push-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { defineDeployHook } from 'saus/deploy'
import { bindExec } from 'saus/node/bindExec'
import { createCommit } from 'saus/node/git/createCommit'
import { relativeToCwd } from 'saus/node/relativeToCwd'
import { PushConfig } from './config'
import { stashedRoots } from './stash'
import { PushConfig } from './config.js'
import { stashedRoots } from './stash.js'

export default defineDeployHook(ctx => {
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/git-push/src/push.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { addDeployHook, addDeployTarget } from 'saus/deploy'
import { PushConfig } from './config'
import { PushConfig } from './config.js'

const hook = addDeployHook(() => import('./push-hook.js'))
const hook = addDeployHook(() => import('./push-hook.js.js'))

/**
* Push a local clone to its origin.
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as ReactDOM from 'react-dom/server'
import { defineLayoutRenderer } from 'saus/core'
import './stack'
import './stack.js'

export const defineLayout = defineLayoutRenderer({
hydrator: '@saus/react/hydrator',
Expand Down
4 changes: 2 additions & 2 deletions packages/vercel/src/functions/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import fs from 'fs'
import path from 'path'
import { crawl } from 'recrawl-sync'
import { esbuild, esbuildViteBridge } from 'saus/core'
import { defineDeployHook, DeployContext, getDeployContext } from 'saus/deploy'
import { DeployContext, defineDeployHook, getDeployContext } from 'saus/deploy'
import { bindExec } from 'saus/node/bindExec'
import { emptyDir } from 'saus/node/emptyDir'
import { toObjectHash } from 'saus/utils/objectHash'
import { plural } from 'saus/utils/plural'
import { Props } from './types'
import { Props } from './types.js'

interface Target extends Props {
entries: string[]
Expand Down
Loading

0 comments on commit c640e13

Please sign in to comment.