Skip to content

Commit

Permalink
reorg repo (#18)
Browse files Browse the repository at this point in the history
* reorg repo

* fix build
  • Loading branch information
fearthecowboy authored Jun 11, 2018
1 parent 281049b commit ea6eb52
Show file tree
Hide file tree
Showing 245 changed files with 14,573 additions and 5,964 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,9 @@ __pycache__/
dist/*
node_modules/*
package-lock.json
generated/*
generated/*
resources/obj/*
resources/bin/*
*.tgz
package/*

7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!dist/**/*
test/
src/
dist/test/
package/
.npmignore
Expand All @@ -8,4 +8,7 @@ tsconfig.json
!*.d.ts
*.tgz
.vscode
.scripts
.scripts
attic/
generated/
notes.md
13 changes: 11 additions & 2 deletions .scripts/fix-aliased-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function fixImports(filePath) {
const sourcePath = path.dirname(filePath);
const targetPath = path.dirname(path.resolve(importOptions.outDir + '/' + importOptions.baseUrl + '/' + importOptions.paths[tscpath]))
const relativePath = path.relative(sourcePath, targetPath).replace(/\\/g,"/");
return `require("./${relativePath}/`.replace(`"./..`,`"..`); // fix messy parent referential path.
return `require("./${relativePath}/`.replace(`"./..`,`"..`).replace("../src/","../"); // fix messy parent referential path.
});
}
if( write ) {
Expand Down Expand Up @@ -44,4 +44,13 @@ function processDirectory(dir){
}
}

processDirectory(`${__dirname}/../dist`);
processDirectory(`${__dirname}/../dist`);

// fix weird issue with namespace class and importing stuff
let namespc = fs.readFileSync(`${__dirname}/../dist/csharp/code-dom/namespace.js`,"utf8");
const c = namespc.indexOf('const interface_1 = require("./interface");');
if( c > 0 ) {
namespc = namespc.replace( 'const interface_1 = require("./interface");', '');
namespc = namespc.replace(/interface_1\./gi,'require("./interface").');
}
fs.writeFileSync(`${__dirname}/../dist/csharp/code-dom/namespace.js`, namespc);
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"node_modules/**": true,
"dist/**": true,
"generated/**": true,
"generated": true,
"ps-generated/**": true,
"generated2/**": true,
"**/node_modules/**": true,
"**/*.js.map": true,
"**/*.js": {
Expand All @@ -16,7 +19,9 @@
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true
"**/.DS_Store": true,
"**/obj/**": true,
"**/bin/**": true
},
"[typescript]": {
"editor.formatOnSave": true,
Expand All @@ -30,5 +35,11 @@
"editor.tabSize": 2,
"editor.detectIndentation": false
},
"[csharp]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabSize": 4,
"editor.detectIndentation": false
},
"typescript.tsdk": "node_modules\\typescript\\lib"
}
77 changes: 31 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ contact [[email protected]](mailto:[email protected]) with any additio
AutoRest needs the below config to pick this up as a plug-in - see https://github.com/Azure/autorest/blob/master/docs/developer/architecture/AutoRest-extension.md






#### LLC#

``` yaml $(llcsharp)
Expand Down Expand Up @@ -64,42 +60,10 @@ output-artifact:

```

#### LLIA

#### IA


#### PowerShell

``` yaml $(powershell)
enable-remodeler: true

pipeline:
powershell/hlnameinferrer:
scope: powershell
input: tweakcodemodel
output-artifact: code-model-v2

powershell/emitter:
input: hlnameinferrer
scope: scope-powershell/emitter

scope-powershell/emitter:
input-artifact: code-model-v2
is-object: true
output-uri-expr: |
"code-model-v2-post-hlnameinferrer"
output-artifact: code-model-v2.yaml


```
#### Remodeler

``` yaml $(enable-remodeler)

pipeline:
remodeler:
input: openapi-document/identity
Expand All @@ -122,29 +86,47 @@ scope-remodeler/emitter:

```

``` yaml $(grr)

#### PowerShell


``` yaml $(powershell)
api-folder: api
runtime-folder: runtime
cmdlet-folder: cmdlets/generated
custom-cmdlet-folder: cmdlets/custom
use-namespace-folders: false

pipeline:

# "Shake the tree", and normalize the model
remodeler:
input: openapi-document/identity # the plugin where we get inputs from


# Make some interpretations about what some things in the model mean
tweakcodemodel:
input: remodeler

# Specific things for Azure
tweakcodemodelazure:
input: tweakcodemodel

# Choose names for everything in c#
csnamer:
input: tweakcodemodelazure

llcsharp:
input: csnamer

# powershell generator needs the model after the csnamer is done
# creates high-level commands
create-commands:
input: csnamer # brings the code-model-v2 with it.

# creates powershell cmdlets for high-level commands. (leverages llc# code)
powershell:
input:
- create-commands # and the generated c# files
- csnamer # needs both the code model after the csnamer is done
- llcsharp # and the generated c# files

# generates c# files for http-operations
llcsharp:
input: csnamer

# explicitly declare writing out the code model -- we want to be able to emit some files from this one (temporary)
cmv2/emitter:
Expand All @@ -156,6 +138,7 @@ pipeline:
input:
- llcsharp
- powershell
- create-commands


# Specific Settings for cm emitting - selects the file types and format that cmv2-emitter will spit out.
Expand All @@ -167,8 +150,10 @@ code-model-emitter-settings:
# testing: ask for the files we need
output-artifact:
- code-model-v2.yaml # this is filtered outby default.
- code-model-v2.yaml # this is filtered outby default. (remove before production)
- source-file-csharp
- source-file-other
- source-file-csproj
- source-file-powershell

```
Loading

0 comments on commit ea6eb52

Please sign in to comment.